< prev index next >

src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp

Print this page

 589 
 590   pop(state);
 591   if (throw_monitor_exception) {
 592     // Entry already unlocked, need to throw exception
 593     call_VM(noreg, CAST_FROM_FN_PTR(address,
 594                    InterpreterRuntime::throw_illegal_monitor_state_exception));
 595     should_not_reach_here();
 596   } else {
 597     // Monitor already unlocked during a stack unroll. If requested,
 598     // install an illegal_monitor_state_exception.  Continue with
 599     // stack unrolling.
 600     if (install_monitor_exception) {
 601       call_VM(noreg, CAST_FROM_FN_PTR(address,
 602                      InterpreterRuntime::new_illegal_monitor_state_exception));
 603     }
 604     b(unlocked);
 605   }
 606 
 607   bind(unlock);
 608   unlock_object(c_rarg1);

 609   pop(state);
 610 
 611   // Check that for block-structured locking (i.e., that all locked
 612   // objects has been unlocked)
 613   bind(unlocked);
 614 
 615   // r0: Might contain return value
 616 
 617   // Check that all monitors are unlocked
 618   {
 619     Label loop, exception, entry, restart;
 620     const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
 621     const Address monitor_block_top(
 622         rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
 623     const Address monitor_block_bot(
 624         rfp, frame::interpreter_frame_initial_sp_offset * wordSize);
 625 
 626     bind(restart);
 627     // We use c_rarg1 so that if we go slow path it will be the correct
 628     // register for unlock_object to pass to VM directly

 631     lea(r19, monitor_block_bot);  // points to word before bottom of
 632                                   // monitor block
 633     b(entry);
 634 
 635     // Entry already locked, need to throw exception
 636     bind(exception);
 637 
 638     if (throw_monitor_exception) {
 639       // Throw exception
 640       MacroAssembler::call_VM(noreg,
 641                               CAST_FROM_FN_PTR(address, InterpreterRuntime::
 642                                    throw_illegal_monitor_state_exception));
 643       should_not_reach_here();
 644     } else {
 645       // Stack unrolling. Unlock object and install illegal_monitor_exception.
 646       // Unlock does not block, so don't have to worry about the frame.
 647       // We don't have to preserve c_rarg1 since we are going to throw an exception.
 648 
 649       push(state);
 650       unlock_object(c_rarg1);

 651       pop(state);
 652 
 653       if (install_monitor_exception) {
 654         call_VM(noreg, CAST_FROM_FN_PTR(address,
 655                                         InterpreterRuntime::
 656                                         new_illegal_monitor_state_exception));
 657       }
 658 
 659       b(restart);
 660     }
 661 
 662     bind(loop);
 663     // check if current entry is used
 664     ldr(rscratch1, Address(c_rarg1, BasicObjectLock::obj_offset_in_bytes()));
 665     cbnz(rscratch1, exception);
 666 
 667     add(c_rarg1, c_rarg1, entry_size); // otherwise advance to next entry
 668     bind(entry);
 669     cmp(c_rarg1, r19); // check if bottom reached
 670     br(Assembler::NE, loop); // if not at bottom then check this entry

 589 
 590   pop(state);
 591   if (throw_monitor_exception) {
 592     // Entry already unlocked, need to throw exception
 593     call_VM(noreg, CAST_FROM_FN_PTR(address,
 594                    InterpreterRuntime::throw_illegal_monitor_state_exception));
 595     should_not_reach_here();
 596   } else {
 597     // Monitor already unlocked during a stack unroll. If requested,
 598     // install an illegal_monitor_state_exception.  Continue with
 599     // stack unrolling.
 600     if (install_monitor_exception) {
 601       call_VM(noreg, CAST_FROM_FN_PTR(address,
 602                      InterpreterRuntime::new_illegal_monitor_state_exception));
 603     }
 604     b(unlocked);
 605   }
 606 
 607   bind(unlock);
 608   unlock_object(c_rarg1);
 609   dec_held_monitor_count(rthread);
 610   pop(state);
 611 
 612   // Check that for block-structured locking (i.e., that all locked
 613   // objects has been unlocked)
 614   bind(unlocked);
 615 
 616   // r0: Might contain return value
 617 
 618   // Check that all monitors are unlocked
 619   {
 620     Label loop, exception, entry, restart;
 621     const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
 622     const Address monitor_block_top(
 623         rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
 624     const Address monitor_block_bot(
 625         rfp, frame::interpreter_frame_initial_sp_offset * wordSize);
 626 
 627     bind(restart);
 628     // We use c_rarg1 so that if we go slow path it will be the correct
 629     // register for unlock_object to pass to VM directly

 632     lea(r19, monitor_block_bot);  // points to word before bottom of
 633                                   // monitor block
 634     b(entry);
 635 
 636     // Entry already locked, need to throw exception
 637     bind(exception);
 638 
 639     if (throw_monitor_exception) {
 640       // Throw exception
 641       MacroAssembler::call_VM(noreg,
 642                               CAST_FROM_FN_PTR(address, InterpreterRuntime::
 643                                    throw_illegal_monitor_state_exception));
 644       should_not_reach_here();
 645     } else {
 646       // Stack unrolling. Unlock object and install illegal_monitor_exception.
 647       // Unlock does not block, so don't have to worry about the frame.
 648       // We don't have to preserve c_rarg1 since we are going to throw an exception.
 649 
 650       push(state);
 651       unlock_object(c_rarg1);
 652       dec_held_monitor_count(rthread);
 653       pop(state);
 654 
 655       if (install_monitor_exception) {
 656         call_VM(noreg, CAST_FROM_FN_PTR(address,
 657                                         InterpreterRuntime::
 658                                         new_illegal_monitor_state_exception));
 659       }
 660 
 661       b(restart);
 662     }
 663 
 664     bind(loop);
 665     // check if current entry is used
 666     ldr(rscratch1, Address(c_rarg1, BasicObjectLock::obj_offset_in_bytes()));
 667     cbnz(rscratch1, exception);
 668 
 669     add(c_rarg1, c_rarg1, entry_size); // otherwise advance to next entry
 670     bind(entry);
 671     cmp(c_rarg1, r19); // check if bottom reached
 672     br(Assembler::NE, loop); // if not at bottom then check this entry
< prev index next >