8133023: ParallelGCThreads is not calculated correctly

Reviewed-by: kbarrett, tschatzl, sangheki, dholmes
This commit is contained in:
Jon Masamitsu 2015-11-24 15:56:40 -08:00
parent fd08aa8d94
commit e62c706965
4 changed files with 21 additions and 3 deletions

View file

@ -35,7 +35,10 @@ const char* VM_Version::_features_str = "";
unsigned int VM_Version::_L2_data_cache_line_size = 0; unsigned int VM_Version::_L2_data_cache_line_size = 0;
void VM_Version::initialize() { 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(); PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes();
PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes(); PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes();
PrefetchFieldsAhead = prefetch_fields_ahead(); PrefetchFieldsAhead = prefetch_fields_ahead();
@ -60,8 +63,6 @@ void VM_Version::initialize() {
FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1); FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1);
} }
guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
UseSSE = 0; // Only on x86 and x64 UseSSE = 0; // Only on x86 and x64
_supports_cx8 = has_v9(); _supports_cx8 = has_v9();

View file

@ -127,6 +127,8 @@ public:
// Initialization // Initialization
static void initialize(); static void initialize();
static void init_before_ergo() { _features = determine_features(); }
// Instruction support // Instruction support
static bool has_v8() { return (_features & v8_instructions_m) != 0; } static bool has_v8() { return (_features & v8_instructions_m) != 0; }
static bool has_v9() { return (_features & v9_instructions_m) != 0; } static bool has_v9() { return (_features & v9_instructions_m) != 0; }

View file

@ -315,6 +315,10 @@ void os::init_before_ergo() {
// We need to initialize large page support here because ergonomics takes some // We need to initialize large page support here because ergonomics takes some
// decisions depending on large page support and the calculated large page size. // decisions depending on large page support and the calculated large page size.
large_page_init(); 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() { void os::signal_init() {

View file

@ -56,6 +56,12 @@ class Abstract_VM_Version: AllStatic {
unsigned int dem, unsigned int dem,
unsigned int switch_pt); unsigned int switch_pt);
public: 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(); static void initialize();
// This allows for early initialization of VM_Version information // This allows for early initialization of VM_Version information
@ -65,6 +71,11 @@ class Abstract_VM_Version: AllStatic {
// need to specialize this define VM_Version::early_initialize(). // need to specialize this define VM_Version::early_initialize().
static void 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 // Name
static const char* vm_name(); static const char* vm_name();
// Vendor // Vendor