Skip to content

Commit 3787ff8

Browse files
committed
8319700: [AArch64] C2 compilation fails with "Field too big for insn"
Reviewed-by: aph, thartmann
1 parent 99b9cb0 commit 3787ff8

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -1290,6 +1290,9 @@ static bool aarch64_test_and_branch_reachable(int branch_offset, int target_offs
12901290
return test_and_branch_to_trampoline_delta < test_and_branch_delta_limit;
12911291
}
12921292

1293+
ZLoadBarrierStubC2Aarch64::ZLoadBarrierStubC2Aarch64(const MachNode* node, Address ref_addr, Register ref)
1294+
: ZLoadBarrierStubC2(node, ref_addr, ref), _test_and_branch_reachable_entry(), _offset(), _deferred_emit(false), _test_and_branch_reachable(false) {}
1295+
12931296
ZLoadBarrierStubC2Aarch64::ZLoadBarrierStubC2Aarch64(const MachNode* node, Address ref_addr, Register ref, int offset)
12941297
: ZLoadBarrierStubC2(node, ref_addr, ref), _test_and_branch_reachable_entry(), _offset(offset), _deferred_emit(false), _test_and_branch_reachable(false) {
12951298
PhaseOutput* const output = Compile::current()->output();
@@ -1319,6 +1322,12 @@ int ZLoadBarrierStubC2Aarch64::get_stub_size() {
13191322
return cb.insts_size();
13201323
}
13211324

1325+
ZLoadBarrierStubC2Aarch64* ZLoadBarrierStubC2Aarch64::create(const MachNode* node, Address ref_addr, Register ref) {
1326+
ZLoadBarrierStubC2Aarch64* const stub = new (Compile::current()->comp_arena()) ZLoadBarrierStubC2Aarch64(node, ref_addr, ref);
1327+
register_stub(stub);
1328+
return stub;
1329+
}
1330+
13221331
ZLoadBarrierStubC2Aarch64* ZLoadBarrierStubC2Aarch64::create(const MachNode* node, Address ref_addr, Register ref, int offset) {
13231332
ZLoadBarrierStubC2Aarch64* const stub = new (Compile::current()->comp_arena()) ZLoadBarrierStubC2Aarch64(node, ref_addr, ref, offset);
13241333
register_stub(stub);

src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,12 @@ class ZLoadBarrierStubC2Aarch64 : public ZLoadBarrierStubC2 {
265265
bool _deferred_emit;
266266
bool _test_and_branch_reachable;
267267

268+
ZLoadBarrierStubC2Aarch64(const MachNode* node, Address ref_addr, Register ref);
268269
ZLoadBarrierStubC2Aarch64(const MachNode* node, Address ref_addr, Register ref, int offset);
269270

270271
int get_stub_size();
271272
public:
273+
static ZLoadBarrierStubC2Aarch64* create(const MachNode* node, Address ref_addr, Register ref);
272274
static ZLoadBarrierStubC2Aarch64* create(const MachNode* node, Address ref_addr, Register ref, int offset);
273275

274276
virtual void emit_code(MacroAssembler& masm);

src/hotspot/cpu/aarch64/gc/z/z_aarch64.ad

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static void z_keep_alive_load_barrier(MacroAssembler& _masm, const MachNode* nod
4848
__ relocate(barrier_Relocation::spec(), ZBarrierRelocationFormatMarkBadBeforeMov);
4949
__ movzw(tmp, barrier_Relocation::unpatched);
5050
__ tst(ref, tmp);
51-
ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref);
51+
ZLoadBarrierStubC2Aarch64* const stub = ZLoadBarrierStubC2Aarch64::create(node, ref_addr, ref);
5252
__ br(Assembler::NE, *stub->entry());
5353
z_uncolor(_masm, node, ref);
5454
__ bind(*stub->continuation());

src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "opto/rootnode.hpp"
4343
#include "opto/runtime.hpp"
4444
#include "opto/type.hpp"
45+
#include "utilities/debug.hpp"
4546
#include "utilities/growableArray.hpp"
4647
#include "utilities/macros.hpp"
4748

@@ -226,6 +227,7 @@ Label* ZBarrierStubC2::continuation() {
226227
}
227228

228229
ZLoadBarrierStubC2* ZLoadBarrierStubC2::create(const MachNode* node, Address ref_addr, Register ref) {
230+
AARCH64_ONLY(fatal("Should use ZLoadBarrierStubC2Aarch64::create"));
229231
ZLoadBarrierStubC2* const stub = new (Compile::current()->comp_arena()) ZLoadBarrierStubC2(node, ref_addr, ref);
230232
register_stub(stub);
231233

@@ -275,6 +277,7 @@ void ZLoadBarrierStubC2::emit_code(MacroAssembler& masm) {
275277
}
276278

277279
ZStoreBarrierStubC2* ZStoreBarrierStubC2::create(const MachNode* node, Address ref_addr, Register new_zaddress, Register new_zpointer, bool is_native, bool is_atomic) {
280+
AARCH64_ONLY(fatal("Should use ZStoreBarrierStubC2Aarch64::create"));
278281
ZStoreBarrierStubC2* const stub = new (Compile::current()->comp_arena()) ZStoreBarrierStubC2(node, ref_addr, new_zaddress, new_zpointer, is_native, is_atomic);
279282
register_stub(stub);
280283

src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ static void inc_trampoline_stubs_count();
5252
static int trampoline_stubs_count();
5353
static int stubs_start_offset();
5454

55-
public:
5655
ZBarrierStubC2(const MachNode* node);
5756

57+
public:
5858
RegMask& live() const;
5959
Label* entry();
6060
Label* continuation();

0 commit comments

Comments
 (0)