本文整理汇总了C++中methodOop::set_prev_time方法的典型用法代码示例。如果您正苦于以下问题:C++ methodOop::set_prev_time方法的具体用法?C++ methodOop::set_prev_time怎么用?C++ methodOop::set_prev_time使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类methodOop
的用法示例。
在下文中一共展示了methodOop::set_prev_time方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update_rate
// update_rate() is called from select_task() while holding a compile queue lock.
void AdvancedThresholdPolicy::update_rate(jlong t, methodOop m) {
if (is_old(m)) {
// We don't remove old methods from the queue,
// so we can just zero the rate.
m->set_rate(0);
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.
jlong delta_s = t - SafepointSynchronize::end_of_last_safepoint();
jlong delta_t = t - (m->prev_time() != 0 ? m->prev_time() : start_time()); // milliseconds since the last measurement
// How many events were there since the last time?
int event_count = m->invocation_count() + m->backedge_count();
int delta_e = event_count - m->prev_event_count();
// 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);
m->set_prev_event_count(event_count);
m->set_rate((float)delta_e / (float)delta_t); // 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);
}
}
}