Skip to content

Commit 6cff49c

Browse files
shipilevadinn
andcommitted
8361380: ARM32: Atomic stubs should be in pre-universe
Co-authored-by: Andrew Dinn <[email protected]> Reviewed-by: kvn, adinn
1 parent ebb1095 commit 6cff49c

File tree

4 files changed

+30
-32
lines changed

4 files changed

+30
-32
lines changed

src/hotspot/cpu/arm/stubDeclarations_arm.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@
3030
do_arch_blob, \
3131
do_arch_entry, \
3232
do_arch_entry_init) \
33-
do_arch_blob(preuniverse, 0) \
33+
do_arch_blob(preuniverse, 500) \
34+
do_stub(preuniverse, atomic_load_long) \
35+
do_arch_entry(Arm, preuniverse, atomic_load_long, \
36+
atomic_load_long_entry, atomic_load_long_entry) \
37+
do_stub(preuniverse, atomic_store_long) \
38+
do_arch_entry(Arm, preuniverse, atomic_store_long, \
39+
atomic_store_long_entry, atomic_store_long_entry) \
3440

3541

3642
#define STUBGEN_INITIAL_BLOBS_ARCH_DO(do_stub, \
@@ -41,12 +47,6 @@
4147
do_stub(initial, idiv_irem) \
4248
do_arch_entry(Arm, initial, idiv_irem, \
4349
idiv_irem_entry, idiv_irem_entry) \
44-
do_stub(initial, atomic_load_long) \
45-
do_arch_entry(Arm, initial, atomic_load_long, \
46-
atomic_load_long_entry, atomic_load_long_entry) \
47-
do_stub(initial, atomic_store_long) \
48-
do_arch_entry(Arm, initial, atomic_store_long, \
49-
atomic_store_long_entry, atomic_store_long_entry) \
5050

5151
#define STUBGEN_CONTINUATION_BLOBS_ARCH_DO(do_stub, \
5252
do_arch_blob, \

src/hotspot/cpu/arm/stubGenerator_arm.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,7 +3127,14 @@ class StubGenerator: public StubCodeGenerator {
31273127
// Initialization
31283128

31293129
void generate_preuniverse_stubs() {
3130-
// preuniverse stubs are not needed for arm
3130+
// Atomics are used in universe initialization code (e.g. CDS relocation),
3131+
// therefore we need to generate real stubs very early on.
3132+
StubRoutines::_atomic_add_entry = generate_atomic_add();
3133+
StubRoutines::_atomic_xchg_entry = generate_atomic_xchg();
3134+
StubRoutines::_atomic_cmpxchg_entry = generate_atomic_cmpxchg();
3135+
StubRoutines::_atomic_cmpxchg_long_entry = generate_atomic_cmpxchg_long();
3136+
StubRoutines::Arm::_atomic_load_long_entry = generate_atomic_load_long();
3137+
StubRoutines::Arm::_atomic_store_long_entry = generate_atomic_store_long();
31313138
}
31323139

31333140
void generate_initial_stubs() {
@@ -3151,14 +3158,6 @@ class StubGenerator: public StubCodeGenerator {
31513158

31523159
// integer division used both by interpreter and compiler
31533160
StubRoutines::Arm::_idiv_irem_entry = generate_idiv_irem();
3154-
3155-
StubRoutines::_atomic_add_entry = generate_atomic_add();
3156-
StubRoutines::_atomic_xchg_entry = generate_atomic_xchg();
3157-
StubRoutines::_atomic_cmpxchg_entry = generate_atomic_cmpxchg();
3158-
StubRoutines::_atomic_cmpxchg_long_entry = generate_atomic_cmpxchg_long();
3159-
StubRoutines::Arm::_atomic_load_long_entry = generate_atomic_load_long();
3160-
StubRoutines::Arm::_atomic_store_long_entry = generate_atomic_store_long();
3161-
31623161
}
31633162

31643163
void generate_continuation_stubs() {

src/hotspot/cpu/zero/stubGenerator_zero.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ class StubGenerator: public StubCodeGenerator {
180180

181181
void generate_preuniverse_stubs() {
182182
StubRoutines::_fence_entry = ShouldNotCallThisStub();
183+
StubRoutines::_atomic_xchg_entry = ShouldNotCallThisStub();
184+
StubRoutines::_atomic_cmpxchg_entry = ShouldNotCallThisStub();
185+
StubRoutines::_atomic_cmpxchg_long_entry = ShouldNotCallThisStub();
186+
StubRoutines::_atomic_add_entry = ShouldNotCallThisStub();
183187
}
184188

185189
void generate_initial_stubs() {
@@ -192,12 +196,6 @@ class StubGenerator: public StubCodeGenerator {
192196
StubRoutines::_forward_exception_entry = ShouldNotCallThisStub();
193197
StubRoutines::_call_stub_entry = (address) call_stub;
194198
StubRoutines::_catch_exception_entry = ShouldNotCallThisStub();
195-
196-
// atomic calls
197-
StubRoutines::_atomic_xchg_entry = ShouldNotCallThisStub();
198-
StubRoutines::_atomic_cmpxchg_entry = ShouldNotCallThisStub();
199-
StubRoutines::_atomic_cmpxchg_long_entry = ShouldNotCallThisStub();
200-
StubRoutines::_atomic_add_entry = ShouldNotCallThisStub();
201199
}
202200

203201
void generate_continuation_stubs() {

src/hotspot/share/runtime/stubDeclarations.hpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,17 @@
615615
do_blob(preuniverse) \
616616
do_stub(preuniverse, fence) \
617617
do_entry(preuniverse, fence, fence_entry, fence_entry) \
618+
do_stub(preuniverse, atomic_add) \
619+
do_entry(preuniverse, atomic_add, atomic_add_entry, atomic_add_entry) \
620+
do_stub(preuniverse, atomic_xchg) \
621+
do_entry(preuniverse, atomic_xchg, atomic_xchg_entry, \
622+
atomic_xchg_entry) \
623+
do_stub(preuniverse, atomic_cmpxchg) \
624+
do_entry(preuniverse, atomic_cmpxchg, atomic_cmpxchg_entry, \
625+
atomic_cmpxchg_entry) \
626+
do_stub(preuniverse, atomic_cmpxchg_long) \
627+
do_entry(preuniverse, atomic_cmpxchg_long, atomic_cmpxchg_long_entry, \
628+
atomic_cmpxchg_long_entry) \
618629
/* merge in stubs and entries declared in arch header */ \
619630
STUBGEN_PREUNIVERSE_BLOBS_ARCH_DO(do_stub, do_arch_blob, \
620631
do_arch_entry, do_arch_entry_init) \
@@ -637,16 +648,6 @@
637648
do_stub(initial, catch_exception) \
638649
do_entry(initial, catch_exception, catch_exception_entry, \
639650
catch_exception_entry) \
640-
do_stub(initial, atomic_add) \
641-
do_entry(initial, atomic_add, atomic_add_entry, atomic_add_entry) \
642-
do_stub(initial, atomic_xchg) \
643-
do_entry(initial, atomic_xchg, atomic_xchg_entry, atomic_xchg_entry) \
644-
do_stub(initial, atomic_cmpxchg) \
645-
do_entry(initial, atomic_cmpxchg, atomic_cmpxchg_entry, \
646-
atomic_cmpxchg_entry) \
647-
do_stub(initial, atomic_cmpxchg_long) \
648-
do_entry(initial, atomic_cmpxchg_long, atomic_cmpxchg_long_entry, \
649-
atomic_cmpxchg_long_entry) \
650651
do_stub(initial, updateBytesCRC32) \
651652
do_entry(initial, updateBytesCRC32, updateBytesCRC32, \
652653
updateBytesCRC32) \

0 commit comments

Comments
 (0)