[master] RFR: Parallel: fix size_given_klass
Stefan Karlsson
stefank at openjdk.org
Tue Apr 23 11:50:57 UTC 2024
The Parallel scavenge threads compete to copy and forward objects, and the winning object is the one that managed to update the the forwarding pointer. For Lilliput, this code needs to be extra carefully written because installing the forwarding pointer destroys the klass pointer. The threads need to read the object header once, and then use that information when figuring out the size of the object. The code has been changed to do this, but there's a place in an assert were the code tries to reread the klass pointer, and then crash because it has been racingly been overwritten by another thread.
I had an idea that we could fix this by simplifying the assert with #149, but that has a problem with self-forwarded objects. There are ways to fix the problem listed in that PR, but for now the suggestion is to just make sure that the asserting code doesn't reread the klass pointer.
-------------
Commit messages:
- Parallel: fix size_given_klass
Changes: https://git.openjdk.org/lilliput/pull/163/files
Webrev: https://webrevs.openjdk.org/?repo=lilliput&pr=163&range=00
Stats: 4 lines in 3 files changed: 0 ins; 0 del; 4 mod
Patch: https://git.openjdk.org/lilliput/pull/163.diff
Fetch: git fetch https://git.openjdk.org/lilliput.git pull/163/head:pull/163
PR: https://git.openjdk.org/lilliput/pull/163
More information about the lilliput-dev
mailing list