-
Enhancement
-
Resolution: Fixed
-
P4
-
17
-
b18
Method InlineCacheBuffer::refill_ic_stubs() has the following code:
// we ran out of inline cache buffer space; must enter safepoint.
// We do this by forcing a safepoint
EXCEPTION_MARK;
VM_ICBufferFull ibf;
VMThread::execute(&ibf);
// We could potential get an async. exception at this point.
// In that case we will rethrow it to ourselvs.
if (HAS_PENDING_EXCEPTION) {
oop exception = PENDING_EXCEPTION;
CLEAR_PENDING_EXCEPTION;
JavaThread::current()->set_pending_async_exception(exception);
}
The HAS_PENDING_EXCEPTION check will always return false since EXCEPTION_MARK will check that there are no pending exceptions upon entering and VMThread::execute() doesn't throw exceptions.
The comment says that we could get a potential async exception, which is true, since the JT will blocked waiting on VMOperation_lock. However delivering an async exception doesn't set the _pending_exception field, only additional fields (see JavaThread::send_thread_stop() -> set_pending_async_exception()) that will be later check in check_and_handle_async_exceptions() and only then _pending_exception will be set.
// we ran out of inline cache buffer space; must enter safepoint.
// We do this by forcing a safepoint
EXCEPTION_MARK;
VM_ICBufferFull ibf;
VMThread::execute(&ibf);
// We could potential get an async. exception at this point.
// In that case we will rethrow it to ourselvs.
if (HAS_PENDING_EXCEPTION) {
oop exception = PENDING_EXCEPTION;
CLEAR_PENDING_EXCEPTION;
JavaThread::current()->set_pending_async_exception(exception);
}
The HAS_PENDING_EXCEPTION check will always return false since EXCEPTION_MARK will check that there are no pending exceptions upon entering and VMThread::execute() doesn't throw exceptions.
The comment says that we could get a potential async exception, which is true, since the JT will blocked waiting on VMOperation_lock. However delivering an async exception doesn't set the _pending_exception field, only additional fields (see JavaThread::send_thread_stop() -> set_pending_async_exception()) that will be later check in check_and_handle_async_exceptions() and only then _pending_exception will be set.