Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/compilationPolicy.cpp @ 22764:9c0966b935a9
converted select_task_blocking_aware into select_task_helper (GRAAL-1387)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 08 Jan 2016 23:45:00 +0100 |
parents | 94b7354ef0e0 |
children | 7ae6a635fad0 |
comparison
equal
deleted
inserted
replaced
22763:94b7354ef0e0 | 22764:9c0966b935a9 |
---|---|
158 bool CompilationPolicy::is_compilation_enabled() { | 158 bool CompilationPolicy::is_compilation_enabled() { |
159 // NOTE: CompileBroker::should_compile_new_jobs() checks for UseCompiler | 159 // NOTE: CompileBroker::should_compile_new_jobs() checks for UseCompiler |
160 return !delay_compilation_during_startup() && CompileBroker::should_compile_new_jobs(); | 160 return !delay_compilation_during_startup() && CompileBroker::should_compile_new_jobs(); |
161 } | 161 } |
162 | 162 |
163 CompileTask* CompilationPolicy::select_task_helper(CompileQueue* compile_queue) { | |
163 #ifdef COMPILERJVMCI | 164 #ifdef COMPILERJVMCI |
164 CompileTask* CompilationPolicy::select_task_blocking_aware(CompileQueue* compile_queue) { | |
165 if (!BackgroundCompilation) { | 165 if (!BackgroundCompilation) { |
166 /* | |
167 * In blocking compilation mode, the CompileBroker will make | |
168 * compilations submitted by a JVMCI compiler thread non-blocking. These | |
169 * compilations should be scheduled after all blocking compilations | |
170 * to service non-compiler related compilations sooner and reduce the | |
171 * chance of such compilations timing out. | |
172 */ | |
166 for (CompileTask* task = compile_queue->first(); task != NULL; task = task->next()) { | 173 for (CompileTask* task = compile_queue->first(); task != NULL; task = task->next()) { |
167 if (task->is_blocking()) { | 174 if (task->is_blocking()) { |
168 return task; | 175 return task; |
169 } | 176 } |
170 } | 177 } |
171 } | 178 } |
179 #endif | |
172 return compile_queue->first(); | 180 return compile_queue->first(); |
173 } | 181 } |
174 #endif | |
175 | 182 |
176 #ifndef PRODUCT | 183 #ifndef PRODUCT |
177 void CompilationPolicy::print_time() { | 184 void CompilationPolicy::print_time() { |
178 tty->print_cr ("Accumulated compilationPolicy times:"); | 185 tty->print_cr ("Accumulated compilationPolicy times:"); |
179 tty->print_cr ("---------------------------"); | 186 tty->print_cr ("---------------------------"); |
351 mcs->backedge_counter()->set_state(InvocationCounter::wait_for_nothing); | 358 mcs->backedge_counter()->set_state(InvocationCounter::wait_for_nothing); |
352 } | 359 } |
353 } | 360 } |
354 | 361 |
355 CompileTask* NonTieredCompPolicy::select_task(CompileQueue* compile_queue) { | 362 CompileTask* NonTieredCompPolicy::select_task(CompileQueue* compile_queue) { |
356 #ifdef COMPILERJVMCI | 363 return select_task_helper(compile_queue); |
357 return select_task_blocking_aware(compile_queue); | |
358 #else | |
359 return compile_queue->first(); | |
360 #endif | |
361 } | 364 } |
362 | 365 |
363 bool NonTieredCompPolicy::is_mature(Method* method) { | 366 bool NonTieredCompPolicy::is_mature(Method* method) { |
364 MethodData* mdo = method->method_data(); | 367 MethodData* mdo = method->method_data(); |
365 assert(mdo != NULL, "Should be"); | 368 assert(mdo != NULL, "Should be"); |