< prev index next >

src/hotspot/cpu/x86/templateTable_x86.cpp

Print this page




4747 // ...
4748 // [saved rbp    ] <--- rbp
4749 void TemplateTable::monitorenter() {
4750   transition(atos, vtos);
4751 
4752   // check for NULL object
4753   __ null_check(rax);
4754 
4755   const Address monitor_block_top(
4756         rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
4757   const Address monitor_block_bot(
4758         rbp, frame::interpreter_frame_initial_sp_offset * wordSize);
4759   const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
4760 
4761   Label allocated;
4762 
4763   Register rtop = LP64_ONLY(c_rarg3) NOT_LP64(rcx);
4764   Register rbot = LP64_ONLY(c_rarg2) NOT_LP64(rbx);
4765   Register rmon = LP64_ONLY(c_rarg1) NOT_LP64(rdx);
4766 











4767   // initialize entry pointer
4768   __ xorl(rmon, rmon); // points to free slot or NULL
4769 
4770   // find a free slot in the monitor block (result in rmon)
4771   {
4772     Label entry, loop, exit;
4773     __ movptr(rtop, monitor_block_top); // points to current entry,
4774                                         // starting with top-most entry
4775     __ lea(rbot, monitor_block_bot);    // points to word before bottom
4776                                         // of monitor block
4777     __ jmpb(entry);
4778 
4779     __ bind(loop);
4780     // check if current entry is used
4781     __ cmpptr(Address(rtop, BasicObjectLock::obj_offset_in_bytes()), (int32_t) NULL_WORD);
4782     // if not used then remember entry in rmon
4783     __ cmovptr(Assembler::equal, rmon, rtop);   // cmov => cmovptr
4784     // check if current entry is for same object
4785     __ cmpptr(rax, Address(rtop, BasicObjectLock::obj_offset_in_bytes()));
4786     // if same object then stop searching




4747 // ...
4748 // [saved rbp    ] <--- rbp
4749 void TemplateTable::monitorenter() {
4750   transition(atos, vtos);
4751 
4752   // check for NULL object
4753   __ null_check(rax);
4754 
4755   const Address monitor_block_top(
4756         rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
4757   const Address monitor_block_bot(
4758         rbp, frame::interpreter_frame_initial_sp_offset * wordSize);
4759   const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
4760 
4761   Label allocated;
4762 
4763   Register rtop = LP64_ONLY(c_rarg3) NOT_LP64(rcx);
4764   Register rbot = LP64_ONLY(c_rarg2) NOT_LP64(rbx);
4765   Register rmon = LP64_ONLY(c_rarg1) NOT_LP64(rdx);
4766 
4767   if (EnableValhalla) {
4768     Label is_not_value;
4769 
4770     __ test_oop_is_not_value(rax, rmon, is_not_value);
4771     __ call_VM(noreg, CAST_FROM_FN_PTR(address,
4772                      InterpreterRuntime::throw_illegal_monitor_state_exception));
4773     __ should_not_reach_here();
4774 
4775     __ bind(is_not_value);
4776 
4777   }
4778   // initialize entry pointer
4779   __ xorl(rmon, rmon); // points to free slot or NULL
4780 
4781   // find a free slot in the monitor block (result in rmon)
4782   {
4783     Label entry, loop, exit;
4784     __ movptr(rtop, monitor_block_top); // points to current entry,
4785                                         // starting with top-most entry
4786     __ lea(rbot, monitor_block_bot);    // points to word before bottom
4787                                         // of monitor block
4788     __ jmpb(entry);
4789 
4790     __ bind(loop);
4791     // check if current entry is used
4792     __ cmpptr(Address(rtop, BasicObjectLock::obj_offset_in_bytes()), (int32_t) NULL_WORD);
4793     // if not used then remember entry in rmon
4794     __ cmovptr(Assembler::equal, rmon, rtop);   // cmov => cmovptr
4795     // check if current entry is for same object
4796     __ cmpptr(rax, Address(rtop, BasicObjectLock::obj_offset_in_bytes()));
4797     // if same object then stop searching


< prev index next >