# HG changeset patch # User Gilles Duboscq # Date 1416305019 -3600 # Node ID 4a1b4400bb1fe61e141a5d700b3866e7499cffa5 # Parent 03c63fd2f714852e673cf901a352f1ca1de3461d SharedRuntime::compute_compiled_exc_handler: explain why it seems that we deoptimzie twice, use Deoptimization::deoptimize since we already have our hands on the frame. diff -r 03c63fd2f714 -r 4a1b4400bb1f src/share/vm/runtime/sharedRuntime.cpp --- a/src/share/vm/runtime/sharedRuntime.cpp Tue Nov 18 10:55:59 2014 +0100 +++ b/src/share/vm/runtime/sharedRuntime.cpp Tue Nov 18 11:03:39 2014 +0100 @@ -659,11 +659,17 @@ } else { // there is no exception handler for this pc => deoptimize nm->make_not_entrant(); + + // Use Deoptimization::deoptimize for all of its side-effects: + // revoking biases of monitors, gathering traps statistics, logging... + // it also patches the return pc but we do not care about that + // since we return a continuation to the deopt_blob below. JavaThread* thread = JavaThread::current(); - RegisterMap reg_map(thread); + RegisterMap reg_map(thread, UseBiasedLocking); frame runtime_frame = thread->last_frame(); frame caller_frame = runtime_frame.sender(®_map); - Deoptimization::deoptimize_frame(thread, caller_frame.id(), Deoptimization::Reason_not_compiled_exception_handler); + Deoptimization::deoptimize(thread, caller_frame, ®_map, Deoptimization::Reason_not_compiled_exception_handler); + return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls(); } }