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 */
23
24 #include "precompiled.hpp"
25
26 #include "code/codeCache.hpp"
27 #include "code/compiledIC.hpp"
28 #include "code/nativeInst.hpp"
29 #include "compiler/compilerOracle.hpp"
30 #include "gc/shared/cardTableModRefBS.hpp"
31 #include "gc/shared/collectedHeap.hpp"
32 #include "gc/shared/gcLocker.hpp"
33 #include "jvmci/compilerRuntime.hpp"
34 #include "jvmci/jvmciRuntime.hpp"
35 #include "oops/method.hpp"
36 #include "aot/aotCompiledMethod.hpp"
37 #include "aot/aotLoader.hpp"
38 #include "aot/aotCodeHeap.hpp"
39 #include "aot/compiledIC_aot.hpp"
40 #include "runtime/java.hpp"
41 #include "runtime/os.hpp"
42 #include "runtime/sharedRuntime.hpp"
43 #include "utilities/array.hpp"
44 #include "utilities/xmlstream.hpp"
45
46 #include <dlfcn.h>
47 #include <stdio.h>
48
49 #if 0
50 static void metadata_oops_do(Metadata** metadata_begin, Metadata **metadata_end, OopClosure* f) {
51 // Visit the metadata/oops section
52 for (Metadata** p = metadata_begin; p < metadata_end; p++) {
53 Metadata* m = *p;
54
55 intptr_t meta = (intptr_t)m;
56 if ((meta & 1) == 1) {
57 // already resolved
58 m = (Metadata*)(meta & ~1);
59 } else {
383 } else if (*_state_adr == not_used) {
384 print_on(tty, "made not used");
385 } else if (*_state_adr == in_use) {
386 print_on(tty, "made entrant");
387 }
388 }
389 }
390
391
392 NativeInstruction* PltNativeCallWrapper::get_load_instruction(virtual_call_Relocation* r) const {
393 return nativeLoadGot_at(_call->plt_load_got());
394 }
395
396 void PltNativeCallWrapper::verify_resolve_call(address dest) const {
397 CodeBlob* db = CodeCache::find_blob_unsafe(dest);
398 if (db == NULL) {
399 assert(dest == _call->plt_resolve_call(), "sanity");
400 }
401 }
402
403 void PltNativeCallWrapper::set_to_interpreted(methodHandle method, CompiledICInfo& info) {
404 assert(!info.to_aot(), "only for nmethod");
405 CompiledPltStaticCall* csc = CompiledPltStaticCall::at(instruction_address());
406 csc->set_to_interpreted(method, info.entry());
407 }
408
409 NativeCallWrapper* AOTCompiledMethod::call_wrapper_at(address call) const {
410 return new PltNativeCallWrapper((NativePltCall*) call);
411 }
412
413 NativeCallWrapper* AOTCompiledMethod::call_wrapper_before(address return_pc) const {
414 return new PltNativeCallWrapper(nativePltCall_before(return_pc));
415 }
416
417 CompiledStaticCall* AOTCompiledMethod::compiledStaticCall_at(Relocation* call_site) const {
418 return CompiledPltStaticCall::at(call_site);
419 }
420
421 CompiledStaticCall* AOTCompiledMethod::compiledStaticCall_at(address call_site) const {
422 return CompiledPltStaticCall::at(call_site);
423 }
|
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 */
23
24 #include "precompiled.hpp"
25
26 #include "aot/aotCodeHeap.hpp"
27 #include "aot/aotLoader.hpp"
28 #include "aot/compiledIC_aot.hpp"
29 #include "code/codeCache.hpp"
30 #include "code/compiledIC.hpp"
31 #include "code/nativeInst.hpp"
32 #include "compiler/compilerOracle.hpp"
33 #include "gc/shared/cardTableModRefBS.hpp"
34 #include "gc/shared/collectedHeap.hpp"
35 #include "gc/shared/gcLocker.hpp"
36 #include "jvmci/compilerRuntime.hpp"
37 #include "jvmci/jvmciRuntime.hpp"
38 #include "oops/method.hpp"
39 #include "runtime/java.hpp"
40 #include "runtime/os.hpp"
41 #include "runtime/sharedRuntime.hpp"
42 #include "utilities/array.hpp"
43 #include "utilities/xmlstream.hpp"
44
45 #include <dlfcn.h>
46 #include <stdio.h>
47
48 #if 0
49 static void metadata_oops_do(Metadata** metadata_begin, Metadata **metadata_end, OopClosure* f) {
50 // Visit the metadata/oops section
51 for (Metadata** p = metadata_begin; p < metadata_end; p++) {
52 Metadata* m = *p;
53
54 intptr_t meta = (intptr_t)m;
55 if ((meta & 1) == 1) {
56 // already resolved
57 m = (Metadata*)(meta & ~1);
58 } else {
382 } else if (*_state_adr == not_used) {
383 print_on(tty, "made not used");
384 } else if (*_state_adr == in_use) {
385 print_on(tty, "made entrant");
386 }
387 }
388 }
389
390
391 NativeInstruction* PltNativeCallWrapper::get_load_instruction(virtual_call_Relocation* r) const {
392 return nativeLoadGot_at(_call->plt_load_got());
393 }
394
395 void PltNativeCallWrapper::verify_resolve_call(address dest) const {
396 CodeBlob* db = CodeCache::find_blob_unsafe(dest);
397 if (db == NULL) {
398 assert(dest == _call->plt_resolve_call(), "sanity");
399 }
400 }
401
402 void PltNativeCallWrapper::set_to_interpreted(const methodHandle& method, CompiledICInfo& info) {
403 assert(!info.to_aot(), "only for nmethod");
404 CompiledPltStaticCall* csc = CompiledPltStaticCall::at(instruction_address());
405 csc->set_to_interpreted(method, info.entry());
406 }
407
408 NativeCallWrapper* AOTCompiledMethod::call_wrapper_at(address call) const {
409 return new PltNativeCallWrapper((NativePltCall*) call);
410 }
411
412 NativeCallWrapper* AOTCompiledMethod::call_wrapper_before(address return_pc) const {
413 return new PltNativeCallWrapper(nativePltCall_before(return_pc));
414 }
415
416 CompiledStaticCall* AOTCompiledMethod::compiledStaticCall_at(Relocation* call_site) const {
417 return CompiledPltStaticCall::at(call_site);
418 }
419
420 CompiledStaticCall* AOTCompiledMethod::compiledStaticCall_at(address call_site) const {
421 return CompiledPltStaticCall::at(call_site);
422 }
|