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	Wed May 14 03:16:18 2014
--- new/src/share/vm/runtime/advancedThresholdPolicy.cpp	Wed May 14 03:16:18 2014

*** 73,87 **** --- 73,90 ---- set_start_time(os::javaTimeMillis()); } // update_rate() is called from select_task() while holding a compile queue lock. void AdvancedThresholdPolicy::update_rate(jlong t, Method* m) { JavaThread* THREAD = JavaThread::current(); + // Skip update if counters are absent. + // Can't allocate them since we are holding compile queue lock. + if (m->method_counters() == NULL) return; + if (is_old(m)) { // We don't remove old methods from the queue, // so we can just zero the rate. - m->set_rate(0, THREAD); return; } // We don't update the rate if we've just came out of a safepoint. // delta_s is the time since last safepoint in milliseconds.
*** 93,109 **** --- 96,113 ---- // We should be running for at least 1ms. if (delta_s >= TieredRateUpdateMinTime) { // And we must've taken the previous point at least 1ms before. if (delta_t >= TieredRateUpdateMinTime && delta_e > 0) { - m->set_prev_time(t, THREAD); - m->set_prev_event_count(event_count, THREAD); - m->set_rate((float)delta_e / (float)delta_t, THREAD); // Rate is events per millisecond ! } else { if (delta_t > TieredRateUpdateMaxTime && delta_e == 0) { // If nothing happened for 25ms, zero the rate. Don't modify prev values. - m->set_rate(0, THREAD); + } } } } // Check if this method has been stale from a given number of milliseconds.
*** 162,184 **** --- 166,186 ---- jlong t = os::javaTimeMillis(); // Iterate through the queue and find a method with a maximum rate. for (CompileTask* task = compile_queue->first(); task != NULL;) { CompileTask* next_task = task->next(); Method* method = task->method(); MethodData* mdo = method->method_data(); update_rate(t, method); if (max_task == NULL) { max_task = task; max_method = method; } else { // 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()); } CompileTaskWrapper ctw(task); // Frees the task compile_queue->remove(task); + compile_queue->remove_and_mark_stale(task); method->clear_queued_for_compilation(); task = next_task; continue; }

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