1.1 --- a/src/share/vm/opto/runtime.cpp Wed Dec 19 15:40:35 2012 -0800 1.2 +++ b/src/share/vm/opto/runtime.cpp Wed Dec 19 19:21:15 2012 -0800 1.3 @@ -989,7 +989,7 @@ 1.4 // since we're notifying the VM on every catch. 1.5 // Force deoptimization and the rest of the lookup 1.6 // will be fine. 1.7 - deoptimize_caller_frame(thread, true); 1.8 + deoptimize_caller_frame(thread); 1.9 } 1.10 1.11 // Check the stack guard pages. If enabled, look for handler in this frame; 1.12 @@ -1143,17 +1143,22 @@ 1.13 1.14 1.15 void OptoRuntime::deoptimize_caller_frame(JavaThread *thread, bool doit) { 1.16 - // Deoptimize frame 1.17 - if (doit) { 1.18 - // Called from within the owner thread, so no need for safepoint 1.19 - RegisterMap reg_map(thread); 1.20 - frame stub_frame = thread->last_frame(); 1.21 - assert(stub_frame.is_runtime_frame() || exception_blob()->contains(stub_frame.pc()), "sanity check"); 1.22 - frame caller_frame = stub_frame.sender(®_map); 1.23 + // Deoptimize the caller before continuing, as the compiled 1.24 + // exception handler table may not be valid. 1.25 + if (!StressCompiledExceptionHandlers && doit) { 1.26 + deoptimize_caller_frame(thread); 1.27 + } 1.28 +} 1.29 1.30 - // Deoptimize the caller frame. 1.31 - Deoptimization::deoptimize_frame(thread, caller_frame.id()); 1.32 - } 1.33 +void OptoRuntime::deoptimize_caller_frame(JavaThread *thread) { 1.34 + // Called from within the owner thread, so no need for safepoint 1.35 + RegisterMap reg_map(thread); 1.36 + frame stub_frame = thread->last_frame(); 1.37 + assert(stub_frame.is_runtime_frame() || exception_blob()->contains(stub_frame.pc()), "sanity check"); 1.38 + frame caller_frame = stub_frame.sender(®_map); 1.39 + 1.40 + // Deoptimize the caller frame. 1.41 + Deoptimization::deoptimize_frame(thread, caller_frame.id()); 1.42 } 1.43 1.44