917 }
918
919 // remove activation
920 //
921 // Unlock the receiver if this is a synchronized method.
922 // Unlock any Java monitors from syncronized blocks.
923 // Remove the activation from the stack.
924 //
925 // If there are locked Java monitors
926 // If throw_monitor_exception
927 // throws IllegalMonitorStateException
928 // Else if install_monitor_exception
929 // installs IllegalMonitorStateException
930 // Else
931 // no error processing
932 void InterpreterMacroAssembler::remove_activation(
933 TosState state,
934 Register ret_addr,
935 bool throw_monitor_exception,
936 bool install_monitor_exception,
937 bool notify_jvmdi) {
938 // Note: Registers rdx xmm0 may be in use for the
939 // result check if synchronized method
940 Label unlocked, unlock, no_unlock;
941
942 const Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
943 const Register robj = LP64_ONLY(c_rarg1) NOT_LP64(rdx);
944 const Register rmon = LP64_ONLY(c_rarg1) NOT_LP64(rcx);
945 // monitor pointers need different register
946 // because rdx may have the result in it
947 NOT_LP64(get_thread(rcx);)
948
949 // get the value of _do_not_unlock_if_synchronized into rdx
950 const Address do_not_unlock_if_synchronized(rthread,
951 in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()));
952 movbool(rbx, do_not_unlock_if_synchronized);
953 movbool(do_not_unlock_if_synchronized, false); // reset the flag
954
955 // get method access flags
956 movptr(rcx, Address(rbp, frame::interpreter_frame_method_offset * wordSize));
957 movl(rcx, Address(rcx, Method::access_flags_offset()));
1084 // testing if reserved zone needs to be re-enabled
1085 Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
1086 Label no_reserved_zone_enabling;
1087
1088 NOT_LP64(get_thread(rthread);)
1089
1090 cmpl(Address(rthread, JavaThread::stack_guard_state_offset()), JavaThread::stack_guard_enabled);
1091 jcc(Assembler::equal, no_reserved_zone_enabling);
1092
1093 cmpptr(rbx, Address(rthread, JavaThread::reserved_stack_activation_offset()));
1094 jcc(Assembler::lessEqual, no_reserved_zone_enabling);
1095
1096 call_VM_leaf(
1097 CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), rthread);
1098 push(rthread);
1099 call_VM(noreg, CAST_FROM_FN_PTR(address,
1100 InterpreterRuntime::throw_delayed_StackOverflowError));
1101 should_not_reach_here();
1102
1103 bind(no_reserved_zone_enabling);
1104 }
1105 leave(); // remove frame anchor
1106 pop(ret_addr); // get return address
1107 mov(rsp, rbx); // set sp to sender sp
1108 }
1109
1110 void InterpreterMacroAssembler::get_method_counters(Register method,
1111 Register mcs, Label& skip) {
1112 Label has_counters;
1113 movptr(mcs, Address(method, Method::method_counters_offset()));
1114 testptr(mcs, mcs);
1115 jcc(Assembler::notZero, has_counters);
1116 call_VM(noreg, CAST_FROM_FN_PTR(address,
1117 InterpreterRuntime::build_method_counters), method);
1118 movptr(mcs, Address(method,Method::method_counters_offset()));
1119 testptr(mcs, mcs);
1120 jcc(Assembler::zero, skip); // No MethodCounters allocated, OutOfMemory
1121 bind(has_counters);
1122 }
1123
|
917 }
918
919 // remove activation
920 //
921 // Unlock the receiver if this is a synchronized method.
922 // Unlock any Java monitors from syncronized blocks.
923 // Remove the activation from the stack.
924 //
925 // If there are locked Java monitors
926 // If throw_monitor_exception
927 // throws IllegalMonitorStateException
928 // Else if install_monitor_exception
929 // installs IllegalMonitorStateException
930 // Else
931 // no error processing
932 void InterpreterMacroAssembler::remove_activation(
933 TosState state,
934 Register ret_addr,
935 bool throw_monitor_exception,
936 bool install_monitor_exception,
937 bool notify_jvmdi,
938 bool load_values) {
939 // Note: Registers rdx xmm0 may be in use for the
940 // result check if synchronized method
941 Label unlocked, unlock, no_unlock;
942
943 const Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
944 const Register robj = LP64_ONLY(c_rarg1) NOT_LP64(rdx);
945 const Register rmon = LP64_ONLY(c_rarg1) NOT_LP64(rcx);
946 // monitor pointers need different register
947 // because rdx may have the result in it
948 NOT_LP64(get_thread(rcx);)
949
950 // get the value of _do_not_unlock_if_synchronized into rdx
951 const Address do_not_unlock_if_synchronized(rthread,
952 in_bytes(JavaThread::do_not_unlock_if_synchronized_offset()));
953 movbool(rbx, do_not_unlock_if_synchronized);
954 movbool(do_not_unlock_if_synchronized, false); // reset the flag
955
956 // get method access flags
957 movptr(rcx, Address(rbp, frame::interpreter_frame_method_offset * wordSize));
958 movl(rcx, Address(rcx, Method::access_flags_offset()));
1085 // testing if reserved zone needs to be re-enabled
1086 Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
1087 Label no_reserved_zone_enabling;
1088
1089 NOT_LP64(get_thread(rthread);)
1090
1091 cmpl(Address(rthread, JavaThread::stack_guard_state_offset()), JavaThread::stack_guard_enabled);
1092 jcc(Assembler::equal, no_reserved_zone_enabling);
1093
1094 cmpptr(rbx, Address(rthread, JavaThread::reserved_stack_activation_offset()));
1095 jcc(Assembler::lessEqual, no_reserved_zone_enabling);
1096
1097 call_VM_leaf(
1098 CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), rthread);
1099 push(rthread);
1100 call_VM(noreg, CAST_FROM_FN_PTR(address,
1101 InterpreterRuntime::throw_delayed_StackOverflowError));
1102 should_not_reach_here();
1103
1104 bind(no_reserved_zone_enabling);
1105 }
1106 if (load_values) {
1107 // We are returning a value type, load its fields into registers
1108 super_call_VM_leaf(StubRoutines::load_value_type_fields_in_regs());
1109
1110 // call above kills the value in rbx. Reload it.
1111 movptr(rbx, Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize));
1112 }
1113 leave(); // remove frame anchor
1114 pop(ret_addr); // get return address
1115 mov(rsp, rbx); // set sp to sender sp
1116 }
1117
1118 void InterpreterMacroAssembler::get_method_counters(Register method,
1119 Register mcs, Label& skip) {
1120 Label has_counters;
1121 movptr(mcs, Address(method, Method::method_counters_offset()));
1122 testptr(mcs, mcs);
1123 jcc(Assembler::notZero, has_counters);
1124 call_VM(noreg, CAST_FROM_FN_PTR(address,
1125 InterpreterRuntime::build_method_counters), method);
1126 movptr(mcs, Address(method,Method::method_counters_offset()));
1127 testptr(mcs, mcs);
1128 jcc(Assembler::zero, skip); // No MethodCounters allocated, OutOfMemory
1129 bind(has_counters);
1130 }
1131
|