Mercurial > hg > graal-jvmci-8
diff src/share/vm/runtime/safepoint.cpp @ 1783:d5d065957597
6953144: Tiered compilation
Summary: Infrastructure for tiered compilation support (interpreter + c1 + c2) for 32 and 64 bit. Simple tiered policy implementation.
Reviewed-by: kvn, never, phh, twisti
author | iveresov |
---|---|
date | Fri, 03 Sep 2010 17:51:07 -0700 |
parents | da877bdc9000 |
children | ce6848d0666d |
line wrap: on
line diff
--- a/src/share/vm/runtime/safepoint.cpp Thu Sep 02 11:40:02 2010 -0700 +++ b/src/share/vm/runtime/safepoint.cpp Fri Sep 03 17:51:07 2010 -0700 @@ -430,29 +430,7 @@ return false; } -jlong CounterDecay::_last_timestamp = 0; -static void do_method(methodOop m) { - m->invocation_counter()->decay(); -} - -void CounterDecay::decay() { - _last_timestamp = os::javaTimeMillis(); - - // This operation is going to be performed only at the end of a safepoint - // and hence GC's will not be going on, all Java mutators are suspended - // at this point and hence SystemDictionary_lock is also not needed. - assert(SafepointSynchronize::is_at_safepoint(), "can only be executed at a safepoint"); - int nclasses = SystemDictionary::number_of_classes(); - double classes_per_tick = nclasses * (CounterDecayMinIntervalLength * 1e-3 / - CounterHalfLifeTime); - for (int i = 0; i < classes_per_tick; i++) { - klassOop k = SystemDictionary::try_get_next_class(); - if (k != NULL && k->klass_part()->oop_is_instance()) { - instanceKlass::cast(k)->methods_do(do_method); - } - } -} // Various cleaning tasks that should be done periodically at safepoints void SafepointSynchronize::do_cleanup_tasks() { @@ -465,10 +443,9 @@ TraceTime t2("updating inline caches", TraceSafepointCleanupTime); InlineCacheBuffer::update_inline_caches(); } - - if(UseCounterDecay && CounterDecay::is_decay_needed()) { - TraceTime t3("decaying counter", TraceSafepointCleanupTime); - CounterDecay::decay(); + { + TraceTime t3("compilation policy safepoint handler", TraceSafepointCleanupTime); + CompilationPolicy::policy()->do_safepoint_work(); } TraceTime t4("sweeping nmethods", TraceSafepointCleanupTime);