PreserveExceptionMark clears file/line before saving them

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • 9
    • Affects Version/s: 6
    • Component/s: hotspot
    • None
    • generic
    • generic

      This is the constructor:

        PreserveExceptionMark::PreserveExceptionMark(Thread*& thread) {
          thread = Thread::current();
          _thread = thread;
          _preserved_exception_oop = Handle(thread, _thread->pending_exception());
          _thread->clear_pending_exception(); // Needed to avoid infinite recursion
          _preserved_exception_line = _thread->exception_line();
          _preserved_exception_file = _thread->exception_file();
        }

      File and line are saved after they have been cleared.

      Also, thread, is reference parameter which set is both non-intuitive and not in the style of HotSpot. However, this is needed with the primary usage via this macro:

         #define PRESERVE_EXCEPTION_MARK Thread* THREAD; PreserveExceptionMark __em(THREAD);

      Finally, the comment, on clear the pending exception appears to be incorrect.

            Assignee:
            Unassigned
            Reporter:
            Robert Field (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: