RFR: 8247912: Make narrowOop a scoped enum
Kim Barrett
kim.barrett at oracle.com
Tue Sep 22 13:16:36 UTC 2020
> On Sep 21, 2020, at 5:44 PM, Ioi Lam <iklam at openjdk.java.net> wrote:
> src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 179:
>
>> 177: // Move narrow OOP
>> 178: narrowOop noop = CompressedOops::encode((oop)o);
>> 179: CompressedOops::NarrowType n = CompressedOops::narrow_oop_value(noop);
>
> I think a public NarrowType is confusing (vs narrowOop). Since NarrowType is rarely used, and it's unlikely to be
> changed from uint32_t, maybe we should make NarrowType private, and change the above to uint32_t n =
> CompressedOops::encode_as_uint32_t((oop)o); Code that does arithmetic operations on the integer value probably wants to
> know the exact type anyway. I.e., not knowing whether NarrowType is signed or not makes me worry about the correctness
> of `n >> 16` below.
Coleen didn’t like NarrowType either. I’m convinced by your argument that callers need to
know it’s uint32_t anyway, and will remove it.
More information about the shenandoah-dev
mailing list