< prev index next >

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Print this page

3943     __ str(c_rarg2, Address(c_rarg3, 0));          // and store it at new location
3944     __ add(c_rarg3, c_rarg3, wordSize);            // advance to next word
3945     __ bind(entry);
3946     __ cmp(c_rarg3, c_rarg1);        // check if bottom reached
3947     __ br(Assembler::NE, loop);      // if not at bottom then
3948                                      // copy next word
3949   }
3950 
3951   // call run-time routine
3952   // c_rarg1: points to monitor entry
3953   __ bind(allocated);
3954 
3955   // Increment bcp to point to the next bytecode, so exception
3956   // handling for async. exceptions work correctly.
3957   // The object has already been popped from the stack, so the
3958   // expression stack looks correct.
3959   __ increment(rbcp);
3960 
3961   // store object
3962   __ str(r0, Address(c_rarg1, BasicObjectLock::obj_offset()));

3963   __ lock_object(c_rarg1);

3964 
3965   // check to make sure this monitor doesn't cause stack overflow after locking
3966   __ save_bcp();  // in case of exception
3967   __ generate_stack_overflow_check(0);
3968 








3969   // The bcp has already been incremented. Just need to dispatch to
3970   // next instruction.
3971   __ dispatch_next(vtos);
3972 }
3973 
3974 
3975 void TemplateTable::monitorexit()
3976 {
3977   transition(atos, vtos);
3978 
3979   // check for null object
3980   __ null_check(r0);
3981 
3982   const Address monitor_block_top(
3983         rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
3984   const Address monitor_block_bot(
3985         rfp, frame::interpreter_frame_initial_sp_offset * wordSize);
3986   const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
3987 
3988   Label found;

3997     __ lea(c_rarg2, monitor_block_bot); // points to word before bottom
3998                                         // of monitor block
3999     __ b(entry);
4000 
4001     __ bind(loop);
4002     // check if current entry is for same object
4003     __ ldr(rscratch1, Address(c_rarg1, BasicObjectLock::obj_offset()));
4004     __ cmp(r0, rscratch1);
4005     // if same object then stop searching
4006     __ br(Assembler::EQ, found);
4007     // otherwise advance to next entry
4008     __ add(c_rarg1, c_rarg1, entry_size);
4009     __ bind(entry);
4010     // check if bottom reached
4011     __ cmp(c_rarg1, c_rarg2);
4012     // if not at bottom then check this entry
4013     __ br(Assembler::NE, loop);
4014   }
4015 
4016   // error handling. Unlocking was not block-structured


4017   __ call_VM(noreg, CAST_FROM_FN_PTR(address,
4018                    InterpreterRuntime::throw_illegal_monitor_state_exception));
4019   __ should_not_reach_here();
4020 
4021   // call run-time routine
4022   __ bind(found);
4023   __ push_ptr(r0); // make sure object is on stack (contract with oopMaps)
4024   __ unlock_object(c_rarg1);
4025   __ pop_ptr(r0); // discard object
4026 }
4027 
4028 
4029 // Wide instructions
4030 void TemplateTable::wide()
4031 {
4032   __ load_unsigned_byte(r19, at_bcp(1));
4033   __ mov(rscratch1, (address)Interpreter::_wentry_point);
4034   __ ldr(rscratch1, Address(rscratch1, r19, Address::uxtw(3)));
4035   __ br(rscratch1);
4036 }

3943     __ str(c_rarg2, Address(c_rarg3, 0));          // and store it at new location
3944     __ add(c_rarg3, c_rarg3, wordSize);            // advance to next word
3945     __ bind(entry);
3946     __ cmp(c_rarg3, c_rarg1);        // check if bottom reached
3947     __ br(Assembler::NE, loop);      // if not at bottom then
3948                                      // copy next word
3949   }
3950 
3951   // call run-time routine
3952   // c_rarg1: points to monitor entry
3953   __ bind(allocated);
3954 
3955   // Increment bcp to point to the next bytecode, so exception
3956   // handling for async. exceptions work correctly.
3957   // The object has already been popped from the stack, so the
3958   // expression stack looks correct.
3959   __ increment(rbcp);
3960 
3961   // store object
3962   __ str(r0, Address(c_rarg1, BasicObjectLock::obj_offset()));
3963   __ set_last_Java_frame(sp, rfp, rscratch1, rscratch2);
3964   __ lock_object(c_rarg1);
3965   __ reset_last_Java_frame(true);
3966 
3967   // check to make sure this monitor doesn't cause stack overflow after locking
3968   __ save_bcp();  // in case of exception
3969   __ generate_stack_overflow_check(0);
3970 
3971   // Check preemption
3972   Label ok;
3973   __ ldrb(rscratch1, Address(rthread, in_bytes(JavaThread::preempting_offset())));
3974   __ cbz(rscratch1, ok);
3975   __ lea(rscratch1, RuntimeAddress(StubRoutines::cont_preempt_stub()));
3976   __ br(rscratch1);
3977   __ bind(ok);
3978 
3979   // The bcp has already been incremented. Just need to dispatch to
3980   // next instruction.
3981   __ dispatch_next(vtos);
3982 }
3983 
3984 
3985 void TemplateTable::monitorexit()
3986 {
3987   transition(atos, vtos);
3988 
3989   // check for null object
3990   __ null_check(r0);
3991 
3992   const Address monitor_block_top(
3993         rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
3994   const Address monitor_block_bot(
3995         rfp, frame::interpreter_frame_initial_sp_offset * wordSize);
3996   const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
3997 
3998   Label found;

4007     __ lea(c_rarg2, monitor_block_bot); // points to word before bottom
4008                                         // of monitor block
4009     __ b(entry);
4010 
4011     __ bind(loop);
4012     // check if current entry is for same object
4013     __ ldr(rscratch1, Address(c_rarg1, BasicObjectLock::obj_offset()));
4014     __ cmp(r0, rscratch1);
4015     // if same object then stop searching
4016     __ br(Assembler::EQ, found);
4017     // otherwise advance to next entry
4018     __ add(c_rarg1, c_rarg1, entry_size);
4019     __ bind(entry);
4020     // check if bottom reached
4021     __ cmp(c_rarg1, c_rarg2);
4022     // if not at bottom then check this entry
4023     __ br(Assembler::NE, loop);
4024   }
4025 
4026   // error handling. Unlocking was not block-structured
4027   __ adr(rscratch1, __ pc());
4028   __ set_last_Java_frame(sp, rfp, rscratch1, rscratch2);
4029   __ call_VM(noreg, CAST_FROM_FN_PTR(address,
4030                    InterpreterRuntime::throw_illegal_monitor_state_exception));
4031   __ should_not_reach_here();
4032 
4033   // call run-time routine
4034   __ bind(found);
4035   __ push_ptr(r0); // make sure object is on stack (contract with oopMaps)
4036   __ unlock_object(c_rarg1);
4037   __ pop_ptr(r0); // discard object
4038 }
4039 
4040 
4041 // Wide instructions
4042 void TemplateTable::wide()
4043 {
4044   __ load_unsigned_byte(r19, at_bcp(1));
4045   __ mov(rscratch1, (address)Interpreter::_wentry_point);
4046   __ ldr(rscratch1, Address(rscratch1, r19, Address::uxtw(3)));
4047   __ br(rscratch1);
4048 }
< prev index next >