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

Cleanup THREAD/TRAPS/naming and typing issues in ObjectMonitor and related code

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b14

      Description

      ObjectMonitors can only be used by JavaThreads (modulo some interactions with hashcodes and deflation) but we use "Thread*" almost everywhere mainly due to use of TRAPS (and TRAPS will itself use JavaThread once JDK-8252685 is done). Also some uses of TRAPS in the API's are wrong as, for example, monitor entry can never throw an exception.

      So this cleanup tackles:
      - remove incorrect use of TRAPS
      - change "Thread*" to "JavaThread*" where applicable
      - don't use THREAD for things not related to exception processing
      - standardise the naming so that we have "JavaThread* current" rather a mix if Self/THREAD/jt etc.
      - remove unnecessary as_Java_thread() conversions

      The cleanup is predominantly in objectMonitor.* and synchronizer.* but with a fan out to the users of those APIs. No attempt is made to cleanup the callers beyond ensuring we have a suitable JavaThread reference for the calls.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dholmes David Holmes
              Reporter:
              dholmes David Holmes
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: