comparison src/share/vm/compiler/compileBroker.cpp @ 16399:4481cf549cfc

removed (Java based) CompilationQueue
author Doug Simon <doug.simon@oracle.com>
date Thu, 03 Jul 2014 23:28:35 +0200
parents 518a221dbbde
children ce6696559683
comparison
equal deleted inserted replaced
16398:c5ab3fbec257 16399:4481cf549cfc
803 } 803 }
804 #endif // COMPILER1 804 #endif // COMPILER1
805 805
806 #if defined(COMPILERGRAAL) 806 #if defined(COMPILERGRAAL)
807 _compilers[1] = graal; 807 _compilers[1] = graal;
808 if (UseGraalCompilationQueue) { 808 if (FLAG_IS_DEFAULT(GraalThreads)) {
809 c2_count = 0; 809 if (!TieredCompilation && FLAG_IS_DEFAULT(BootstrapGraal) || BootstrapGraal) {
810 // Graal will bootstrap so give it more threads
811 c2_count = os::active_processor_count();
812 }
810 } else { 813 } else {
811 if (FLAG_IS_DEFAULT(GraalThreads)) { 814 c2_count = GraalThreads;
812 if (!TieredCompilation && FLAG_IS_DEFAULT(BootstrapGraal) || BootstrapGraal) {
813 // Graal will bootstrap so give it the same number of threads
814 // as we would give the Java based compilation queue.
815 c2_count = os::active_processor_count();
816 }
817 } else {
818 c2_count = GraalThreads;
819 }
820 } 815 }
821 #endif // COMPILERGRAAL 816 #endif // COMPILERGRAAL
822 817
823 #ifdef COMPILER2 818 #ifdef COMPILER2
824 if (c2_count > 0) { 819 if (c2_count > 0) {
1153 // between the reference handler thread, a GC (instigated 1148 // between the reference handler thread, a GC (instigated
1154 // by a compiler thread), and compiled method registration. 1149 // by a compiler thread), and compiled method registration.
1155 if (InstanceRefKlass::owns_pending_list_lock(JavaThread::current())) { 1150 if (InstanceRefKlass::owns_pending_list_lock(JavaThread::current())) {
1156 return; 1151 return;
1157 } 1152 }
1158
1159 #ifdef COMPILERGRAAL
1160 if (UseGraalCompilationQueue) {
1161 // In tiered mode we want to only handle highest tier compiles and
1162 // in non-tiered mode the default level should be
1163 // CompLevel_full_optimization which equals CompLevel_highest_tier.
1164 assert(TieredCompilation || comp_level == CompLevel_full_optimization, "incorrect compile level");
1165 assert(CompLevel_full_optimization == CompLevel_highest_tier, "incorrect level definition");
1166 if (comp_level == CompLevel_full_optimization) {
1167 JavaThread* javaThread = JavaThread::current();
1168 if (javaThread->can_schedule_graal_compilation()) {
1169 bool blockingCompilation = is_compile_blocking(method, osr_bci);
1170 NoGraalCompilationScheduling ngcs(javaThread);
1171 GraalCompiler::instance()->compile_method(method, osr_bci, NULL, blockingCompilation);
1172 }
1173 return;
1174 }
1175 assert(TieredCompilation, "should only reach here in tiered mode");
1176 }
1177 #endif // COMPILERGRAAL
1178 1153
1179 // Outputs from the following MutexLocker block: 1154 // Outputs from the following MutexLocker block:
1180 CompileTask* task = NULL; 1155 CompileTask* task = NULL;
1181 bool blocking = false; 1156 bool blocking = false;
1182 CompileQueue* queue = compile_queue(comp_level); 1157 CompileQueue* queue = compile_queue(comp_level);
1982 int compilable = ciEnv::MethodCompilable; 1957 int compilable = ciEnv::MethodCompilable;
1983 AbstractCompiler *comp = compiler(task_level); 1958 AbstractCompiler *comp = compiler(task_level);
1984 1959
1985 #ifdef COMPILERGRAAL 1960 #ifdef COMPILERGRAAL
1986 if (comp != NULL && comp->is_graal()) { 1961 if (comp != NULL && comp->is_graal()) {
1987 assert(!UseGraalCompilationQueue, "should not reach here");
1988 GraalCompiler* graal = (GraalCompiler*) comp; 1962 GraalCompiler* graal = (GraalCompiler*) comp;
1989 1963
1990 TraceTime t1("compilation", &time); 1964 TraceTime t1("compilation", &time);
1991 EventCompilation event; 1965 EventCompilation event;
1992 1966
1993 graal->compile_method(target_handle, osr_bci, task, false); 1967 graal->compile_method(target_handle, osr_bci, task);
1994 1968
1995 post_compile(thread, task, event, task->code() != NULL, NULL); 1969 post_compile(thread, task, event, task->code() != NULL, NULL);
1996 } else 1970 } else
1997 #endif // COMPILERGRAAL 1971 #endif // COMPILERGRAAL
1998 { 1972 {