Skip to content

Commit 81a1e8e

Browse files
author
Cesar Soares Lucas
committed
8364936: Shenandoah: Switch nmethod entry barriers to conc_instruction_and_data_patch
Reviewed-by: fyang, dzhang, kdnilsen, wkemper
1 parent 56e3735 commit 81a1e8e

File tree

12 files changed

+9
-28
lines changed

12 files changed

+9
-28
lines changed

src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,7 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm, Label* slo
331331
__ ldr(rscratch2, thread_disarmed_and_epoch_addr);
332332
__ cmp(rscratch1, rscratch2);
333333
} else {
334-
assert(patching_type == NMethodPatchingType::conc_data_patch, "must be");
335-
// Subsequent loads of oops must occur after load of guard value.
336-
// BarrierSetNMethod::disarm sets guard with release semantics.
337-
__ membar(__ LoadLoad);
338-
Address thread_disarmed_addr(rthread, in_bytes(bs_nm->thread_disarmed_guard_value_offset()));
339-
__ ldrw(rscratch2, thread_disarmed_addr);
340-
__ cmpw(rscratch1, rscratch2);
334+
ShouldNotReachHere();
341335
}
342336
__ br(condition, barrier_target);
343337

src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ class Node;
3939

4040
enum class NMethodPatchingType {
4141
stw_instruction_and_data_patch,
42-
conc_instruction_and_data_patch,
43-
conc_data_patch
42+
conc_instruction_and_data_patch
4443
};
4544

4645
class BarrierSetAssembler: public CHeapObj<mtGC> {

src/hotspot/cpu/aarch64/gc/shared/barrierSetNMethod_aarch64.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ static int entry_barrier_offset(nmethod* nm) {
5858
return -4 * (4 + slow_path_size(nm));
5959
case NMethodPatchingType::conc_instruction_and_data_patch:
6060
return -4 * (10 + slow_path_size(nm));
61-
case NMethodPatchingType::conc_data_patch:
62-
return -4 * (5 + slow_path_size(nm));
6361
}
6462
ShouldNotReachHere();
6563
return 0;

src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class ShenandoahBarrierSetAssembler: public BarrierSetAssembler {
6767
Register scratch, RegSet saved_regs);
6868

6969
public:
70-
virtual NMethodPatchingType nmethod_patching_type() { return NMethodPatchingType::conc_data_patch; }
70+
virtual NMethodPatchingType nmethod_patching_type() { return NMethodPatchingType::conc_instruction_and_data_patch; }
7171

7272
#ifdef COMPILER1
7373
void gen_pre_barrier_stub(LIR_Assembler* ce, ShenandoahPreBarrierStub* stub);

src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ class Node;
4040

4141
enum class NMethodPatchingType {
4242
stw_instruction_and_data_patch,
43-
conc_instruction_and_data_patch,
44-
conc_data_patch
43+
conc_instruction_and_data_patch
4544
};
4645

4746
class BarrierSetAssembler: public CHeapObj<mtGC> {

src/hotspot/cpu/ppc/gc/shenandoah/shenandoahBarrierSetAssembler_ppc.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class ShenandoahBarrierSetAssembler: public BarrierSetAssembler {
6969
Register preserve);
7070

7171
public:
72-
virtual NMethodPatchingType nmethod_patching_type() { return NMethodPatchingType::conc_data_patch; }
72+
virtual NMethodPatchingType nmethod_patching_type() { return NMethodPatchingType::conc_instruction_and_data_patch; }
7373

7474
/* ==== C1 stubs ==== */
7575
#ifdef COMPILER1

src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,6 @@ void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm, Label* slo
241241
__ lwu(t0, *guard);
242242

243243
switch (patching_type) {
244-
case NMethodPatchingType::conc_data_patch:
245-
// Subsequent loads of oops must occur after load of guard value.
246-
// BarrierSetNMethod::disarm sets guard with release semantics.
247-
__ membar(MacroAssembler::LoadLoad); // fall through to stw_instruction_and_data_patch
248244
case NMethodPatchingType::stw_instruction_and_data_patch:
249245
{
250246
// With STW patching, no data or instructions are updated concurrently,

src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ class Node;
4040

4141
enum class NMethodPatchingType {
4242
stw_instruction_and_data_patch,
43-
conc_instruction_and_data_patch,
44-
conc_data_patch
43+
conc_instruction_and_data_patch
4544
};
4645

4746
class BarrierSetAssembler: public CHeapObj<mtGC> {

src/hotspot/cpu/riscv/gc/shared/barrierSetNMethod_riscv.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ static int entry_barrier_offset(nmethod* nm) {
5050
switch (bs_asm->nmethod_patching_type()) {
5151
case NMethodPatchingType::stw_instruction_and_data_patch:
5252
return -4 * (4 + slow_path_size(nm));
53-
case NMethodPatchingType::conc_data_patch:
54-
return -4 * (5 + slow_path_size(nm));
5553
case NMethodPatchingType::conc_instruction_and_data_patch:
5654
return -4 * (15 + slow_path_size(nm));
5755
}

src/hotspot/cpu/riscv/gc/shenandoah/shenandoahBarrierSetAssembler_riscv.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class ShenandoahBarrierSetAssembler: public BarrierSetAssembler {
6969

7070
public:
7171

72-
virtual NMethodPatchingType nmethod_patching_type() { return NMethodPatchingType::conc_data_patch; }
72+
virtual NMethodPatchingType nmethod_patching_type() { return NMethodPatchingType::conc_instruction_and_data_patch; }
7373

7474
#ifdef COMPILER1
7575
void gen_pre_barrier_stub(LIR_Assembler* ce, ShenandoahPreBarrierStub* stub);

0 commit comments

Comments
 (0)