8244729: Shenandoah: remove resolve paths from SBSA::generate_shenandoah_lrb

Reviewed-by: rkennke
This commit is contained in:
Aleksey Shipilev 2020-05-25 11:05:23 +02:00
parent 008d69e5e2
commit 4059e44b94
2 changed files with 3 additions and 34 deletions

View File

@ -683,23 +683,11 @@ address ShenandoahBarrierSetAssembler::generate_shenandoah_lrb(StubCodeGenerator
StubCodeMark mark(cgen, "StubRoutines", "shenandoah_lrb");
address start = __ pc();
Label work, done;
Label slow_path;
__ mov(rscratch2, ShenandoahHeap::in_cset_fast_test_addr());
__ lsr(rscratch1, r0, ShenandoahHeapRegion::region_size_bytes_shift_jint());
__ ldrb(rscratch2, Address(rscratch2, rscratch1));
__ tbnz(rscratch2, 0, work);
__ ret(lr);
__ bind(work);
Label slow_path;
__ ldr(rscratch1, Address(r0, oopDesc::mark_offset_in_bytes()));
__ eon(rscratch1, rscratch1, zr);
__ ands(zr, rscratch1, markWord::lock_mask_in_place);
__ br(Assembler::NE, slow_path);
// Decode forwarded object.
__ orr(rscratch1, rscratch1, markWord::marked_value);
__ eon(r0, rscratch1, zr);
__ tbnz(rscratch2, 0, slow_path);
__ ret(lr);
__ bind(slow_path);
@ -718,7 +706,6 @@ address ShenandoahBarrierSetAssembler::generate_shenandoah_lrb(StubCodeGenerator
__ mov(r0, rscratch1);
__ leave(); // required for proper stackwalking of RuntimeStub frame
__ bind(done);
__ ret(lr);
return start;

View File

@ -977,7 +977,7 @@ address ShenandoahBarrierSetAssembler::generate_shenandoah_lrb(StubCodeGenerator
StubCodeMark mark(cgen, "StubRoutines", "shenandoah_lrb");
address start = __ pc();
Label resolve_oop, slow_path;
Label slow_path;
// We use RDI, which also serves as argument register for slow call.
// RAX always holds the src object ptr, except after the slow call,
@ -995,25 +995,7 @@ address ShenandoahBarrierSetAssembler::generate_shenandoah_lrb(StubCodeGenerator
__ movptr(tmp2, (intptr_t) ShenandoahHeap::in_cset_fast_test_addr());
__ movbool(tmp2, Address(tmp2, tmp1, Address::times_1));
__ testbool(tmp2);
__ jccb(Assembler::notZero, resolve_oop);
__ pop(tmp2);
__ pop(tmp1);
__ ret(0);
// Test if object is already resolved.
__ bind(resolve_oop);
__ movptr(tmp2, Address(rax, oopDesc::mark_offset_in_bytes()));
// Test if both lowest bits are set. We trick it by negating the bits
// then test for both bits clear.
__ notptr(tmp2);
__ testb(tmp2, markWord::marked_value);
__ jccb(Assembler::notZero, slow_path);
// Clear both lower bits. It's still inverted, so set them, and then invert back.
__ orptr(tmp2, markWord::marked_value);
__ notptr(tmp2);
// At this point, tmp2 contains the decoded forwarding pointer.
__ mov(rax, tmp2);
__ pop(tmp2);
__ pop(tmp1);
__ ret(0);