1 /*
2 * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2016 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
128
129 void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) {
130 assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call");
131 // Reset stub.
132 address stub = static_stub->addr();
133 assert(stub != NULL, "stub not found");
134 // Creation also verifies the object.
135 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + NativeCall::get_IC_pos_in_java_to_interp_stub());
136 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address());
137 method_holder->set_data(0);
138 jump->set_jump_destination((address)-1);
139 }
140
141 //-----------------------------------------------------------------------------
142
143 #ifndef PRODUCT
144
145 void CompiledDirectStaticCall::verify() {
146 // Verify call.
147 _call->verify();
148 if (os::is_MP()) {
149 _call->verify_alignment();
150 }
151
152 // Verify stub.
153 address stub = find_stub(/*is_aot*/ false);
154 assert(stub != NULL, "no stub found for static call");
155 // Creation also verifies the object.
156 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + NativeCall::get_IC_pos_in_java_to_interp_stub());
157 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address());
158
159 // Verify state.
160 assert(is_clean() || is_call_to_compiled() || is_call_to_interpreted(), "sanity check");
161 }
162
163 #endif // !PRODUCT
|
1 /*
2 * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2016 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
128
129 void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) {
130 assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call");
131 // Reset stub.
132 address stub = static_stub->addr();
133 assert(stub != NULL, "stub not found");
134 // Creation also verifies the object.
135 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + NativeCall::get_IC_pos_in_java_to_interp_stub());
136 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address());
137 method_holder->set_data(0);
138 jump->set_jump_destination((address)-1);
139 }
140
141 //-----------------------------------------------------------------------------
142
143 #ifndef PRODUCT
144
145 void CompiledDirectStaticCall::verify() {
146 // Verify call.
147 _call->verify();
148 _call->verify_alignment();
149
150 // Verify stub.
151 address stub = find_stub(/*is_aot*/ false);
152 assert(stub != NULL, "no stub found for static call");
153 // Creation also verifies the object.
154 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + NativeCall::get_IC_pos_in_java_to_interp_stub());
155 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address());
156
157 // Verify state.
158 assert(is_clean() || is_call_to_compiled() || is_call_to_interpreted(), "sanity check");
159 }
160
161 #endif // !PRODUCT
|