1 /*
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
1063
1064 // remove activation
1065 // get sender sp
1066 movptr(rbx,
1067 Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize));
1068 if (StackReservedPages > 0) {
1069 // testing if reserved zone needs to be re-enabled
1070 Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
1071 Label no_reserved_zone_enabling;
1072
1073 NOT_LP64(get_thread(rthread);)
1074
1075 cmpl(Address(rthread, JavaThread::stack_guard_state_offset()), JavaThread::stack_guard_enabled);
1076 jcc(Assembler::equal, no_reserved_zone_enabling);
1077
1078 cmpptr(rbx, Address(rthread, JavaThread::reserved_stack_activation_offset()));
1079 jcc(Assembler::lessEqual, no_reserved_zone_enabling);
1080
1081 call_VM_leaf(
1082 CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), rthread);
1083 push(rthread);
1084 call_VM(noreg, CAST_FROM_FN_PTR(address,
1085 InterpreterRuntime::throw_delayed_StackOverflowError));
1086 should_not_reach_here();
1087
1088 bind(no_reserved_zone_enabling);
1089 }
1090 leave(); // remove frame anchor
1091 pop(ret_addr); // get return address
1092 mov(rsp, rbx); // set sp to sender sp
1093 }
1094
1095 void InterpreterMacroAssembler::get_method_counters(Register method,
1096 Register mcs, Label& skip) {
1097 Label has_counters;
1098 movptr(mcs, Address(method, Method::method_counters_offset()));
1099 testptr(mcs, mcs);
1100 jcc(Assembler::notZero, has_counters);
1101 call_VM(noreg, CAST_FROM_FN_PTR(address,
1102 InterpreterRuntime::build_method_counters), method);
1103 movptr(mcs, Address(method,Method::method_counters_offset()));
|
1 /*
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
1063
1064 // remove activation
1065 // get sender sp
1066 movptr(rbx,
1067 Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize));
1068 if (StackReservedPages > 0) {
1069 // testing if reserved zone needs to be re-enabled
1070 Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
1071 Label no_reserved_zone_enabling;
1072
1073 NOT_LP64(get_thread(rthread);)
1074
1075 cmpl(Address(rthread, JavaThread::stack_guard_state_offset()), JavaThread::stack_guard_enabled);
1076 jcc(Assembler::equal, no_reserved_zone_enabling);
1077
1078 cmpptr(rbx, Address(rthread, JavaThread::reserved_stack_activation_offset()));
1079 jcc(Assembler::lessEqual, no_reserved_zone_enabling);
1080
1081 call_VM_leaf(
1082 CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), rthread);
1083 call_VM(noreg, CAST_FROM_FN_PTR(address,
1084 InterpreterRuntime::throw_delayed_StackOverflowError));
1085 should_not_reach_here();
1086
1087 bind(no_reserved_zone_enabling);
1088 }
1089 leave(); // remove frame anchor
1090 pop(ret_addr); // get return address
1091 mov(rsp, rbx); // set sp to sender sp
1092 }
1093
1094 void InterpreterMacroAssembler::get_method_counters(Register method,
1095 Register mcs, Label& skip) {
1096 Label has_counters;
1097 movptr(mcs, Address(method, Method::method_counters_offset()));
1098 testptr(mcs, mcs);
1099 jcc(Assembler::notZero, has_counters);
1100 call_VM(noreg, CAST_FROM_FN_PTR(address,
1101 InterpreterRuntime::build_method_counters), method);
1102 movptr(mcs, Address(method,Method::method_counters_offset()));
|