Question about ZAddress::finalizable_good and ZAddress::mark_good

Guoxiong Li lgxbslgx at gmail.com
Fri Apr 19 13:51:39 UTC 2024


Hi all,

I notice the methods `ZAddress::finalizable_good` and `ZAddress::mark_good`
have the following code, which are very strange and confuse me.

```
  const uintptr_t non_mark_bits_mask = ZPointerMarkMetadataMask ^
ZPointerAllMetadataMask;
  const uintptr_t non_mark_prev_bits = untype(prev) & non_mark_bits_mask;
  return color(addr, <other contents> | non_mark_prev_bits |
ZPointerRememberedMask);
```

The expression `ZPointerMarkMetadataMask ^ ZPointerAllMetadataMask`
would have the result `48`, which is equal to `ZPointerRememberedMask`.
Then the expression `non_mark_prev_bits | ZPointerRememberedMask`
in the last statement will always be `48` as well.

So I think the first two statements which compute the `non_mark_prev_bits`
can be removed or simplified. What do you think about it? Any ideas are
appreciated.

Best Regards,
-- Guoxiong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/zgc-dev/attachments/20240419/0a4635c7/attachment.htm>


More information about the zgc-dev mailing list