RFR: 8339112: Move JVM Klass flags out of AccessFlags [v2]

Dean Long dlong at openjdk.org
Thu Aug 29 22:17:22 UTC 2024


On Thu, 29 Aug 2024 18:50:42 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Move JVM implementation access flags that are not specified by the classfile format into Klass so we can shrink AccessFlags to u2 in a future change.
>> 
>> Tested with tier1-7.
>> 
>> NOTE: there are arm, ppc and s390 changes to this that are just a guess.  Also, graal changes.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add in graal flags and a comment.

src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp line 62:

> 60:     load_klass(hdr, obj, rscratch1);
> 61:     movb(hdr, Address(hdr, Klass::misc_flags_offset()));
> 62:     testl(hdr, KlassFlags::_misc_is_value_based_class);

Suggestion:

    testb(Address(hdr, Klass::misc_flags_offset()), KlassFlags::_misc_is_value_based_class);

src/hotspot/cpu/x86/c1_Runtime1_x86.cpp line 1170:

> 1168:         __ load_klass(t, rax, rscratch1);
> 1169:         __ movb(t, Address(t, Klass::misc_flags_offset()));
> 1170:         __ testl(t, KlassFlags::_misc_has_finalizer);

Use testb(Address, imm)

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 281:

> 279:     load_klass(tmpReg, objReg, scrReg);
> 280:     movb(tmpReg, Address(tmpReg, Klass::misc_flags_offset()));
> 281:     testl(tmpReg, KlassFlags::_misc_is_value_based_class);

Use testb(Address, imm)

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp line 600:

> 598:   if (DiagnoseSyncOnValueBasedClasses != 0) {
> 599:     load_klass(rax_reg, obj, t);
> 600:     movb(rax_reg, Address(rax_reg, Klass::misc_flags_offset()));

Use testb(Address, imm)

src/hotspot/cpu/x86/interp_masm_x86.cpp line 1178:

> 1176:     if (DiagnoseSyncOnValueBasedClasses != 0) {
> 1177:       load_klass(tmp_reg, obj_reg, rklass_decode_tmp);
> 1178:       movb(tmp_reg, Address(tmp_reg, Klass::misc_flags_offset()));

Use testb(Address, imm)

src/hotspot/cpu/x86/templateTable_x86.cpp line 2582:

> 2580:     __ movptr(robj, aaddress(0));
> 2581:     __ load_klass(rdi, robj, rscratch1);
> 2582:     __ movb(rdi, Address(rdi, Klass::misc_flags_offset()));

Use testb(Address, imm)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20719#discussion_r1737276368
PR Review Comment: https://git.openjdk.org/jdk/pull/20719#discussion_r1737276956
PR Review Comment: https://git.openjdk.org/jdk/pull/20719#discussion_r1737277139
PR Review Comment: https://git.openjdk.org/jdk/pull/20719#discussion_r1737277271
PR Review Comment: https://git.openjdk.org/jdk/pull/20719#discussion_r1737277473
PR Review Comment: https://git.openjdk.org/jdk/pull/20719#discussion_r1737277597


More information about the serviceability-dev mailing list