src/share/vm/compiler/compileBroker.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/compiler

src/share/vm/compiler/compileBroker.cpp

Print this page
rev 10832 : 8153013: BlockingCompilation test times out
Summary: Task has no invocation count and get stale at once
Reviewed-by: kvn, iveresov
rev 10833 : 8154151: VM crashes with assert "Ensure we don't compile before compilebroker init"
Summary: Drop compiles submitted with complevel_none
Reviewed-by:


1023     // and in that case it's best to protect both the testing (here) of
1024     // these bits, and their updating (here and elsewhere) under a
1025     // common lock.
1026     task = create_compile_task(queue,
1027                                compile_id, method,
1028                                osr_bci, comp_level,
1029                                hot_method, hot_count, compile_reason,
1030                                blocking);
1031   }
1032 
1033   if (blocking) {
1034     wait_for_completion(task);
1035   }
1036 }
1037 
1038 nmethod* CompileBroker::compile_method(const methodHandle& method, int osr_bci,
1039                                        int comp_level,
1040                                        const methodHandle& hot_method, int hot_count,
1041                                        CompileTask::CompileReason compile_reason,
1042                                        Thread* THREAD) {
1043   // do nothing if compilebroker is not available
1044   if (!_initialized) {
1045     return NULL;
1046   }

1047   AbstractCompiler *comp = CompileBroker::compiler(comp_level);
1048   assert(comp != NULL, "Ensure we don't compile before compilebroker init");

1049   DirectiveSet* directive = DirectivesStack::getMatchingDirective(method, comp);
1050   nmethod* nm = CompileBroker::compile_method(method, osr_bci, comp_level, hot_method, hot_count, compile_reason, directive, THREAD);
1051   DirectivesStack::release(directive);
1052   return nm;
1053 }
1054 
1055 nmethod* CompileBroker::compile_method(const methodHandle& method, int osr_bci,
1056                                          int comp_level,
1057                                          const methodHandle& hot_method, int hot_count,
1058                                          CompileTask::CompileReason compile_reason,
1059                                          DirectiveSet* directive,
1060                                          Thread* THREAD) {
1061 
1062   // make sure arguments make sense
1063   assert(method->method_holder()->is_instance_klass(), "not an instance method");
1064   assert(osr_bci == InvocationEntryBci || (0 <= osr_bci && osr_bci < method->code_size()), "bci out of range");
1065   assert(!method->is_abstract() && (osr_bci == InvocationEntryBci || !method->is_native()), "cannot compile abstract/native methods");
1066   assert(!method->method_holder()->is_not_initialized(), "method holder must be initialized");
1067   assert(!TieredCompilation || comp_level <= TieredStopAtLevel, "Invalid compilation level");
1068   // allow any levels for WhiteBox




1023     // and in that case it's best to protect both the testing (here) of
1024     // these bits, and their updating (here and elsewhere) under a
1025     // common lock.
1026     task = create_compile_task(queue,
1027                                compile_id, method,
1028                                osr_bci, comp_level,
1029                                hot_method, hot_count, compile_reason,
1030                                blocking);
1031   }
1032 
1033   if (blocking) {
1034     wait_for_completion(task);
1035   }
1036 }
1037 
1038 nmethod* CompileBroker::compile_method(const methodHandle& method, int osr_bci,
1039                                        int comp_level,
1040                                        const methodHandle& hot_method, int hot_count,
1041                                        CompileTask::CompileReason compile_reason,
1042                                        Thread* THREAD) {
1043   // Do nothing if compilebroker is not initalized or compiles are submitted on level none
1044   if (!_initialized || comp_level == CompLevel_none) {
1045     return NULL;
1046   }
1047 
1048   AbstractCompiler *comp = CompileBroker::compiler(comp_level);
1049   assert(comp != NULL, "Ensure we have a compiler");
1050 
1051   DirectiveSet* directive = DirectivesStack::getMatchingDirective(method, comp);
1052   nmethod* nm = CompileBroker::compile_method(method, osr_bci, comp_level, hot_method, hot_count, compile_reason, directive, THREAD);
1053   DirectivesStack::release(directive);
1054   return nm;
1055 }
1056 
1057 nmethod* CompileBroker::compile_method(const methodHandle& method, int osr_bci,
1058                                          int comp_level,
1059                                          const methodHandle& hot_method, int hot_count,
1060                                          CompileTask::CompileReason compile_reason,
1061                                          DirectiveSet* directive,
1062                                          Thread* THREAD) {
1063 
1064   // make sure arguments make sense
1065   assert(method->method_holder()->is_instance_klass(), "not an instance method");
1066   assert(osr_bci == InvocationEntryBci || (0 <= osr_bci && osr_bci < method->code_size()), "bci out of range");
1067   assert(!method->is_abstract() && (osr_bci == InvocationEntryBci || !method->is_native()), "cannot compile abstract/native methods");
1068   assert(!method->method_holder()->is_not_initialized(), "method holder must be initialized");
1069   assert(!TieredCompilation || comp_level <= TieredStopAtLevel, "Invalid compilation level");
1070   // allow any levels for WhiteBox


src/share/vm/compiler/compileBroker.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File