227 if (nm->is_deopt_pc(pc)) {
228 RegisterMap map(thread, false);
229 frame exception_frame = thread->last_frame().sender(&map);
230 // if the frame isn't deopted then pc must not correspond to the caller of last_frame
231 assert(exception_frame.is_deoptimized_frame(), "must be deopted");
232 pc = exception_frame.pc();
233 }
234 #ifdef ASSERT
235 assert(exception.not_null(), "NULL exceptions should be handled by throw_exception");
236 assert(exception->is_oop(), "just checking");
237 // Check that exception is a subclass of Throwable, otherwise we have a VerifyError
238 if (!(exception->is_a(SystemDictionary::Throwable_klass()))) {
239 if (ExitVMOnVerifyError) vm_exit(-1);
240 ShouldNotReachHere();
241 }
242 #endif
243
244 // Check the stack guard pages and reenable them if necessary and there is
245 // enough space on the stack to do so. Use fast exceptions only if the guard
246 // pages are enabled.
247 bool guard_pages_enabled = thread->stack_yellow_zone_enabled();
248 if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack();
249
250 if (JvmtiExport::can_post_on_exceptions()) {
251 // To ensure correct notification of exception catches and throws
252 // we have to deoptimize here. If we attempted to notify the
253 // catches and throws during this exception lookup it's possible
254 // we could deoptimize on the way out of the VM and end back in
255 // the interpreter at the throw site. This would result in double
256 // notifications since the interpreter would also notify about
257 // these same catches and throws as it unwound the frame.
258
259 RegisterMap reg_map(thread);
260 frame stub_frame = thread->last_frame();
261 frame caller_frame = stub_frame.sender(®_map);
262
263 // We don't really want to deoptimize the nmethod itself since we
264 // can actually continue in the exception handler ourselves but I
265 // don't see an easy way to have the desired effect.
266 Deoptimization::deoptimize_frame(thread, caller_frame.id(), Deoptimization::Reason_constraint);
267 assert(caller_is_deopted(), "Must be deoptimized");
|
227 if (nm->is_deopt_pc(pc)) {
228 RegisterMap map(thread, false);
229 frame exception_frame = thread->last_frame().sender(&map);
230 // if the frame isn't deopted then pc must not correspond to the caller of last_frame
231 assert(exception_frame.is_deoptimized_frame(), "must be deopted");
232 pc = exception_frame.pc();
233 }
234 #ifdef ASSERT
235 assert(exception.not_null(), "NULL exceptions should be handled by throw_exception");
236 assert(exception->is_oop(), "just checking");
237 // Check that exception is a subclass of Throwable, otherwise we have a VerifyError
238 if (!(exception->is_a(SystemDictionary::Throwable_klass()))) {
239 if (ExitVMOnVerifyError) vm_exit(-1);
240 ShouldNotReachHere();
241 }
242 #endif
243
244 // Check the stack guard pages and reenable them if necessary and there is
245 // enough space on the stack to do so. Use fast exceptions only if the guard
246 // pages are enabled.
247 bool guard_pages_enabled = thread->stack_guards_enabled();
248 if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack();
249
250 if (JvmtiExport::can_post_on_exceptions()) {
251 // To ensure correct notification of exception catches and throws
252 // we have to deoptimize here. If we attempted to notify the
253 // catches and throws during this exception lookup it's possible
254 // we could deoptimize on the way out of the VM and end back in
255 // the interpreter at the throw site. This would result in double
256 // notifications since the interpreter would also notify about
257 // these same catches and throws as it unwound the frame.
258
259 RegisterMap reg_map(thread);
260 frame stub_frame = thread->last_frame();
261 frame caller_frame = stub_frame.sender(®_map);
262
263 // We don't really want to deoptimize the nmethod itself since we
264 // can actually continue in the exception handler ourselves but I
265 // don't see an easy way to have the desired effect.
266 Deoptimization::deoptimize_frame(thread, caller_frame.id(), Deoptimization::Reason_constraint);
267 assert(caller_is_deopted(), "Must be deoptimized");
|