724
725 // check against the current stack bottom
726 __ cmpptr(rsp, rax);
727 __ jcc(Assembler::above, after_frame_check_pop);
728
729 __ pop(state); // get c++ prev state.
730
731 // throw exception return address becomes throwing pc
732 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_StackOverflowError));
733
734 // all done with frame size check
735 __ bind(after_frame_check_pop);
736 __ pop(state);
737
738 __ bind(after_frame_check);
739 }
740
741 // Find preallocated monitor and lock method (C++ interpreter)
742 // rbx - Method*
743 //
744 void InterpreterGenerator::lock_method(void) {
745 // assumes state == rsi/r13 == pointer to current interpreterState
746 // minimally destroys rax, rdx|c_rarg1, rdi
747 //
748 // synchronize method
749 const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
750 const Address access_flags (rbx, Method::access_flags_offset());
751
752 const Register monitor = NOT_LP64(rdx) LP64_ONLY(c_rarg1);
753
754 // find initial monitor i.e. monitors[-1]
755 __ movptr(monitor, STATE(_monitor_base)); // get monitor bottom limit
756 __ subptr(monitor, entry_size); // point to initial monitor
757
758 #ifdef ASSERT
759 { Label L;
760 __ movl(rax, access_flags);
761 __ testl(rax, JVM_ACC_SYNCHRONIZED);
762 __ jcc(Assembler::notZero, L);
763 __ stop("method doesn't need synchronization");
764 __ bind(L);
|
724
725 // check against the current stack bottom
726 __ cmpptr(rsp, rax);
727 __ jcc(Assembler::above, after_frame_check_pop);
728
729 __ pop(state); // get c++ prev state.
730
731 // throw exception return address becomes throwing pc
732 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_StackOverflowError));
733
734 // all done with frame size check
735 __ bind(after_frame_check_pop);
736 __ pop(state);
737
738 __ bind(after_frame_check);
739 }
740
741 // Find preallocated monitor and lock method (C++ interpreter)
742 // rbx - Method*
743 //
744 void CppInterpreterGenerator::lock_method() {
745 // assumes state == rsi/r13 == pointer to current interpreterState
746 // minimally destroys rax, rdx|c_rarg1, rdi
747 //
748 // synchronize method
749 const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
750 const Address access_flags (rbx, Method::access_flags_offset());
751
752 const Register monitor = NOT_LP64(rdx) LP64_ONLY(c_rarg1);
753
754 // find initial monitor i.e. monitors[-1]
755 __ movptr(monitor, STATE(_monitor_base)); // get monitor bottom limit
756 __ subptr(monitor, entry_size); // point to initial monitor
757
758 #ifdef ASSERT
759 { Label L;
760 __ movl(rax, access_flags);
761 __ testl(rax, JVM_ACC_SYNCHRONIZED);
762 __ jcc(Assembler::notZero, L);
763 __ stop("method doesn't need synchronization");
764 __ bind(L);
|