RFR: 8309599: WeakHandle and OopHandle release should clear obj pointer

Coleen Phillimore coleenp at openjdk.org
Tue Sep 26 13:55:13 UTC 2023


On Tue, 26 Sep 2023 12:47:42 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> This change makes WeakHandle and OopHandle release null out the obj pointer, at the cost of making the release function non-const and some changes that propagated from that.  This enables ObjectMonitor code to test for null to see if the obj was already released, and seems like the right thing to do.  See comments from related PR in the bug report.
> Tested with tier1-4.

This change doesn't fix the problem that you had observed with PR #13721.  (I agree with the comments in that PR). It's a general cleanup where after calling release() the ObjectMonitor code wants some way to know that it has done so, without adding a specific call to WeakHandle::set_null() to do what the callers expect release() to do.
I don't really like making the callers non-const, but I like having a special set_null() API less.
Even with object -> OM mapping, the OM will still need to weakly point to the object, unless the design is changed a lot in the last couple of weeks.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15920#issuecomment-1735587388


More information about the serviceability-dev mailing list