1622 return 0;
1623 } else if (scaled_freq > nth_bit(max_freq_bits)) {
1624 return max_freq_bits;
1625 } else {
1626 return log2_intptr(scaled_freq);
1627 }
1628 }
1629
1630 void Arguments::set_tiered_flags() {
1631 // With tiered, set default policy to SimpleThresholdPolicy, which is 2.
1632 if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) {
1633 FLAG_SET_DEFAULT(CompilationPolicyChoice, 2);
1634 }
1635 if (CompilationPolicyChoice < 2) {
1636 vm_exit_during_initialization(
1637 "Incompatible compilation policy selected", NULL);
1638 }
1639 // Increase the code cache size - tiered compiles a lot more.
1640 if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
1641 FLAG_SET_ERGO(uintx, ReservedCodeCacheSize,
1642 MIN2(CODE_CACHE_DEFAULT_LIMIT, ReservedCodeCacheSize * 5));
1643 }
1644 // Enable SegmentedCodeCache if TieredCompilation is enabled and ReservedCodeCacheSize >= 240M
1645 if (FLAG_IS_DEFAULT(SegmentedCodeCache) && ReservedCodeCacheSize >= 240*M) {
1646 FLAG_SET_ERGO(bool, SegmentedCodeCache, true);
1647 }
1648 if (!UseInterpreter) { // -Xcomp
1649 Tier3InvokeNotifyFreqLog = 0;
1650 Tier4InvocationThreshold = 0;
1651 }
1652
1653 if (CompileThresholdScaling < 0) {
1654 vm_exit_during_initialization("Negative value specified for CompileThresholdScaling", NULL);
1655 }
1656
1657 // Scale tiered compilation thresholds.
1658 // CompileThresholdScaling == 0.0 is equivalent to -Xint and leaves compilation thresholds unchanged.
1659 if (!FLAG_IS_DEFAULT(CompileThresholdScaling) && CompileThresholdScaling > 0.0) {
1660 FLAG_SET_ERGO(intx, Tier0InvokeNotifyFreqLog, scaled_freq_log(Tier0InvokeNotifyFreqLog));
1661 FLAG_SET_ERGO(intx, Tier0BackedgeNotifyFreqLog, scaled_freq_log(Tier0BackedgeNotifyFreqLog));
1662
|
1622 return 0;
1623 } else if (scaled_freq > nth_bit(max_freq_bits)) {
1624 return max_freq_bits;
1625 } else {
1626 return log2_intptr(scaled_freq);
1627 }
1628 }
1629
1630 void Arguments::set_tiered_flags() {
1631 // With tiered, set default policy to SimpleThresholdPolicy, which is 2.
1632 if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) {
1633 FLAG_SET_DEFAULT(CompilationPolicyChoice, 2);
1634 }
1635 if (CompilationPolicyChoice < 2) {
1636 vm_exit_during_initialization(
1637 "Incompatible compilation policy selected", NULL);
1638 }
1639 // Increase the code cache size - tiered compiles a lot more.
1640 if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
1641 FLAG_SET_ERGO(uintx, ReservedCodeCacheSize,
1642 MIN2(CODE_CACHE_DEFAULT_LIMIT, (size_t)ReservedCodeCacheSize * 5));
1643 }
1644 // Enable SegmentedCodeCache if TieredCompilation is enabled and ReservedCodeCacheSize >= 240M
1645 if (FLAG_IS_DEFAULT(SegmentedCodeCache) && ReservedCodeCacheSize >= 240*M) {
1646 FLAG_SET_ERGO(bool, SegmentedCodeCache, true);
1647 }
1648 if (!UseInterpreter) { // -Xcomp
1649 Tier3InvokeNotifyFreqLog = 0;
1650 Tier4InvocationThreshold = 0;
1651 }
1652
1653 if (CompileThresholdScaling < 0) {
1654 vm_exit_during_initialization("Negative value specified for CompileThresholdScaling", NULL);
1655 }
1656
1657 // Scale tiered compilation thresholds.
1658 // CompileThresholdScaling == 0.0 is equivalent to -Xint and leaves compilation thresholds unchanged.
1659 if (!FLAG_IS_DEFAULT(CompileThresholdScaling) && CompileThresholdScaling > 0.0) {
1660 FLAG_SET_ERGO(intx, Tier0InvokeNotifyFreqLog, scaled_freq_log(Tier0InvokeNotifyFreqLog));
1661 FLAG_SET_ERGO(intx, Tier0BackedgeNotifyFreqLog, scaled_freq_log(Tier0BackedgeNotifyFreqLog));
1662
|