410
411 // tracing
412 if (TraceExceptions) {
413 ttyLocker ttyl;
414 ResourceMark rm(thread);
415 tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", h_exception->print_value_string(), (address)h_exception());
416 tty->print_cr(" thrown in interpreter method <%s>", h_method->print_value_string());
417 tty->print_cr(" at bci %d for thread " INTPTR_FORMAT, current_bci, thread);
418 }
419 // Don't go paging in something which won't be used.
420 // else if (h_extable->length() == 0) {
421 // // disabled for now - interpreter is not using shortcut yet
422 // // (shortcut is not to call runtime if we have no exception handlers)
423 // // warning("performance bug: should not call runtime if method has no exception handlers");
424 // }
425 // for AbortVMOnException flag
426 NOT_PRODUCT(Exceptions::debug_check_abort(h_exception));
427
428 // exception handler lookup
429 KlassHandle h_klass(THREAD, h_exception->klass());
430 handler_bci = h_method->fast_exception_handler_bci_for(h_klass, current_bci, THREAD);
431 if (HAS_PENDING_EXCEPTION) {
432 // We threw an exception while trying to find the exception handler.
433 // Transfer the new exception to the exception handle which will
434 // be set into thread local storage, and do another lookup for an
435 // exception handler for this exception, this time starting at the
436 // BCI of the exception handler which caused the exception to be
437 // thrown (bug 4307310).
438 h_exception = Handle(THREAD, PENDING_EXCEPTION);
439 CLEAR_PENDING_EXCEPTION;
440 if (handler_bci >= 0) {
441 current_bci = handler_bci;
442 should_repeat = true;
443 }
444 }
445 } while (should_repeat == true);
446
447 // notify JVMTI of an exception throw; JVMTI will detect if this is a first
448 // time throw or a stack unwinding throw and accordingly notify the debugger
449 if (JvmtiExport::can_post_on_exceptions()) {
450 JvmtiExport::post_exception_throw(thread, h_method(), bcp(thread), h_exception());
|
410
411 // tracing
412 if (TraceExceptions) {
413 ttyLocker ttyl;
414 ResourceMark rm(thread);
415 tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", h_exception->print_value_string(), (address)h_exception());
416 tty->print_cr(" thrown in interpreter method <%s>", h_method->print_value_string());
417 tty->print_cr(" at bci %d for thread " INTPTR_FORMAT, current_bci, thread);
418 }
419 // Don't go paging in something which won't be used.
420 // else if (h_extable->length() == 0) {
421 // // disabled for now - interpreter is not using shortcut yet
422 // // (shortcut is not to call runtime if we have no exception handlers)
423 // // warning("performance bug: should not call runtime if method has no exception handlers");
424 // }
425 // for AbortVMOnException flag
426 NOT_PRODUCT(Exceptions::debug_check_abort(h_exception));
427
428 // exception handler lookup
429 KlassHandle h_klass(THREAD, h_exception->klass());
430 handler_bci = methodOopDesc::fast_exception_handler_bci_for(h_method, h_klass, current_bci, THREAD);
431 if (HAS_PENDING_EXCEPTION) {
432 // We threw an exception while trying to find the exception handler.
433 // Transfer the new exception to the exception handle which will
434 // be set into thread local storage, and do another lookup for an
435 // exception handler for this exception, this time starting at the
436 // BCI of the exception handler which caused the exception to be
437 // thrown (bug 4307310).
438 h_exception = Handle(THREAD, PENDING_EXCEPTION);
439 CLEAR_PENDING_EXCEPTION;
440 if (handler_bci >= 0) {
441 current_bci = handler_bci;
442 should_repeat = true;
443 }
444 }
445 } while (should_repeat == true);
446
447 // notify JVMTI of an exception throw; JVMTI will detect if this is a first
448 // time throw or a stack unwinding throw and accordingly notify the debugger
449 if (JvmtiExport::can_post_on_exceptions()) {
450 JvmtiExport::post_exception_throw(thread, h_method(), bcp(thread), h_exception());
|