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).
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).
- links to
-
Commit(master) openjdk/jdk/c113f82f
-
Review(master) openjdk/jdk/22524