< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page

        

*** 64,83 **** // Note: This is a special bug reporting site for the JVM #define DEFAULT_VENDOR_URL_BUG "http://bugreport.java.com/bugreport/crash.jsp" #define DEFAULT_JAVA_LAUNCHER "generic" - #define UNSUPPORTED_GC_OPTION(gc) \ - do { \ - if (gc) { \ - if (FLAG_IS_CMDLINE(gc)) { \ - warning(#gc " is not supported in this VM. Using Serial GC."); \ - } \ - FLAG_SET_DEFAULT(gc, false); \ - } \ - } while(0) - char* Arguments::_jvm_flags_file = NULL; char** Arguments::_jvm_flags_array = NULL; int Arguments::_num_jvm_flags = 0; char** Arguments::_jvm_args_array = NULL; int Arguments::_num_jvm_args = 0; --- 64,73 ----
*** 1832,1861 **** (size_t)os::vm_allocation_granularity(), os::max_page_size(), CollectorPolicy::compute_heap_alignment()); } void Arguments::select_gc_ergonomically() { if (os::is_server_class_machine()) { if (should_auto_select_low_pause_collector()) { ! FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true); } else { #if defined(JAVASE_EMBEDDED) ! FLAG_SET_ERGO(bool, UseParallelGC, true); #else ! FLAG_SET_ERGO(bool, UseG1GC, true); #endif } } else { ! FLAG_SET_ERGO(bool, UseSerialGC, true); } } void Arguments::select_gc() { if (!gc_selected()) { select_gc_ergonomically(); ! guarantee(gc_selected(), "No GC selected"); } } void Arguments::set_ergonomics_flags() { select_gc(); --- 1822,1870 ---- (size_t)os::vm_allocation_granularity(), os::max_page_size(), CollectorPolicy::compute_heap_alignment()); } + bool Arguments::gc_selected() { + #if INCLUDE_ALL_GCS + return UseSerialGC || UseParallelGC || UseParallelOldGC || UseConcMarkSweepGC || UseG1GC; + #else + return UseSerialGC; + #endif // INCLUDE_ALL_GCS + } + void Arguments::select_gc_ergonomically() { + #if INCLUDE_ALL_GCS if (os::is_server_class_machine()) { if (should_auto_select_low_pause_collector()) { ! FLAG_SET_ERGO_IF_DEFAULT(bool, UseConcMarkSweepGC, true); } else { #if defined(JAVASE_EMBEDDED) ! FLAG_SET_ERGO_IF_DEFAULT(bool, UseParallelGC, true); #else ! FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true); #endif } } else { ! FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true); } + #else + UNSUPPORTED_OPTION(UseG1GC); + UNSUPPORTED_OPTION(UseParallelGC); + UNSUPPORTED_OPTION(UseParallelOldGC); + UNSUPPORTED_OPTION(UseConcMarkSweepGC); + UNSUPPORTED_OPTION(UseParNewGC); + FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true); + #endif // INCLUDE_ALL_GCS } void Arguments::select_gc() { if (!gc_selected()) { select_gc_ergonomically(); ! if (!gc_selected()) { ! vm_exit_during_initialization("Garbage collector not selected (default collector explicitly disabled)", NULL); ! } } } void Arguments::set_ergonomics_flags() { select_gc();
*** 1976,1995 **** log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); log_trace(gc)("ConcGCThreads: %u", ConcGCThreads); } - #if !INCLUDE_ALL_GCS - #ifdef ASSERT - static bool verify_serial_gc_flags() { - return (UseSerialGC && - !(UseParNewGC || (UseConcMarkSweepGC) || UseG1GC || - UseParallelGC || UseParallelOldGC)); - } - #endif // ASSERT - #endif // INCLUDE_ALL_GCS - void Arguments::set_gc_specific_flags() { #if INCLUDE_ALL_GCS // Set per-collector flags if (UseParallelGC || UseParallelOldGC) { set_parallel_gc_flags(); --- 1985,1994 ----
*** 2007,2018 **** } if (MinHeapFreeRatio == 100) { // Keeping the heap 100% free is hard ;-) so limit it to 99%. FLAG_SET_ERGO(uintx, MinHeapFreeRatio, 99); } - #else // INCLUDE_ALL_GCS - assert(verify_serial_gc_flags(), "SerialGC unset"); #endif // INCLUDE_ALL_GCS } julong Arguments::limit_by_allocatable_memory(julong limit) { julong max_allocatable; --- 2006,2015 ----
*** 3461,3471 **** } #endif #ifndef TIERED // Tiered compilation is undefined. ! UNSUPPORTED_OPTION(TieredCompilation, "TieredCompilation"); #endif // If we are running in a headless jre, force java.awt.headless property // to be true unless the property has already been set. // Also allow the OS environment variable JAVA_AWT_HEADLESS to set headless state. --- 3458,3468 ---- } #endif #ifndef TIERED // Tiered compilation is undefined. ! UNSUPPORTED_OPTION(TieredCompilation); #endif // If we are running in a headless jre, force java.awt.headless property // to be true unless the property has already been set. // Also allow the OS environment variable JAVA_AWT_HEADLESS to set headless state.
*** 3782,3802 **** } #endif } } - #if !INCLUDE_ALL_GCS - static void force_serial_gc() { - FLAG_SET_DEFAULT(UseSerialGC, true); - UNSUPPORTED_GC_OPTION(UseG1GC); - UNSUPPORTED_GC_OPTION(UseParallelGC); - UNSUPPORTED_GC_OPTION(UseParallelOldGC); - UNSUPPORTED_GC_OPTION(UseConcMarkSweepGC); - UNSUPPORTED_GC_OPTION(UseParNewGC); - } - #endif // INCLUDE_ALL_GCS - // Sharing support // Construct the path to the archive static char* get_shared_archive_path() { char *shared_archive_path; if (SharedArchiveFile == NULL) { --- 3779,3788 ----
*** 4156,4166 **** "Run with -XX:Flags=%s to load the file.", hotspotrc, hotspotrc); } #if defined(_ALLBSD_SOURCE) || defined(AIX) // UseLargePages is not yet supported on BSD and AIX. ! UNSUPPORTED_OPTION(UseLargePages, "-XX:+UseLargePages"); #endif ArgumentsExt::report_unsupported_options(); #ifndef PRODUCT --- 4142,4152 ---- "Run with -XX:Flags=%s to load the file.", hotspotrc, hotspotrc); } #if defined(_ALLBSD_SOURCE) || defined(AIX) // UseLargePages is not yet supported on BSD and AIX. ! UNSUPPORTED_OPTION(UseLargePages); #endif ArgumentsExt::report_unsupported_options(); #ifndef PRODUCT
*** 4187,4199 **** } // Set object alignment values. set_object_alignment(); - #if !INCLUDE_ALL_GCS - force_serial_gc(); - #endif // INCLUDE_ALL_GCS #if !INCLUDE_CDS if (DumpSharedSpaces || RequireSharedSpaces) { jio_fprintf(defaultStream::error_stream(), "Shared spaces are not supported in this VM\n"); return JNI_ERR; --- 4173,4182 ----
< prev index next >