Skip to content

Commit 816e8f8

Browse files
author
Vladimir Kozlov
committed
8256999: Add C2 intrinsic for Reference.refersTo and PhantomReference::refersTo
Reviewed-by: pliden, vlivanov, rkennke, eosterlund, shade
1 parent c5d9507 commit 816e8f8

File tree

20 files changed

+319
-133
lines changed

20 files changed

+319
-133
lines changed

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

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,19 @@ source_hpp %{
3030

3131
source %{
3232

33-
static void z_load_barrier(MacroAssembler& _masm, const MachNode* node, Address ref_addr, Register ref, Register tmp, bool weak) {
34-
ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref, tmp, weak);
33+
static void z_load_barrier(MacroAssembler& _masm, const MachNode* node, Address ref_addr, Register ref, Register tmp, int barrier_data) {
34+
if (barrier_data == ZLoadBarrierElided) {
35+
return;
36+
}
37+
ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref, tmp, barrier_data);
3538
__ ldr(tmp, Address(rthread, ZThreadLocalData::address_bad_mask_offset()));
3639
__ andr(tmp, tmp, ref);
3740
__ cbnz(tmp, *stub->entry());
3841
__ bind(*stub->continuation());
3942
}
4043

4144
static void z_load_barrier_slow_path(MacroAssembler& _masm, const MachNode* node, Address ref_addr, Register ref, Register tmp) {
42-
ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref, tmp, false /* weak */);
45+
ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref, tmp, ZLoadBarrierStrong);
4346
__ b(*stub->entry());
4447
__ bind(*stub->continuation());
4548
}
@@ -50,7 +53,7 @@ static void z_load_barrier_slow_path(MacroAssembler& _masm, const MachNode* node
5053
instruct zLoadP(iRegPNoSp dst, memory8 mem, rFlagsReg cr)
5154
%{
5255
match(Set dst (LoadP mem));
53-
predicate(UseZGC && !needs_acquiring_load(n) && (n->as_Load()->barrier_data() == ZLoadBarrierStrong));
56+
predicate(UseZGC && !needs_acquiring_load(n) && (n->as_Load()->barrier_data() != 0));
5457
effect(TEMP dst, KILL cr);
5558

5659
ins_cost(4 * INSN_COST);
@@ -60,29 +63,7 @@ instruct zLoadP(iRegPNoSp dst, memory8 mem, rFlagsReg cr)
6063
ins_encode %{
6164
const Address ref_addr = mem2address($mem->opcode(), as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp);
6265
__ ldr($dst$$Register, ref_addr);
63-
if (barrier_data() != ZLoadBarrierElided) {
64-
z_load_barrier(_masm, this, ref_addr, $dst$$Register, rscratch2 /* tmp */, false /* weak */);
65-
}
66-
%}
67-
68-
ins_pipe(iload_reg_mem);
69-
%}
70-
71-
// Load Weak Pointer
72-
instruct zLoadWeakP(iRegPNoSp dst, memory8 mem, rFlagsReg cr)
73-
%{
74-
match(Set dst (LoadP mem));
75-
predicate(UseZGC && !needs_acquiring_load(n) && (n->as_Load()->barrier_data() == ZLoadBarrierWeak));
76-
effect(TEMP dst, KILL cr);
77-
78-
ins_cost(4 * INSN_COST);
79-
80-
format %{ "ldr $dst, $mem" %}
81-
82-
ins_encode %{
83-
const Address ref_addr = mem2address($mem->opcode(), as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp);
84-
__ ldr($dst$$Register, ref_addr);
85-
z_load_barrier(_masm, this, ref_addr, $dst$$Register, rscratch2 /* tmp */, true /* weak */);
66+
z_load_barrier(_masm, this, ref_addr, $dst$$Register, rscratch2 /* tmp */, barrier_data());
8667
%}
8768

8869
ins_pipe(iload_reg_mem);
@@ -92,7 +73,7 @@ instruct zLoadWeakP(iRegPNoSp dst, memory8 mem, rFlagsReg cr)
9273
instruct zLoadPVolatile(iRegPNoSp dst, indirect mem /* sync_memory */, rFlagsReg cr)
9374
%{
9475
match(Set dst (LoadP mem));
95-
predicate(UseZGC && needs_acquiring_load(n) && n->as_Load()->barrier_data() == ZLoadBarrierStrong);
76+
predicate(UseZGC && needs_acquiring_load(n) && n->as_Load()->barrier_data() != 0);
9677
effect(TEMP dst, KILL cr);
9778

9879
ins_cost(VOLATILE_REF_COST);
@@ -101,9 +82,7 @@ instruct zLoadPVolatile(iRegPNoSp dst, indirect mem /* sync_memory */, rFlagsReg
10182

10283
ins_encode %{
10384
__ ldar($dst$$Register, $mem$$Register);
104-
if (barrier_data() != ZLoadBarrierElided) {
105-
z_load_barrier(_masm, this, Address($mem$$Register), $dst$$Register, rscratch2 /* tmp */, false /* weak */);
106-
}
85+
z_load_barrier(_masm, this, Address($mem$$Register), $dst$$Register, rscratch2 /* tmp */, barrier_data());
10786
%}
10887

10988
ins_pipe(pipe_serial);
@@ -231,7 +210,7 @@ instruct zCompareAndExchangePAcq(iRegPNoSp res, indirect mem, iRegP oldval, iReg
231210

232211
instruct zGetAndSetP(indirect mem, iRegP newv, iRegPNoSp prev, rFlagsReg cr) %{
233212
match(Set prev (GetAndSetP mem newv));
234-
predicate(UseZGC && !needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() == ZLoadBarrierStrong);
213+
predicate(UseZGC && !needs_acquiring_load_exclusive(n) && n->as_LoadStore()->barrier_data() != 0);
235214
effect(TEMP_DEF prev, KILL cr);
236215

237216
ins_cost(2 * VOLATILE_REF_COST);
@@ -240,17 +219,15 @@ instruct zGetAndSetP(indirect mem, iRegP newv, iRegPNoSp prev, rFlagsReg cr) %{
240219

241220
ins_encode %{
242221
__ atomic_xchg($prev$$Register, $newv$$Register, $mem$$Register);
243-
if (barrier_data() != ZLoadBarrierElided) {
244-
z_load_barrier(_masm, this, Address(noreg, 0), $prev$$Register, rscratch2 /* tmp */, false /* weak */);
245-
}
222+
z_load_barrier(_masm, this, Address(noreg, 0), $prev$$Register, rscratch2 /* tmp */, barrier_data());
246223
%}
247224

248225
ins_pipe(pipe_serial);
249226
%}
250227

251228
instruct zGetAndSetPAcq(indirect mem, iRegP newv, iRegPNoSp prev, rFlagsReg cr) %{
252229
match(Set prev (GetAndSetP mem newv));
253-
predicate(UseZGC && needs_acquiring_load_exclusive(n) && (n->as_LoadStore()->barrier_data() == ZLoadBarrierStrong));
230+
predicate(UseZGC && needs_acquiring_load_exclusive(n) && (n->as_LoadStore()->barrier_data() != 0));
254231
effect(TEMP_DEF prev, KILL cr);
255232

256233
ins_cost(VOLATILE_REF_COST);
@@ -259,9 +236,7 @@ instruct zGetAndSetPAcq(indirect mem, iRegP newv, iRegPNoSp prev, rFlagsReg cr)
259236

260237
ins_encode %{
261238
__ atomic_xchgal($prev$$Register, $newv$$Register, $mem$$Register);
262-
if (barrier_data() != ZLoadBarrierElided) {
263-
z_load_barrier(_masm, this, Address(noreg, 0), $prev$$Register, rscratch2 /* tmp */, false /* weak */);
264-
}
239+
z_load_barrier(_masm, this, Address(noreg, 0), $prev$$Register, rscratch2 /* tmp */, barrier_data());
265240
%}
266241
ins_pipe(pipe_serial);
267242
%}

src/hotspot/cpu/x86/gc/z/z_x86_64.ad

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ source %{
3232

3333
#include "c2_intelJccErratum_x86.hpp"
3434

35-
static void z_load_barrier(MacroAssembler& _masm, const MachNode* node, Address ref_addr, Register ref, Register tmp, bool weak) {
36-
ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref, tmp, weak);
35+
static void z_load_barrier(MacroAssembler& _masm, const MachNode* node, Address ref_addr, Register ref, Register tmp, int barrier_data) {
36+
if (barrier_data == ZLoadBarrierElided) {
37+
return; // Elided.
38+
}
39+
ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref, tmp, barrier_data);
3740
{
3841
IntelJccErratumAlignment intel_alignment(_masm, 10 /* jcc_size */);
3942
__ testptr(ref, Address(r15_thread, ZThreadLocalData::address_bad_mask_offset()));
@@ -43,7 +46,7 @@ static void z_load_barrier(MacroAssembler& _masm, const MachNode* node, Address
4346
}
4447

4548
static void z_load_barrier_cmpxchg(MacroAssembler& _masm, const MachNode* node, Address ref_addr, Register ref, Register tmp, Label& good) {
46-
ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref, tmp, false /* weak */);
49+
ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref, tmp, ZLoadBarrierStrong);
4750
{
4851
IntelJccErratumAlignment intel_alignment(_masm, 10 /* jcc_size */);
4952
__ testptr(ref, Address(r15_thread, ZThreadLocalData::address_bad_mask_offset()));
@@ -61,7 +64,7 @@ static void z_load_barrier_cmpxchg(MacroAssembler& _masm, const MachNode* node,
6164
// Load Pointer
6265
instruct zLoadP(rRegP dst, memory mem, rFlagsReg cr)
6366
%{
64-
predicate(UseZGC && n->as_Load()->barrier_data() == ZLoadBarrierStrong);
67+
predicate(UseZGC && n->as_Load()->barrier_data() != 0);
6568
match(Set dst (LoadP mem));
6669
effect(KILL cr, TEMP dst);
6770

@@ -71,28 +74,7 @@ instruct zLoadP(rRegP dst, memory mem, rFlagsReg cr)
7174

7275
ins_encode %{
7376
__ movptr($dst$$Register, $mem$$Address);
74-
if (barrier_data() != ZLoadBarrierElided) {
75-
z_load_barrier(_masm, this, $mem$$Address, $dst$$Register, noreg /* tmp */, false /* weak */);
76-
}
77-
%}
78-
79-
ins_pipe(ialu_reg_mem);
80-
%}
81-
82-
// Load Weak Pointer
83-
instruct zLoadWeakP(rRegP dst, memory mem, rFlagsReg cr)
84-
%{
85-
predicate(UseZGC && n->as_Load()->barrier_data() == ZLoadBarrierWeak);
86-
match(Set dst (LoadP mem));
87-
effect(KILL cr, TEMP dst);
88-
89-
ins_cost(125);
90-
91-
format %{ "movq $dst, $mem" %}
92-
93-
ins_encode %{
94-
__ movptr($dst$$Register, $mem$$Address);
95-
z_load_barrier(_masm, this, $mem$$Address, $dst$$Register, noreg /* tmp */, true /* weak */);
77+
z_load_barrier(_masm, this, $mem$$Address, $dst$$Register, noreg /* tmp */, barrier_data());
9678
%}
9779

9880
ins_pipe(ialu_reg_mem);
@@ -107,11 +89,12 @@ instruct zCompareAndExchangeP(memory mem, rax_RegP oldval, rRegP newval, rRegP t
10789
"cmpxchgq $newval, $mem" %}
10890

10991
ins_encode %{
110-
if (barrier_data() != ZLoadBarrierElided) {
92+
if (barrier_data() != ZLoadBarrierElided) { // barrier could be elided by ZBarrierSetC2::analyze_dominating_barriers()
11193
__ movptr($tmp$$Register, $oldval$$Register);
11294
}
11395
__ lock();
11496
__ cmpxchgptr($newval$$Register, $mem$$Address);
97+
11598
if (barrier_data() != ZLoadBarrierElided) {
11699
Label good;
117100
z_load_barrier_cmpxchg(_masm, this, $mem$$Address, $oldval$$Register, $tmp$$Register, good);
@@ -137,11 +120,12 @@ instruct zCompareAndSwapP(rRegI res, memory mem, rRegP newval, rRegP tmp, rFlags
137120
"movzbl $res, $res" %}
138121

139122
ins_encode %{
140-
if (barrier_data() != ZLoadBarrierElided) {
123+
if (barrier_data() != ZLoadBarrierElided) { // barrier could be elided by ZBarrierSetC2::analyze_dominating_barriers()
141124
__ movptr($tmp$$Register, $oldval$$Register);
142125
}
143126
__ lock();
144127
__ cmpxchgptr($newval$$Register, $mem$$Address);
128+
145129
if (barrier_data() != ZLoadBarrierElided) {
146130
Label good;
147131
z_load_barrier_cmpxchg(_masm, this, $mem$$Address, $oldval$$Register, $tmp$$Register, good);
@@ -160,16 +144,14 @@ instruct zCompareAndSwapP(rRegI res, memory mem, rRegP newval, rRegP tmp, rFlags
160144

161145
instruct zXChgP(memory mem, rRegP newval, rFlagsReg cr) %{
162146
match(Set newval (GetAndSetP mem newval));
163-
predicate(UseZGC && n->as_LoadStore()->barrier_data() == ZLoadBarrierStrong);
147+
predicate(UseZGC && n->as_LoadStore()->barrier_data() != 0);
164148
effect(KILL cr);
165149

166150
format %{ "xchgq $newval, $mem" %}
167151

168152
ins_encode %{
169153
__ xchgptr($newval$$Register, $mem$$Address);
170-
if (barrier_data() != ZLoadBarrierElided) {
171-
z_load_barrier(_masm, this, Address(noreg, 0), $newval$$Register, noreg /* tmp */, false /* weak */);
172-
}
154+
z_load_barrier(_masm, this, Address(noreg, 0), $newval$$Register, noreg /* tmp */, barrier_data());
173155
%}
174156

175157
ins_pipe(pipe_cmpxchg);

src/hotspot/share/classfile/vmIntrinsics.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ class methodHandle;
390390
\
391391
/* java/lang/ref/Reference */ \
392392
do_intrinsic(_Reference_get, java_lang_ref_Reference, get_name, void_object_signature, F_R) \
393+
do_intrinsic(_Reference_refersTo0, java_lang_ref_Reference, refersTo0_name, object_boolean_signature, F_R) \
394+
do_intrinsic(_PhantomReference_refersTo0, java_lang_ref_PhantomReference, refersTo0_name, object_boolean_signature, F_R) \
393395
\
394396
/* support for com.sun.crypto.provider.AESCrypt and some of its callers */ \
395397
do_class(com_sun_crypto_provider_aescrypt, "com/sun/crypto/provider/AESCrypt") \

src/hotspot/share/classfile/vmSymbols.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@
394394
template(dispatchUncaughtException_name, "dispatchUncaughtException") \
395395
template(loadClass_name, "loadClass") \
396396
template(get_name, "get") \
397+
template(refersTo0_name, "refersTo0") \
397398
template(put_name, "put") \
398399
template(type_name, "type") \
399400
template(findNative_name, "findNative") \

src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,9 @@ Node* G1BarrierSetC2::load_at_resolved(C2Access& access, const Type* val_type) c
604604
bool in_heap = (decorators & IN_HEAP) != 0;
605605
bool in_native = (decorators & IN_NATIVE) != 0;
606606
bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
607+
bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
607608
bool is_unordered = (decorators & MO_UNORDERED) != 0;
609+
bool no_keepalive = (decorators & AS_NO_KEEPALIVE) != 0;
608610
bool is_mixed = !in_heap && !in_native;
609611
bool need_cpu_mem_bar = !is_unordered || mismatched || is_mixed;
610612

@@ -618,8 +620,8 @@ Node* G1BarrierSetC2::load_at_resolved(C2Access& access, const Type* val_type) c
618620
// SATB log buffer using the pre-barrier mechanism.
619621
// Also we need to add memory barrier to prevent commoning reads
620622
// from this field across safepoint since GC can change its value.
621-
bool need_read_barrier = in_heap && (on_weak ||
622-
(unknown && offset != top && obj != top));
623+
bool need_read_barrier = (((on_weak || on_phantom) && !no_keepalive) ||
624+
(in_heap && unknown && offset != top && obj != top));
623625

624626
if (!access.is_oop() || !need_read_barrier) {
625627
return load;
@@ -629,7 +631,7 @@ Node* G1BarrierSetC2::load_at_resolved(C2Access& access, const Type* val_type) c
629631
C2ParseAccess& parse_access = static_cast<C2ParseAccess&>(access);
630632
GraphKit* kit = parse_access.kit();
631633

632-
if (on_weak) {
634+
if (on_weak || on_phantom) {
633635
// Use the pre-barrier to record the value in the referent field
634636
pre_barrier(kit, false /* do_load */,
635637
kit->control(),

src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -996,9 +996,13 @@ void ShenandoahBarrierC2Support::call_lrb_stub(Node*& ctrl, Node*& val, Node* lo
996996
}
997997
} else {
998998
assert(is_phantom, "only remaining strength");
999-
assert(!is_narrow, "phantom access cannot be narrow");
1000-
calladdr = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_phantom);
1001-
name = "load_reference_barrier_phantom";
999+
if (is_narrow) {
1000+
calladdr = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_phantom_narrow);
1001+
name = "load_reference_barrier_phantom_narrow";
1002+
} else {
1003+
calladdr = CAST_FROM_FN_PTR(address, ShenandoahRuntime::load_reference_barrier_phantom);
1004+
name = "load_reference_barrier_phantom";
1005+
}
10021006
}
10031007
Node* call = new CallLeafNode(ShenandoahBarrierSetC2::shenandoah_load_reference_barrier_Type(), calladdr, name, TypeRawPtr::BOTTOM);
10041008

src/hotspot/share/gc/shenandoah/shenandoahRuntime.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,7 @@ JRT_END
7777
JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_phantom(oopDesc * src, oop* load_addr))
7878
return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier<ON_PHANTOM_OOP_REF, oop>(oop(src), load_addr);
7979
JRT_END
80+
81+
JRT_LEAF(oopDesc*, ShenandoahRuntime::load_reference_barrier_phantom_narrow(oopDesc * src, narrowOop* load_addr))
82+
return (oopDesc*) ShenandoahBarrierSet::barrier_set()->load_reference_barrier<ON_PHANTOM_OOP_REF, narrowOop>(oop(src), load_addr);
83+
JRT_END

src/hotspot/share/gc/shenandoah/shenandoahRuntime.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class ShenandoahRuntime : public AllStatic {
4545
static oopDesc* load_reference_barrier_weak_narrow(oopDesc* src, narrowOop* load_addr);
4646

4747
static oopDesc* load_reference_barrier_phantom(oopDesc* src, oop* load_addr);
48+
static oopDesc* load_reference_barrier_phantom_narrow(oopDesc* src, narrowOop* load_addr);
4849

4950
static void shenandoah_clone_barrier(oopDesc* src);
5051
};

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

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ class ZBarrierSetC2State : public ResourceObj {
6464
}
6565

6666
const MachNode* const mach = node->as_Mach();
67-
if (mach->barrier_data() != ZLoadBarrierStrong &&
68-
mach->barrier_data() != ZLoadBarrierWeak) {
67+
if (mach->barrier_data() == ZLoadBarrierElided) {
6968
// Don't need liveness data for nodes without barriers
7069
return NULL;
7170
}
@@ -84,21 +83,21 @@ static ZBarrierSetC2State* barrier_set_state() {
8483
return reinterpret_cast<ZBarrierSetC2State*>(Compile::current()->barrier_set_state());
8584
}
8685

87-
ZLoadBarrierStubC2* ZLoadBarrierStubC2::create(const MachNode* node, Address ref_addr, Register ref, Register tmp, bool weak) {
88-
ZLoadBarrierStubC2* const stub = new (Compile::current()->comp_arena()) ZLoadBarrierStubC2(node, ref_addr, ref, tmp, weak);
86+
ZLoadBarrierStubC2* ZLoadBarrierStubC2::create(const MachNode* node, Address ref_addr, Register ref, Register tmp, int barrier_data) {
87+
ZLoadBarrierStubC2* const stub = new (Compile::current()->comp_arena()) ZLoadBarrierStubC2(node, ref_addr, ref, tmp, barrier_data);
8988
if (!Compile::current()->output()->in_scratch_emit_size()) {
9089
barrier_set_state()->stubs()->append(stub);
9190
}
9291

9392
return stub;
9493
}
9594

96-
ZLoadBarrierStubC2::ZLoadBarrierStubC2(const MachNode* node, Address ref_addr, Register ref, Register tmp, bool weak) :
95+
ZLoadBarrierStubC2::ZLoadBarrierStubC2(const MachNode* node, Address ref_addr, Register ref, Register tmp, int barrier_data) :
9796
_node(node),
9897
_ref_addr(ref_addr),
9998
_ref(ref),
10099
_tmp(tmp),
101-
_weak(weak),
100+
_barrier_data(barrier_data),
102101
_entry(),
103102
_continuation() {
104103
assert_different_registers(ref, ref_addr.base());
@@ -118,7 +117,19 @@ Register ZLoadBarrierStubC2::tmp() const {
118117
}
119118

120119
address ZLoadBarrierStubC2::slow_path() const {
121-
const DecoratorSet decorators = _weak ? ON_WEAK_OOP_REF : ON_STRONG_OOP_REF;
120+
DecoratorSet decorators = DECORATORS_NONE;
121+
if (_barrier_data & ZLoadBarrierStrong) {
122+
decorators |= ON_STRONG_OOP_REF;
123+
}
124+
if (_barrier_data & ZLoadBarrierWeak) {
125+
decorators |= ON_WEAK_OOP_REF;
126+
}
127+
if (_barrier_data & ZLoadBarrierPhantom) {
128+
decorators |= ON_PHANTOM_OOP_REF;
129+
}
130+
if (_barrier_data & ZLoadBarrierNoKeepalive) {
131+
decorators |= AS_NO_KEEPALIVE;
132+
}
122133
return ZBarrierSetRuntime::load_barrier_on_oop_field_preloaded_addr(decorators);
123134
}
124135

@@ -318,10 +329,18 @@ void ZBarrierSetC2::analyze_dominating_barriers() const {
318329
MachNode* const mach = node->as_Mach();
319330
switch (mach->ideal_Opcode()) {
320331
case Op_LoadP:
332+
if ((mach->barrier_data() & ZLoadBarrierStrong) != 0) {
333+
barrier_loads.push(mach);
334+
}
335+
if ((mach->barrier_data() & (ZLoadBarrierStrong | ZLoadBarrierNoKeepalive)) ==
336+
ZLoadBarrierStrong) {
337+
mem_ops.push(mach);
338+
}
339+
break;
321340
case Op_CompareAndExchangeP:
322341
case Op_CompareAndSwapP:
323342
case Op_GetAndSetP:
324-
if (mach->barrier_data() == ZLoadBarrierStrong) {
343+
if ((mach->barrier_data() & ZLoadBarrierStrong) != 0) {
325344
barrier_loads.push(mach);
326345
}
327346
case Op_StoreP:

0 commit comments

Comments
 (0)