Skip to content

Commit 0cfd08f

Browse files
committed
8339112: Move JVM Klass flags out of AccessFlags
Reviewed-by: matsaave, cjplummer, dlong, thartmann, yzheng
1 parent 6f8714e commit 0cfd08f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+278
-166
lines changed

src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr
7575

7676
if (DiagnoseSyncOnValueBasedClasses != 0) {
7777
load_klass(hdr, obj);
78-
ldrw(hdr, Address(hdr, Klass::access_flags_offset()));
79-
tstw(hdr, JVM_ACC_IS_VALUE_BASED_CLASS);
78+
ldrb(hdr, Address(hdr, Klass::misc_flags_offset()));
79+
tst(hdr, KlassFlags::_misc_is_value_based_class);
8080
br(Assembler::NE, slow_case);
8181
}
8282

src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,8 +783,8 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
783783
Label register_finalizer;
784784
Register t = r5;
785785
__ load_klass(t, r0);
786-
__ ldrw(t, Address(t, Klass::access_flags_offset()));
787-
__ tbnz(t, exact_log2(JVM_ACC_HAS_FINALIZER), register_finalizer);
786+
__ ldrb(t, Address(t, Klass::misc_flags_offset()));
787+
__ tbnz(t, exact_log2(KlassFlags::_misc_has_finalizer), register_finalizer);
788788
__ ret(lr);
789789

790790
__ bind(register_finalizer);

src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ void C2_MacroAssembler::fast_lock(Register objectReg, Register boxReg, Register
6464

6565
if (DiagnoseSyncOnValueBasedClasses != 0) {
6666
load_klass(tmp, oop);
67-
ldrw(tmp, Address(tmp, Klass::access_flags_offset()));
68-
tstw(tmp, JVM_ACC_IS_VALUE_BASED_CLASS);
67+
ldrb(tmp, Address(tmp, Klass::misc_flags_offset()));
68+
tst(tmp, KlassFlags::_misc_is_value_based_class);
6969
br(Assembler::NE, cont);
7070
}
7171

@@ -243,8 +243,8 @@ void C2_MacroAssembler::fast_lock_lightweight(Register obj, Register box, Regist
243243

244244
if (DiagnoseSyncOnValueBasedClasses != 0) {
245245
load_klass(t1, obj);
246-
ldrw(t1, Address(t1, Klass::access_flags_offset()));
247-
tstw(t1, JVM_ACC_IS_VALUE_BASED_CLASS);
246+
ldrb(t1, Address(t1, Klass::misc_flags_offset()));
247+
tst(t1, KlassFlags::_misc_is_value_based_class);
248248
br(Assembler::NE, slow_path);
249249
}
250250

src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,8 +690,8 @@ void InterpreterMacroAssembler::lock_object(Register lock_reg)
690690

691691
if (DiagnoseSyncOnValueBasedClasses != 0) {
692692
load_klass(tmp, obj_reg);
693-
ldrw(tmp, Address(tmp, Klass::access_flags_offset()));
694-
tstw(tmp, JVM_ACC_IS_VALUE_BASED_CLASS);
693+
ldrb(tmp, Address(tmp, Klass::misc_flags_offset()));
694+
tst(tmp, KlassFlags::_misc_is_value_based_class);
695695
br(Assembler::NE, slow_case);
696696
}
697697

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -2191,9 +2191,9 @@ void TemplateTable::_return(TosState state)
21912191

21922192
__ ldr(c_rarg1, aaddress(0));
21932193
__ load_klass(r3, c_rarg1);
2194-
__ ldrw(r3, Address(r3, Klass::access_flags_offset()));
2194+
__ ldrb(r3, Address(r3, Klass::misc_flags_offset()));
21952195
Label skip_register_finalizer;
2196-
__ tbz(r3, exact_log2(JVM_ACC_HAS_FINALIZER), skip_register_finalizer);
2196+
__ tbz(r3, exact_log2(KlassFlags::_misc_has_finalizer), skip_register_finalizer);
21972197

21982198
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), c_rarg1);
21992199

src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr
195195

196196
if (DiagnoseSyncOnValueBasedClasses != 0) {
197197
load_klass(tmp2, obj);
198-
ldr_u32(tmp2, Address(tmp2, Klass::access_flags_offset()));
199-
tst(tmp2, JVM_ACC_IS_VALUE_BASED_CLASS);
198+
ldrb(tmp2, Address(tmp2, Klass::misc_flags_offset()));
199+
tst(tmp2, KlassFlags::_misc_is_value_based_class);
200200
b(slow_case, ne);
201201
}
202202

src/hotspot/cpu/arm/c1_Runtime1_arm.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -504,11 +504,11 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) {
504504
{
505505
__ set_info("register_finalizer", dont_gc_arguments);
506506

507-
// Do not call runtime if JVM_ACC_HAS_FINALIZER flag is not set
507+
// Do not call runtime if has_finalizer flag is not set
508508
__ load_klass(Rtemp, R0);
509-
__ ldr_u32(Rtemp, Address(Rtemp, Klass::access_flags_offset()));
509+
__ ldrb(Rtemp, Address(Rtemp, Klass::misc_flags_offset()));
510510

511-
__ tst(Rtemp, JVM_ACC_HAS_FINALIZER);
511+
__ tst(Rtemp, KlassFlags::_misc_has_finalizer);
512512
__ bx(LR, eq);
513513

514514
// Call VM

src/hotspot/cpu/arm/c2_MacroAssembler_arm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -86,8 +86,8 @@ void C2_MacroAssembler::fast_lock(Register Roop, Register Rbox, Register Rscratc
8686

8787
if (DiagnoseSyncOnValueBasedClasses != 0) {
8888
load_klass(Rscratch, Roop);
89-
ldr_u32(Rscratch, Address(Rscratch, Klass::access_flags_offset()));
90-
tst(Rscratch, JVM_ACC_IS_VALUE_BASED_CLASS);
89+
ldrb(Rscratch, Address(Rscratch, Klass::misc_flags_offset()));
90+
tst(Rscratch, KlassFlags::_misc_is_value_based_class);
9191
b(done, ne);
9292
}
9393

src/hotspot/cpu/arm/interp_masm_arm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -909,8 +909,8 @@ void InterpreterMacroAssembler::lock_object(Register Rlock) {
909909

910910
if (DiagnoseSyncOnValueBasedClasses != 0) {
911911
load_klass(R0, Robj);
912-
ldr_u32(R0, Address(R0, Klass::access_flags_offset()));
913-
tst(R0, JVM_ACC_IS_VALUE_BASED_CLASS);
912+
ldrb(R0, Address(R0, Klass::misc_flags_offset()));
913+
tst(R0, KlassFlags::_misc_is_value_based_class);
914914
b(slow_case, ne);
915915
}
916916

src/hotspot/cpu/arm/templateTable_arm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -2494,8 +2494,8 @@ void TemplateTable::_return(TosState state) {
24942494
assert(state == vtos, "only valid state");
24952495
__ ldr(R1, aaddress(0));
24962496
__ load_klass(Rtemp, R1);
2497-
__ ldr_u32(Rtemp, Address(Rtemp, Klass::access_flags_offset()));
2498-
__ tbz(Rtemp, exact_log2(JVM_ACC_HAS_FINALIZER), skip_register_finalizer);
2497+
__ ldrb(Rtemp, Address(Rtemp, Klass::misc_flags_offset()));
2498+
__ tbz(Rtemp, exact_log2(KlassFlags::_misc_has_finalizer), skip_register_finalizer);
24992499

25002500
__ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::register_finalizer), R1);
25012501

0 commit comments

Comments
 (0)