< prev index next >

src/hotspot/share/runtime/arguments.cpp

Print this page

3424   }
3425 
3426   apply_debugger_ergo();
3427 
3428   // The VMThread needs to stop now and then to execute these debug options.
3429   if ((HandshakeALot || SafepointALot) && FLAG_IS_DEFAULT(GuaranteedSafepointInterval)) {
3430     FLAG_SET_DEFAULT(GuaranteedSafepointInterval, 1000);
3431   }
3432 
3433   if (log_is_enabled(Info, arguments)) {
3434     LogStream st(Log(arguments)::info());
3435     Arguments::print_on(&st);
3436   }
3437 
3438   return JNI_OK;
3439 }
3440 
3441 void Arguments::set_compact_headers_flags() {
3442 #ifdef _LP64
3443   if (UseCompactObjectHeaders && !UseObjectMonitorTable) {
3444     if (FLAG_IS_CMDLINE(UseObjectMonitorTable)) {
3445       warning("-UseObjectMonitorTable is incompatible with +UseCompactObjectHeaders; ignoring -UseObjectMonitorTable");








3446     }
3447     FLAG_SET_DEFAULT(UseObjectMonitorTable, true);





3448   }
3449 #endif
3450 }
3451 
3452 jint Arguments::apply_ergo() {
3453   // Set flags based on ergonomics.
3454   jint result = set_ergonomics_flags();
3455   if (result != JNI_OK) return result;
3456 
3457   // Set heap size based on available physical memory
3458   GCConfig::arguments()->set_heap_size();
3459 
3460   GCConfig::arguments()->initialize();
3461 
3462   set_compact_headers_flags();
3463 
3464   CompressedKlassPointers::pre_initialize();
3465 
3466   CDSConfig::ergo_initialize();
3467 

3424   }
3425 
3426   apply_debugger_ergo();
3427 
3428   // The VMThread needs to stop now and then to execute these debug options.
3429   if ((HandshakeALot || SafepointALot) && FLAG_IS_DEFAULT(GuaranteedSafepointInterval)) {
3430     FLAG_SET_DEFAULT(GuaranteedSafepointInterval, 1000);
3431   }
3432 
3433   if (log_is_enabled(Info, arguments)) {
3434     LogStream st(Log(arguments)::info());
3435     Arguments::print_on(&st);
3436   }
3437 
3438   return JNI_OK;
3439 }
3440 
3441 void Arguments::set_compact_headers_flags() {
3442 #ifdef _LP64
3443   if (UseCompactObjectHeaders && !UseObjectMonitorTable) {
3444     // If UseCompactObjectHeaders is on the command line, turn on UseObjectMonitorTable.
3445     if (FLAG_IS_CMDLINE(UseCompactObjectHeaders)) {
3446       FLAG_SET_DEFAULT(UseObjectMonitorTable, true);
3447 
3448       // If UseObjectMonitorTable is on the command line, turn off UseCompactObjectHeaders.
3449     } else if (FLAG_IS_CMDLINE(UseObjectMonitorTable)) {
3450       FLAG_SET_DEFAULT(UseCompactObjectHeaders, false);
3451       // If neither on the command line, the defaults are incompatible, but turn on UseObjectMonitorTable.
3452     } else {
3453       FLAG_SET_DEFAULT(UseObjectMonitorTable, true);
3454     }
3455   }
3456   if (UseCompactObjectHeaders && FLAG_IS_DEFAULT(hashCode)) {
3457     hashCode = 6;
3458   }
3459   if (UseCompactObjectHeaders && FLAG_IS_DEFAULT(CompressedClassSpaceSize)) {
3460     FLAG_SET_DEFAULT(CompressedClassSpaceSize, CompressedKlassPointers::max_klass_range_size_coh);
3461   }
3462 #endif
3463 }
3464 
3465 jint Arguments::apply_ergo() {
3466   // Set flags based on ergonomics.
3467   jint result = set_ergonomics_flags();
3468   if (result != JNI_OK) return result;
3469 
3470   // Set heap size based on available physical memory
3471   GCConfig::arguments()->set_heap_size();
3472 
3473   GCConfig::arguments()->initialize();
3474 
3475   set_compact_headers_flags();
3476 
3477   CompressedKlassPointers::pre_initialize();
3478 
3479   CDSConfig::ergo_initialize();
3480 
< prev index next >