--- old/src/share/vm/compiler/compileBroker.cpp 2013-10-22 16:19:52.983120615 +0200 +++ new/src/share/vm/compiler/compileBroker.cpp 2013-10-22 16:19:52.915120616 +0200 @@ -1297,13 +1297,6 @@ 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()) { @@ -1313,11 +1306,20 @@ MutexLocker locker(MethodCompileQueue_lock, THREAD); compile_id = assign_compile_id(method, standard_entry_bci); } + // TODO: Find out why we must always call create_native_wrapper if method->is_method_handle_intrinsic(), + // even if compilation is disabled due to a full code cache. There is a bug hidden somewhere that causes + // seg faults if we do not create the wrapper. (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); }