# HG changeset patch # User poonam # Date 1458088796 25200 # Node ID d2dd79a4fd69bb4b41ccdebcc48786a82ef14e04 # Parent 0cd040567d60566809bfff9f482dcf828ee01d5f 8133023: ParallelGCThreads is not calculated correctly Reviewed-by: kbarrett, tschatzl diff -r 0cd040567d60 -r d2dd79a4fd69 src/cpu/sparc/vm/vm_version_sparc.cpp --- a/src/cpu/sparc/vm/vm_version_sparc.cpp Wed Mar 09 19:51:23 2016 +0300 +++ b/src/cpu/sparc/vm/vm_version_sparc.cpp Tue Mar 15 17:39:56 2016 -0700 @@ -40,7 +40,10 @@ unsigned int VM_Version::_L2_data_cache_line_size = 0; void VM_Version::initialize() { - _features = determine_features(); + + assert(_features != VM_Version::unknown_m, "System pre-initialization is not complete."); + guarantee(VM_Version::has_v9(), "only SPARC v9 is supported"); + PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes(); PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes(); PrefetchFieldsAhead = prefetch_fields_ahead(); @@ -76,8 +79,6 @@ FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1); } - guarantee(VM_Version::has_v9(), "only SPARC v9 is supported"); - assert(ArraycopySrcPrefetchDistance < 4096, "invalid value"); if (ArraycopySrcPrefetchDistance >= 4096) ArraycopySrcPrefetchDistance = 4064; diff -r 0cd040567d60 -r d2dd79a4fd69 src/cpu/sparc/vm/vm_version_sparc.hpp --- a/src/cpu/sparc/vm/vm_version_sparc.hpp Wed Mar 09 19:51:23 2016 +0300 +++ b/src/cpu/sparc/vm/vm_version_sparc.hpp Tue Mar 15 17:39:56 2016 -0700 @@ -124,6 +124,8 @@ // Initialization static void initialize(); + static void init_before_ergo() { _features = determine_features(); } + // Instruction support static bool has_v8() { return (_features & v8_instructions_m) != 0; } static bool has_v9() { return (_features & v9_instructions_m) != 0; } diff -r 0cd040567d60 -r d2dd79a4fd69 src/share/vm/runtime/os.cpp --- a/src/share/vm/runtime/os.cpp Wed Mar 09 19:51:23 2016 +0300 +++ b/src/share/vm/runtime/os.cpp Tue Mar 15 17:39:56 2016 -0700 @@ -325,6 +325,10 @@ // We need to initialize large page support here because ergonomics takes some // decisions depending on large page support and the calculated large page size. large_page_init(); + + // VM version initialization identifies some characteristics of the + // the platform that are used during ergonomic decisions. + VM_Version::init_before_ergo(); } void os::signal_init() { diff -r 0cd040567d60 -r d2dd79a4fd69 src/share/vm/runtime/vm_version.hpp --- a/src/share/vm/runtime/vm_version.hpp Wed Mar 09 19:51:23 2016 +0300 +++ b/src/share/vm/runtime/vm_version.hpp Tue Mar 15 17:39:56 2016 -0700 @@ -54,6 +54,12 @@ unsigned int dem, unsigned int switch_pt); public: + // Called as part of the runtime services initialization which is + // called from the management module initialization (via init_globals()) + // after argument parsing and attaching of the main thread has + // occurred. Examines a variety of the hardware capabilities of + // the platform to determine which features can be used to execute the + // program. static void initialize(); // This allows for early initialization of VM_Version information @@ -63,6 +69,11 @@ // need to specialize this define VM_Version::early_initialize(). static void early_initialize() { } + // Called to initialize VM variables needing initialization + // after command line parsing. Platforms that need to specialize + // this should define VM_Version::init_before_ergo(). + static void init_before_ergo() {} + // Name static const char* vm_name(); // Vendor