1 /*
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2014, 2018, Red Hat Inc. 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.
178 set_destination_mt_safe(stub);
179 }
180
181 void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) {
182 assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call");
183 // Reset stub.
184 address stub = static_stub->addr();
185 assert(stub != NULL, "stub not found");
186 // Creation also verifies the object.
187 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub);
188 method_holder->set_data(0);
189 }
190
191 //-----------------------------------------------------------------------------
192 // Non-product mode code
193 #ifndef PRODUCT
194
195 void CompiledDirectStaticCall::verify() {
196 // Verify call.
197 _call->verify();
198 if (os::is_MP()) {
199 _call->verify_alignment();
200 }
201
202 // Verify stub.
203 address stub = find_stub(false /* is_aot */);
204 assert(stub != NULL, "no stub found for static call");
205 // Creation also verifies the object.
206 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub);
207 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address());
208
209 // Verify state.
210 assert(is_clean() || is_call_to_compiled() || is_call_to_interpreted(), "sanity check");
211 }
212
213 #endif // !PRODUCT
|
1 /*
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2014, 2018, Red Hat Inc. 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.
178 set_destination_mt_safe(stub);
179 }
180
181 void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) {
182 assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call");
183 // Reset stub.
184 address stub = static_stub->addr();
185 assert(stub != NULL, "stub not found");
186 // Creation also verifies the object.
187 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub);
188 method_holder->set_data(0);
189 }
190
191 //-----------------------------------------------------------------------------
192 // Non-product mode code
193 #ifndef PRODUCT
194
195 void CompiledDirectStaticCall::verify() {
196 // Verify call.
197 _call->verify();
198 _call->verify_alignment();
199
200 // Verify stub.
201 address stub = find_stub(false /* is_aot */);
202 assert(stub != NULL, "no stub found for static call");
203 // Creation also verifies the object.
204 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub);
205 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address());
206
207 // Verify state.
208 assert(is_clean() || is_call_to_compiled() || is_call_to_interpreted(), "sanity check");
209 }
210
211 #endif // !PRODUCT
|