RFR: 8305898: Alternative self-forwarding mechanism [v7]

Roman Kennke rkennke at openjdk.org
Wed May 10 10:28:43 UTC 2023


On Wed, 10 May 2023 08:58:54 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> Now that I had my morning coffee, I do have a question about the contract here. Can we accidentally call `oop->forward_to(compaction_point)` when `oop == compaction_point` from the compaction code?

No, that doesn't seem to happen. In this case, the object doesn't get forwarded at all. If it would happen, it could and should be ignored, because it would result in extra stuff to be executed.

> I guess that would be innocuous for the thing we want to protect against: recording the _promotion failure_, rather than the self-forwarding itself. In other words, the fact that object is self-forwarded might not exactly mean it failed the promotion, might just be a lucky coincidence?

No, we want to protect against self-forwarding, because that would irrecoverably destroy the Klass* with compact headers.

> If so, maybe this whole thing should be `oopDesc::forward_failed()` or some such, and then let the code decide how to record it, either with self-forwarding address (legacy) or with this new bit.

Yes, I guess I could do that.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13779#discussion_r1189702665


More information about the hotspot-dev mailing list