src/share/vm/compiler/compileBroker.cpp

Print this page

        

@@ -1297,17 +1297,10 @@
   // a lock the compiling thread can not acquire. Prefetch it here.
   if (JvmtiExport::should_post_compiled_method_load()) {
     method->jmethod_id();
   }
 
-  // If the compiler is shut off due to code cache getting full
-  // fail out now so blocking compiles dont hang the java thread
-  if (!should_compile_new_jobs()) {
-    CompilationPolicy::policy()->delay_compilation(method());
-    return NULL;
-  }
-
   // do the compilation
   if (method->is_native()) {
     if (!PreferInterpreterNativeStubs || method->is_method_handle_intrinsic()) {
       // Acquire our lock.
       int compile_id;

@@ -1318,10 +1311,17 @@
       (void) AdapterHandlerLibrary::create_native_wrapper(method, compile_id);
     } else {
       return NULL;
     }
   } else {
+    // If the compiler is shut off due to code cache getting full
+    // fail out now so blocking compiles dont hang the java thread
+    if (!should_compile_new_jobs()) {
+      CompilationPolicy::policy()->delay_compilation(method());
+      return NULL;
+    }
+
     compile_method_base(method, osr_bci, comp_level, hot_method, hot_count, comment, THREAD);
   }
 
   // return requested nmethod
   // We accept a higher level osr method