src/share/vm/runtime/advancedThresholdPolicy.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/runtime/advancedThresholdPolicy.cpp	Tue Mar  1 14:59:45 2016
--- new/src/share/vm/runtime/advancedThresholdPolicy.cpp	Tue Mar  1 14:59:45 2016

*** 22,31 **** --- 22,33 ---- * */ #include "precompiled.hpp" #include "code/codeCache.hpp" + #include "compiler/compilerDirectives.hpp" + #include "compiler/compilerOracle.hpp" #include "compiler/compileTask.hpp" #include "runtime/advancedThresholdPolicy.hpp" #include "runtime/simpleThresholdPolicy.inline.hpp" #ifdef TIERED
*** 177,190 **** --- 179,206 ---- update_rate(t, method); if (max_task == NULL) { max_task = task; max_method = method; } else { + // Prefer 'blocking' compilations to minimize waits on them. + // This also helps to prevent blocking compiles from getting stale. + CompLevel level = (CompLevel)task->comp_level(); + bool backgroundCompilation; + DirectiveSet* directive = + DirectivesStack::getMatchingDirective(methodHandle(method), + CompileBroker::compiler(level)); + backgroundCompilation = directive->BackgroundCompilationOption; + DirectivesStack::release(directive); + if (backgroundCompilation == false) { + max_task = task; + max_method = method; + break; + } // If a method has been stale for some time, remove it from the queue. if (is_stale(t, TieredCompileTaskTimeout, method) && !is_old(method)) { if (PrintTieredEvents) { ! print_event(REMOVE_FROM_QUEUE, method, method, task->osr_bci(), (CompLevel)task->comp_level()); } task->log_task_dequeued("stale"); compile_queue->remove_and_mark_stale(task); method->clear_queued_for_compilation(); task = next_task;

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