8389938: Follow up after removing UseObjectMonitorTable flag - #32471
8389938: Follow up after removing UseObjectMonitorTable flag#32471fbredber wants to merge 3 commits into
Conversation
|
👋 Welcome back fbredberg! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
@fbredber The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
pchilano
left a comment
There was a problem hiding this comment.
Looks good to me, thanks for the cleanup.
| // to the ObjectMonitor reference manipulation code: | ||
| // | ||
| #define OM_OFFSET_NO_MONITOR_VALUE_TAG(f) \ | ||
| ((in_bytes(ObjectMonitor::f ## _offset())) - checked_cast<int>(markWord::monitor_value)) |
There was a problem hiding this comment.
This macro can also be removed.
| bool has_displaced_mark_helper() const { | ||
| return has_monitor_pointer(); | ||
| } | ||
| markWord displaced_mark_helper() const; |
There was a problem hiding this comment.
I see the SA agent has the equivalent methods hasDisplacedMarkHelper/displacedMarkHelper.
coleenp
left a comment
There was a problem hiding this comment.
Some questions and suggested additions.
| // have to check has_monitor() before is_locked() | ||
| // Valhalla: inline types/arrays can't be monitored | ||
| st->print(" monitor(" INTPTR_FORMAT ")=", value()); | ||
| st->print(" monitor(" INTPTR_FORMAT ")", value()); |
There was a problem hiding this comment.
But the monitor isn't the value now. Shouldn't this just be removed? We don't want printing to search the table.
There was a problem hiding this comment.
I think this whole method could use some cleanup. This just prints the value of the markWord (same as before) but it did so because it did not want to go chasing displaced marked words. Similarly the is_locked leg did not want to go chase stack locks.
Neither exists anymore. It is really only the GC that displaces/preservers the markWord in a STW collection because of forwarding pointers. So we should clean this up to be if marked just print the value, else actually print some more state.
Similarly we should clean up the valhalla invariants now that we do not displace markWords.
| @@ -235,9 +235,6 @@ | |||
| void set_metadata(uintptr_t value); | |||
| volatile uintptr_t* metadata_addr(); | |||
There was a problem hiding this comment.
If I remember this correctly metadata could be two different things, but with the lock in the markWord gone, it can now only be one thing. But I guess that one thing is the hash code as uintptr_t ?
Is metadata_addr() used?
There was a problem hiding this comment.
I agree we should probably fold metadata into hash functions and rename and retype the field to be intptr_t _hash a bit more churn but feels like we do not benefit from this abstraction anymore.
There was a problem hiding this comment.
Separate but would also be nice to migrate the object monitors to Atomic.
| ShouldNotCallThis(); | ||
| set_metadata(hdr.value()); | ||
| } | ||
|
|
There was a problem hiding this comment.
Is there also a set_metadata() that should be removed?
xmas92
left a comment
There was a problem hiding this comment.
There is still a stale comment in one of our test frameworks:
I think removing the first paragraph and rewriting the second one to just mention GC mark word preservation is enough to explain why this code still does System.identityHashCode(obj);
This PR is a follow-up to JDK-8389325 ("Remove the UseObjectMonitorTable flag and related code"). It:
Passes tier1-5 tests successfully on supported platforms.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32471/head:pull/32471$ git checkout pull/32471Update a local copy of the PR:
$ git checkout pull/32471$ git pull https://git.openjdk.org/jdk.git pull/32471/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 32471View PR using the GUI difftool:
$ git pr show -t 32471Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32471.diff
Using Webrev
Link to Webrev Comment