Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8265035

Remove unneeded exception check from refill_ic_stubs()

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 17
    • 17
    • hotspot
    • b18

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              pchilanomate Patricio Chilano Mateo
              pchilanomate Patricio Chilano Mateo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: