< prev index next >
src/cpu/x86/vm/templateTable_x86.cpp
Print this page
rev 12163 : Replace read-barrier in monitor-search-loop with store checks.
@@ -4273,13 +4273,10 @@
transition(atos, vtos);
// check for NULL object
__ null_check(rax);
- // We need to preemptively evacuate the object, because we later compare
- // it to objects in the BasicObjectLock list, and we might get false negatives
- // if another thread evacuates the object in the meantime. See acmp.
oopDesc::bs()->interpreter_write_barrier(_masm, rax);
const Address monitor_block_top(
rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
@@ -4308,14 +4305,12 @@
// check if current entry is used
__ cmpptr(Address(rtop, BasicObjectLock::obj_offset_in_bytes()), (int32_t) NULL_WORD);
// if not used then remember entry in rmon
__ cmovptr(Assembler::equal, rmon, rtop); // cmov => cmovptr
// check if current entry is for same object
- __ movptr(rscratch1, Address(rtop, BasicObjectLock::obj_offset_in_bytes()));
- __ shenandoah_store_addr_check(rscratch1); // Invariant
- oopDesc::bs()->interpreter_read_barrier(_masm, rscratch1);
- __ cmpptr(rax, rscratch1);
+ __ shenandoah_lock_check(rtop); // Invariant
+ __ cmpptr(rax, Address(rtop, BasicObjectLock::obj_offset_in_bytes()));
// if same object then stop searching
__ jccb(Assembler::equal, exit);
// otherwise advance to next entry
__ addptr(rtop, entry_size);
__ bind(entry);
@@ -4379,13 +4374,10 @@
transition(atos, vtos);
// check for NULL object
__ null_check(rax);
- // We need to preemptively evacuate the object, because we later compare
- // it to objects in the BasicObjectLock list, and we might get false negatives
- // if another thread evacuates the object in the meantime. See acmp.
oopDesc::bs()->interpreter_write_barrier(_masm, rax);
const Address monitor_block_top(
rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
@@ -4406,14 +4398,12 @@
// of monitor block
__ jmpb_if_possible(entry);
__ bind(loop);
// check if current entry is for same object
- __ movptr(rscratch1, Address(rtop, BasicObjectLock::obj_offset_in_bytes()));
- __ shenandoah_store_addr_check(rscratch1); // Invariant
- oopDesc::bs()->interpreter_read_barrier(_masm, rscratch1);
- __ cmpptr(rax, rscratch1);
+ __ shenandoah_lock_check(rtop); // Invariant
+ __ cmpptr(rax, Address(rtop, BasicObjectLock::obj_offset_in_bytes()));
// if same object then stop searching
__ jcc(Assembler::equal, found);
// otherwise advance to next entry
__ addptr(rtop, entry_size);
__ bind(entry);
< prev index next >