< prev index next >

src/share/vm/runtime/simpleThresholdPolicy.cpp

Print this page

        

@@ -236,12 +236,15 @@
   if (level == CompLevel_none) {
     return;
   }
 
 #if INCLUDE_JVMCI
-  // We can't compile with a JVMCI compiler until the module system is initialized.
-  if (level == CompLevel_full_optimization && UseJVMCICompiler && !Universe::is_module_initialized()) {
+  // We can't compile with a JVMCI compiler until the module system is initialized past
+  // phase 3.  The JVMCI API itself isn't available until phase 2 and ServiceLoader isn't
+  // usable until after phase 3.
+  if (level == CompLevel_full_optimization && UseJVMCICompiler && SystemDictionary::java_system_loader() == NULL) {
+    assert(Universe::is_module_initialized(), "must be");
     return;
   }
 #endif
 
   // Check if the method can be compiled. If it cannot be compiled with C1, continue profiling
< prev index next >