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

Rename ObjectMonitor::owner_from() and JavaThread::_lock_id

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 24
    • hotspot
    • b27

      During the review of JDK-8338383 there were some comments about improving the naming for ObjectMonitor::owner_from() and JavaThread::_lock_id. These originate from the changes introduced to inflated monitors, where we now record the java.lang.Thread.tid of the owner in the ObjectMonitor's _owner field instead of a JavaThread*.
      Using ObjectMonitor::tid_from() instead of ObjectMonitor::owner_from() might be confusing since we also have osthread()->thread_id(). A suggested alternative was to use owner_id_from(). There are some comments also in objectMonitor.hpp that mention tid which maybe should also be changed to owner_id.
      The new added member JavaThread::_lock_id should also be changed to something like JavaThread::_monitor_owner_id. An alternative would be to just name it for what it is, like _java_lang_Thread_tid, and then just read it from the c2 fast paths and ObjectMonitor::owner_from() (or its new name).

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

              Created:
              Updated:
              Resolved: