src/cpu/x86/vm/interp_masm_x86.cpp

Print this page




1006 
1007     addptr(rmon, entry_size); // otherwise advance to next entry
1008     bind(entry);
1009     cmpptr(rmon, rbx); // check if bottom reached
1010     jcc(Assembler::notEqual, loop); // if not at bottom then check this entry
1011   }
1012 
1013   bind(no_unlock);
1014 
1015   // jvmti support
1016   if (notify_jvmdi) {
1017     notify_method_exit(state, NotifyJVMTI);    // preserve TOSCA
1018   } else {
1019     notify_method_exit(state, SkipNotifyJVMTI); // preserve TOSCA
1020   }
1021 
1022   // remove activation
1023   // get sender sp
1024   movptr(rbx,
1025          Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize));



















1026   leave();                           // remove frame anchor
1027   pop(ret_addr);                     // get return address
1028   mov(rsp, rbx);                     // set sp to sender sp
1029 }
1030 #endif // !CC_INTERP
1031 
1032 void InterpreterMacroAssembler::get_method_counters(Register method,
1033                                                     Register mcs, Label& skip) {
1034   Label has_counters;
1035   movptr(mcs, Address(method, Method::method_counters_offset()));
1036   testptr(mcs, mcs);
1037   jcc(Assembler::notZero, has_counters);
1038   call_VM(noreg, CAST_FROM_FN_PTR(address,
1039           InterpreterRuntime::build_method_counters), method);
1040   movptr(mcs, Address(method,Method::method_counters_offset()));
1041   testptr(mcs, mcs);
1042   jcc(Assembler::zero, skip); // No MethodCounters allocated, OutOfMemory
1043   bind(has_counters);
1044 }
1045 




1006 
1007     addptr(rmon, entry_size); // otherwise advance to next entry
1008     bind(entry);
1009     cmpptr(rmon, rbx); // check if bottom reached
1010     jcc(Assembler::notEqual, loop); // if not at bottom then check this entry
1011   }
1012 
1013   bind(no_unlock);
1014 
1015   // jvmti support
1016   if (notify_jvmdi) {
1017     notify_method_exit(state, NotifyJVMTI);    // preserve TOSCA
1018   } else {
1019     notify_method_exit(state, SkipNotifyJVMTI); // preserve TOSCA
1020   }
1021 
1022   // remove activation
1023   // get sender sp
1024   movptr(rbx,
1025          Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize));
1026   if (StackReservedPages > 0) {
1027     // testing if reserved zone needs to be re-enabled
1028     Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
1029     Label no_reserved_zone_enabling;
1030 
1031     NOT_LP64(get_thread(rthread);)
1032 
1033     cmpptr(rbx, Address(rthread, JavaThread::reserved_stack_activation_offset()));
1034     jcc(Assembler::lessEqual, no_reserved_zone_enabling);
1035   
1036     call_VM_leaf(
1037       CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), rthread);
1038     push(rthread);
1039     call_VM(noreg, CAST_FROM_FN_PTR(address,
1040                    InterpreterRuntime::throw_delayed_StackOverflowError));
1041     should_not_reach_here();
1042     
1043     bind(no_reserved_zone_enabling);
1044   }
1045   leave();                           // remove frame anchor
1046   pop(ret_addr);                     // get return address
1047   mov(rsp, rbx);                     // set sp to sender sp
1048 }
1049 #endif // !CC_INTERP
1050 
1051 void InterpreterMacroAssembler::get_method_counters(Register method,
1052                                                     Register mcs, Label& skip) {
1053   Label has_counters;
1054   movptr(mcs, Address(method, Method::method_counters_offset()));
1055   testptr(mcs, mcs);
1056   jcc(Assembler::notZero, has_counters);
1057   call_VM(noreg, CAST_FROM_FN_PTR(address,
1058           InterpreterRuntime::build_method_counters), method);
1059   movptr(mcs, Address(method,Method::method_counters_offset()));
1060   testptr(mcs, mcs);
1061   jcc(Assembler::zero, skip); // No MethodCounters allocated, OutOfMemory
1062   bind(has_counters);
1063 }
1064