diff --git a/src/cpu/sparc/vm/vm_version_sparc.cpp b/src/cpu/sparc/vm/vm_version_sparc.cpp index 664f29e0fdec9a7046a37e4568720f692b843a2a..72e98c6c2c1c47f71bfcd59bc525977c46532b49 100644 --- a/src/cpu/sparc/vm/vm_version_sparc.cpp +++ b/src/cpu/sparc/vm/vm_version_sparc.cpp @@ -40,7 +40,10 @@ const char* VM_Version::_features_str = ""; 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 @@ void VM_Version::initialize() { 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 --git a/src/cpu/sparc/vm/vm_version_sparc.hpp b/src/cpu/sparc/vm/vm_version_sparc.hpp index 59969ed1089beeaf7029754afdb87c9c884d0f42..c493100d15dc087c8362442451899813063f5bfa 100644 --- a/src/cpu/sparc/vm/vm_version_sparc.hpp +++ b/src/cpu/sparc/vm/vm_version_sparc.hpp @@ -124,6 +124,8 @@ public: // 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 --git a/src/share/vm/prims/jvmtiExport.cpp b/src/share/vm/prims/jvmtiExport.cpp index 719a4c3d255f4f8b3f1d846a06fdc87890228d3a..cec38ec821a3522b9435588dfd84b280db033031 100644 --- a/src/share/vm/prims/jvmtiExport.cpp +++ b/src/share/vm/prims/jvmtiExport.cpp @@ -995,7 +995,9 @@ void JvmtiExport::post_class_unload(Klass* klass) { // Before we call the JVMTI agent, we have to set the state in the // thread for which we are proxying. JavaThreadState prev_state = real_thread->thread_state(); - assert(prev_state == _thread_blocked, "JavaThread should be at safepoint"); + assert(((Thread *)real_thread)->is_ConcurrentGC_thread() || + (real_thread->is_Java_thread() && prev_state == _thread_blocked), + "should be ConcurrentGCThread or JavaThread at safepoint"); real_thread->set_thread_state(_thread_in_native); jvmtiExtensionEvent callback = env->ext_callbacks()->ClassUnload; diff --git a/src/share/vm/runtime/os.cpp b/src/share/vm/runtime/os.cpp index e50f8888f4f79b74bd241cf8849ef28d664c0b08..21764cb0bfa3817d2b5a38191e611c43182cae80 100644 --- a/src/share/vm/runtime/os.cpp +++ b/src/share/vm/runtime/os.cpp @@ -325,6 +325,10 @@ void os::init_before_ergo() { // 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 --git a/src/share/vm/runtime/vm_version.hpp b/src/share/vm/runtime/vm_version.hpp index 07ff4ba8d1d2a9beca431588501ab7bc49f7af14..feabadf9baa4a8bb77f3dedf5b3a282a4c11683f 100644 --- a/src/share/vm/runtime/vm_version.hpp +++ b/src/share/vm/runtime/vm_version.hpp @@ -54,6 +54,12 @@ class Abstract_VM_Version: AllStatic { 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 @@ class Abstract_VM_Version: AllStatic { // 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 diff --git a/test/compiler/intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java b/test/compiler/intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java index 36c3060aa0edb342913621ea155cec1433f54075..5ddca7a0df1f3885e631992992a7ebc8964bdefe 100644 --- a/test/compiler/intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java +++ b/test/compiler/intrinsics/montgomerymultiply/MontgomeryMultiplyTest.java @@ -39,12 +39,12 @@ import java.util.Random; * @library /testlibrary * @requires (os.simpleArch == "x64") & (os.family != "windows") * @summary Verify that the Montgomery multiply intrinsic works and correctly checks its arguments. - * @run main/othervm -XX:+UseMontgomerySquareIntrinsic -XX:+UseMontgomeryMultiplyIntrinsic - * MontgomeryMultiplyTest - * @run main/othervm -XX:+UseMontgomerySquareIntrinsic -XX:-UseMontgomeryMultiplyIntrinsic - * MontgomeryMultiplyTest - * @run main/othervm -XX:-UseMontgomerySquareIntrinsic -XX:+UseMontgomeryMultiplyIntrinsic - * MontgomeryMultiplyTest + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseMontgomerySquareIntrinsic + * -XX:+UseMontgomeryMultiplyIntrinsic MontgomeryMultiplyTest + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseMontgomerySquareIntrinsic + * -XX:-UseMontgomeryMultiplyIntrinsic MontgomeryMultiplyTest + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseMontgomerySquareIntrinsic + * -XX:+UseMontgomeryMultiplyIntrinsic MontgomeryMultiplyTest */ public class MontgomeryMultiplyTest { diff --git a/test/compiler/intrinsics/squaretolen/TestSquareToLen.java b/test/compiler/intrinsics/squaretolen/TestSquareToLen.java index d472b7ecadd9c61d6ed1b18a4a76a13e52f59d2e..47c1e47ca12cb2a6d63cc36333b3b350f8ace3b1 100644 --- a/test/compiler/intrinsics/squaretolen/TestSquareToLen.java +++ b/test/compiler/intrinsics/squaretolen/TestSquareToLen.java @@ -28,6 +28,7 @@ * @summary Add C2 x86 intrinsic for BigInteger::squareToLen() method * * @run main/othervm/timeout=600 -XX:-TieredCompilation -Xbatch + * -XX:+IgnoreUnrecognizedVMOptions * -XX:+UseSquareToLenIntrinsic * -XX:CompileCommand=exclude,TestSquareToLen::main * -XX:CompileCommand=option,TestSquareToLen::base_multiply,ccstr,DisableIntrinsic,_squareToLen