Question about ZAddress::finalizable_good and ZAddress::mark_good
Stefan Karlsson
stefan.karlsson at oracle.com
Fri Apr 19 14:16:19 UTC 2024
Hi Guoxiong,
On 2024-04-19 15:51, Guoxiong Li wrote:
> 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.
Yes, the code gradually changed until the point that this doesn't make
any sense anymore.
FWIW, If you want to read about why we add in ZPointerRememberedMask, se
the comment starting with:
// ... then the explanation. Time to put your seat belt on.
Thanks,
StefanK
>
> Best Regards,
> -- Guoxiong
More information about the zgc-dev
mailing list