Skip to content

Commit

Permalink
8293353: [BACKOUT] G1: Remove redundant is-marking-active checks in C…
Browse files Browse the repository at this point in the history
…1 barrier

Reviewed-by: kbarrett, mdoerr, tschatzl
  • Loading branch information
albertnetymk committed Sep 6, 2022
1 parent 4955835 commit 1bed23a
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
Expand Up @@ -380,6 +380,15 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler*
Label done;
Label runtime;

// Is marking still active?
if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
__ ldrw(tmp, in_progress);
} else {
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ ldrb(tmp, in_progress);
}
__ cbzw(tmp, done);

// Can we store original value in the thread's buffer?
__ ldr(tmp, queue_index);
__ cbz(tmp, runtime);
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp
Expand Up @@ -382,6 +382,11 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler*
Label done;
Label runtime;

// Is marking still active?
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ ldrb(R1, queue_active);
__ cbz(R1, done);

__ ldr(r_index_1, queue_index);
__ ldr(r_pre_val_0, Address(SP, nb_saved_regs*wordSize));
__ ldr(r_buffer_2, buffer);
Expand Down
10 changes: 10 additions & 0 deletions src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp
Expand Up @@ -469,6 +469,16 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler*
__ std(tmp, -16, R1_SP);
__ std(tmp2, -24, R1_SP);

// Is marking still active?
if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
__ lwz(tmp, satb_q_active_byte_offset, R16_thread);
} else {
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ lbz(tmp, satb_q_active_byte_offset, R16_thread);
}
__ cmpdi(CCR0, tmp, 0);
__ beq(CCR0, marking_not_active);

__ bind(restart);
// Load the index into the SATB buffer. SATBMarkQueue::_index is a
// size_t so ld_ptr is appropriate.
Expand Down
9 changes: 9 additions & 0 deletions src/hotspot/cpu/riscv/gc/g1/g1BarrierSetAssembler_riscv.cpp
Expand Up @@ -369,6 +369,15 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler*
Label done;
Label runtime;

// Is marking still active?
if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) { // 4-byte width
__ lwu(tmp, in_progress);
} else {
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ lbu(tmp, in_progress);
}
__ beqz(tmp, done);

// Can we store original value in the thread's buffer?
__ ld(tmp, queue_index);
__ beqz(tmp, runtime);
Expand Down
9 changes: 9 additions & 0 deletions src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp
Expand Up @@ -488,6 +488,15 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler*
__ z_stg(tmp, 0*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);
__ z_stg(tmp2, 1*BytesPerWord + FrameMap::first_available_sp_in_frame, Z_SP);

// Is marking still active?
if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
__ load_and_test_int(tmp, Address(Z_thread, satb_q_active_byte_offset));
} else {
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ load_and_test_byte(tmp, Address(Z_thread, satb_q_active_byte_offset));
}
__ z_bre(marking_not_active); // Activity indicator is zero, so there is no marking going on currently.

__ bind(restart);
// Load the index into the SATB buffer. SATBMarkQueue::_index is a
// size_t so ld_ptr is appropriate.
Expand Down
9 changes: 9 additions & 0 deletions src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp
Expand Up @@ -468,6 +468,15 @@ void G1BarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler*
Label done;
Label runtime;

// Is marking still active?
if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
__ cmpl(queue_active, 0);
} else {
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ cmpb(queue_active, 0);
}
__ jcc(Assembler::equal, done);

// Can we store original value in the thread's buffer?

__ movptr(tmp, queue_index);
Expand Down

1 comment on commit 1bed23a

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.