annotate src/share/vm/graal/graalCompilerToVM.cpp @ 15784:fb530b9fa474

ResolvedJavaType.resolveMethod: fix javadoc, add assert in native code. update changelog
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 20 May 2014 13:13:28 +0200
parents 668d158f780c
children dffc37fa7157
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2516
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
1 /*
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
4 *
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
7 * published by the Free Software Foundation.
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
8 *
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
13 * accompanied this code).
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
14 *
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
15 * You should have received a copy of the GNU General Public License version
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
18 *
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
a384fac3fd34 Removed anything OSR-related.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2502
diff changeset
21 * questions.
1410
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
22 */
b30a2cd5e3a2 Added methods to c1x_VMExits.cpp
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1406
diff changeset
23
2045
9c96c873c42b Fix includes to match new hotspot mechanism.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1942
diff changeset
24 #include "precompiled.hpp"
15063
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
25 #include "code/scopeDesc.hpp"
6559
d5f7e737827f fixed compilation issues on Solaris. When using SunStudio compiler, Solaris build with DONT_USE_PRECOMPILED_HEADER
Laurent Daynes <Laurent.Daynes@oracle.com>
parents: 6549
diff changeset
26 #include "memory/oopFactory.hpp"
d5f7e737827f fixed compilation issues on Solaris. When using SunStudio compiler, Solaris build with DONT_USE_PRECOMPILED_HEADER
Laurent Daynes <Laurent.Daynes@oracle.com>
parents: 6549
diff changeset
27 #include "oops/generateOopMap.hpp"
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
28 #include "oops/fieldStreams.hpp"
12356
359f7e70ae7f Reduce HotSpot diff and fix previous merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11852
diff changeset
29 #include "runtime/fieldDescriptor.hpp"
6559
d5f7e737827f fixed compilation issues on Solaris. When using SunStudio compiler, Solaris build with DONT_USE_PRECOMPILED_HEADER
Laurent Daynes <Laurent.Daynes@oracle.com>
parents: 6549
diff changeset
30 #include "runtime/javaCalls.hpp"
7125
1baf7f1e3f23 decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents: 7094
diff changeset
31 #include "graal/graalRuntime.hpp"
3619
5e9645341ec3 support for new RiRuntime features: add code without making it the default for the method, executing Java tasks on the compile thread, communicate nmethod reference to Java code as HotSpotCompiledMethod
Lukas Stadler <lukas.stadler@jku.at>
parents: 3587
diff changeset
32 #include "compiler/compileBroker.hpp"
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
33 #include "compiler/compilerOracle.hpp"
7735
a7a93887b4c4 fix Solaris build and initial SPARC support
twisti
parents: 7569
diff changeset
34 #include "compiler/disassembler.hpp"
4222
8e2985cdaaa5 Renaming of VMExits and VMEntries part 3.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4220
diff changeset
35 #include "graal/graalCompilerToVM.hpp"
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
36 #include "graal/graalCompiler.hpp"
3637
ff6a991c6e3c Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3636
diff changeset
37 #include "graal/graalEnv.hpp"
2891
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
38 #include "graal/graalJavaAccess.hpp"
75a99b4f1c98 Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 2890
diff changeset
39 #include "graal/graalCodeInstaller.hpp"
4222
8e2985cdaaa5 Renaming of VMExits and VMEntries part 3.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4220
diff changeset
40 #include "graal/graalVMToCompiler.hpp"
8490
1567c6cc6561 Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8489
diff changeset
41 #include "gc_implementation/g1/heapRegion.hpp"
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12535
diff changeset
42 #include "runtime/javaCalls.hpp"
15063
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
43 #include "runtime/deoptimization.hpp"
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
44 #include "runtime/vframe.hpp"
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
45 #include "runtime/vframe_hp.hpp"
12559
ae412befde21 read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents: 12535
diff changeset
46 #include "runtime/vmStructs.hpp"
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13796
diff changeset
47 #include "runtime/gpu.hpp"
6559
d5f7e737827f fixed compilation issues on Solaris. When using SunStudio compiler, Solaris build with DONT_USE_PRECOMPILED_HEADER
Laurent Daynes <Laurent.Daynes@oracle.com>
parents: 6549
diff changeset
48
1414
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
49
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
50 // Entry to native method implementation that transitions current thread to '_thread_in_vm'.
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
51 #define C2V_VMENTRY(result_type, name, signature) \
6588
b89b5038ad7e removed _'s from method names in CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 6559
diff changeset
52 JNIEXPORT result_type JNICALL c2v_ ## name signature { \
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
53 TRACE_graal_3("CompilerToVM::" #name); \
7126
ce248dc0a656 removed all Graal modifications to ci and c1
Doug Simon <doug.simon@oracle.com>
parents: 7125
diff changeset
54 GRAAL_VM_ENTRY_MARK; \
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
55
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
56 // Entry to native method implementation that calls a JNI function
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
57 // and hence cannot transition current thread to '_thread_in_vm'.
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
58 #define C2V_ENTRY(result_type, name, signature) \
6588
b89b5038ad7e removed _'s from method names in CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 6559
diff changeset
59 JNIEXPORT result_type JNICALL c2v_ ## name signature { \
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
60 TRACE_graal_3("CompilerToVM::" #name); \
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
61
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
62 #define C2V_END }
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
63
14106
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
64 extern "C" {
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
65 extern VMStructEntry* gHotSpotVMStructs;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
66 extern uint64_t gHotSpotVMStructEntryTypeNameOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
67 extern uint64_t gHotSpotVMStructEntryFieldNameOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
68 extern uint64_t gHotSpotVMStructEntryTypeStringOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
69 extern uint64_t gHotSpotVMStructEntryIsStaticOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
70 extern uint64_t gHotSpotVMStructEntryOffsetOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
71 extern uint64_t gHotSpotVMStructEntryAddressOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
72 extern uint64_t gHotSpotVMStructEntryArrayStride;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
73
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
74 extern VMTypeEntry* gHotSpotVMTypes;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
75 extern uint64_t gHotSpotVMTypeEntryTypeNameOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
76 extern uint64_t gHotSpotVMTypeEntrySuperclassNameOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
77 extern uint64_t gHotSpotVMTypeEntryIsOopTypeOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
78 extern uint64_t gHotSpotVMTypeEntryIsIntegerTypeOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
79 extern uint64_t gHotSpotVMTypeEntryIsUnsignedOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
80 extern uint64_t gHotSpotVMTypeEntrySizeOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
81 extern uint64_t gHotSpotVMTypeEntryArrayStride;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
82
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
83 extern VMIntConstantEntry* gHotSpotVMIntConstants;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
84 extern uint64_t gHotSpotVMIntConstantEntryNameOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
85 extern uint64_t gHotSpotVMIntConstantEntryValueOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
86 extern uint64_t gHotSpotVMIntConstantEntryArrayStride;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
87
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
88 extern VMLongConstantEntry* gHotSpotVMLongConstants;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
89 extern uint64_t gHotSpotVMLongConstantEntryNameOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
90 extern uint64_t gHotSpotVMLongConstantEntryValueOffset;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
91 extern uint64_t gHotSpotVMLongConstantEntryArrayStride;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
92 }
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
93
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
94 // helpers used to set fields in the HotSpotVMConfig object
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
95 static jfieldID getFieldID(JNIEnv* env, jobject obj, const char* name, const char* sig) {
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
96 jfieldID id = env->GetFieldID(env->GetObjectClass(obj), name, sig);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
97 if (id == NULL) {
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
98 fatal(err_msg("field not found: %s (%s)", name, sig));
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
99 }
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
100 return id;
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
101 }
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
102
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
103 C2V_ENTRY(void, initializeConfiguration, (JNIEnv *env, jobject, jobject config))
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
104
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
105 #define set_boolean(name, value) do { env->SetBooleanField(config, getFieldID(env, config, name, "Z"), value); } while (0)
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
106 #define set_int(name, value) do { env->SetIntField(config, getFieldID(env, config, name, "I"), value); } while (0)
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
107 #define set_long(name, value) do { env->SetLongField(config, getFieldID(env, config, name, "J"), value); } while (0)
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
108 #define set_address(name, value) do { set_long(name, (jlong) value); } while (0)
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
109
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
110 guarantee(HeapWordSize == sizeof(char*), "Graal assumption that HeadWordSize == machine word size is wrong");
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
111
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
112 set_address("gHotSpotVMStructs", gHotSpotVMStructs);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
113 set_long("gHotSpotVMStructEntryTypeNameOffset", gHotSpotVMStructEntryTypeNameOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
114 set_long("gHotSpotVMStructEntryFieldNameOffset", gHotSpotVMStructEntryFieldNameOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
115 set_long("gHotSpotVMStructEntryTypeStringOffset", gHotSpotVMStructEntryTypeStringOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
116 set_long("gHotSpotVMStructEntryIsStaticOffset", gHotSpotVMStructEntryIsStaticOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
117 set_long("gHotSpotVMStructEntryOffsetOffset", gHotSpotVMStructEntryOffsetOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
118 set_long("gHotSpotVMStructEntryAddressOffset", gHotSpotVMStructEntryAddressOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
119 set_long("gHotSpotVMStructEntryArrayStride", gHotSpotVMStructEntryArrayStride);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
120
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
121 set_address("gHotSpotVMTypes", gHotSpotVMTypes);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
122 set_long("gHotSpotVMTypeEntryTypeNameOffset", gHotSpotVMTypeEntryTypeNameOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
123 set_long("gHotSpotVMTypeEntrySuperclassNameOffset", gHotSpotVMTypeEntrySuperclassNameOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
124 set_long("gHotSpotVMTypeEntryIsOopTypeOffset", gHotSpotVMTypeEntryIsOopTypeOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
125 set_long("gHotSpotVMTypeEntryIsIntegerTypeOffset", gHotSpotVMTypeEntryIsIntegerTypeOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
126 set_long("gHotSpotVMTypeEntryIsUnsignedOffset", gHotSpotVMTypeEntryIsUnsignedOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
127 set_long("gHotSpotVMTypeEntrySizeOffset", gHotSpotVMTypeEntrySizeOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
128 set_long("gHotSpotVMTypeEntryArrayStride", gHotSpotVMTypeEntryArrayStride);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
129
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
130 set_address("gHotSpotVMIntConstants", gHotSpotVMIntConstants);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
131 set_long("gHotSpotVMIntConstantEntryNameOffset", gHotSpotVMIntConstantEntryNameOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
132 set_long("gHotSpotVMIntConstantEntryValueOffset", gHotSpotVMIntConstantEntryValueOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
133 set_long("gHotSpotVMIntConstantEntryArrayStride", gHotSpotVMIntConstantEntryArrayStride);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
134
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
135 set_address("gHotSpotVMLongConstants", gHotSpotVMLongConstants);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
136 set_long("gHotSpotVMLongConstantEntryNameOffset", gHotSpotVMLongConstantEntryNameOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
137 set_long("gHotSpotVMLongConstantEntryValueOffset", gHotSpotVMLongConstantEntryValueOffset);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
138 set_long("gHotSpotVMLongConstantEntryArrayStride", gHotSpotVMLongConstantEntryArrayStride);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
139
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
140 //------------------------------------------------------------------------------------------------
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
141
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
142 set_int("arrayLengthOffset", arrayOopDesc::length_offset_in_bytes());
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
143
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
144 set_int("extraStackEntries", Method::extra_stack_entries());
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
145
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
146 set_int("tlabAlignmentReserve", (int32_t)ThreadLocalAllocBuffer::alignment_reserve());
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
147 set_long("heapTopAddress", (jlong)(address) Universe::heap()->top_addr());
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
148 set_long("heapEndAddress", (jlong)(address) Universe::heap()->end_addr());
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
149
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
150 set_boolean("inlineContiguousAllocationSupported", !CMSIncrementalMode && Universe::heap()->supports_inline_contig_alloc());
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
151
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
152 set_long("verifyOopMask", Universe::verify_oop_mask());
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
153 set_long("verifyOopBits", Universe::verify_oop_bits());
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
154
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
155 set_int("instanceKlassVtableStartOffset", InstanceKlass::vtable_start_offset() * HeapWordSize);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
156
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
157 //------------------------------------------------------------------------------------------------
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
158
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
159 set_address("registerFinalizerAddress", SharedRuntime::register_finalizer);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
160 set_address("exceptionHandlerForReturnAddressAddress", SharedRuntime::exception_handler_for_return_address);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
161 set_address("osrMigrationEndAddress", SharedRuntime::OSR_migration_end);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
162
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
163 set_address("javaTimeMillisAddress", CAST_FROM_FN_PTR(address, os::javaTimeMillis));
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
164 set_address("javaTimeNanosAddress", CAST_FROM_FN_PTR(address, os::javaTimeNanos));
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
165 set_address("arithmeticSinAddress", CAST_FROM_FN_PTR(address, SharedRuntime::dsin));
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
166 set_address("arithmeticCosAddress", CAST_FROM_FN_PTR(address, SharedRuntime::dcos));
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
167 set_address("arithmeticTanAddress", CAST_FROM_FN_PTR(address, SharedRuntime::dtan));
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
168
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
169 set_address("newInstanceAddress", GraalRuntime::new_instance);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
170 set_address("newArrayAddress", GraalRuntime::new_array);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
171 set_address("newMultiArrayAddress", GraalRuntime::new_multi_array);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
172 set_address("dynamicNewArrayAddress", GraalRuntime::dynamic_new_array);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
173 set_address("dynamicNewInstanceAddress", GraalRuntime::dynamic_new_instance);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
174 set_address("threadIsInterruptedAddress", GraalRuntime::thread_is_interrupted);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
175 set_address("vmMessageAddress", GraalRuntime::vm_message);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
176 set_address("identityHashCodeAddress", GraalRuntime::identity_hash_code);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
177 set_address("exceptionHandlerForPcAddress", GraalRuntime::exception_handler_for_pc);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
178 set_address("monitorenterAddress", GraalRuntime::monitorenter);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
179 set_address("monitorexitAddress", GraalRuntime::monitorexit);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
180 set_address("createNullPointerExceptionAddress", GraalRuntime::create_null_exception);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
181 set_address("createOutOfBoundsExceptionAddress", GraalRuntime::create_out_of_bounds_exception);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
182 set_address("logPrimitiveAddress", GraalRuntime::log_primitive);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
183 set_address("logObjectAddress", GraalRuntime::log_object);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
184 set_address("logPrintfAddress", GraalRuntime::log_printf);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
185 set_address("vmErrorAddress", GraalRuntime::vm_error);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
186 set_address("loadAndClearExceptionAddress", GraalRuntime::load_and_clear_exception);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
187 set_address("writeBarrierPreAddress", GraalRuntime::write_barrier_pre);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
188 set_address("writeBarrierPostAddress", GraalRuntime::write_barrier_post);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
189 set_address("validateObject", GraalRuntime::validate_object);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
190
15104
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15092
diff changeset
191 set_address("deoptimizationFetchUnrollInfo", Deoptimization::fetch_unroll_info);
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15092
diff changeset
192 set_address("deoptimizationUncommonTrap", Deoptimization::uncommon_trap);
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15092
diff changeset
193 set_address("deoptimizationUnpackFrames", Deoptimization::unpack_frames);
ed29f7ff71eb add DeoptimizationStub
twisti
parents: 15092
diff changeset
194
14106
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
195 //------------------------------------------------------------------------------------------------
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
196
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
197 set_int("graalCountersThreadOffset", in_bytes(JavaThread::graal_counters_offset()));
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
198 set_int("graalCountersSize", (jint) GraalCounterSize);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
199
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
200 //------------------------------------------------------------------------------------------------
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
201
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
202 set_long("dllLoad", (jlong) os::dll_load);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
203 set_long("dllLookup", (jlong) os::dll_lookup);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
204 #if defined(TARGET_OS_FAMILY_bsd) || defined(TARGET_OS_FAMILY_linux)
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
205 set_long("rtldDefault", (jlong) RTLD_DEFAULT);
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
206 #endif
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
207
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
208 #undef set_boolean
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
209 #undef set_int
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
210 #undef set_long
15161
2c940b1a48d8 Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15104
diff changeset
211 #undef set_address
14106
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
212
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
213 C2V_END
ca37cb080dad reorganized graalCompilerToVM.cpp
twisti
parents: 14105
diff changeset
214
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
215 C2V_ENTRY(jbyteArray, initializeBytecode, (JNIEnv *env, jobject, jlong metaspace_method, jbyteArray result))
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
216 methodHandle method = asMethod(metaspace_method);
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
217 ResourceMark rm;
8945
7ef66078d837 add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents: 8613
diff changeset
218
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
219 int code_size = method->code_size();
11513
8d4e5e08d83f Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11381
diff changeset
220 jbyte* reconstituted_code = NEW_RESOURCE_ARRAY(jbyte, code_size);
8d4e5e08d83f Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11381
diff changeset
221
11519
a3b39ab7c453 Make is_rewritten a guarantee in initializeBytecode
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11513
diff changeset
222 guarantee(method->method_holder()->is_rewritten(), "Method's holder should be rewritten");
11513
8d4e5e08d83f Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11381
diff changeset
223 // iterate over all bytecodes and replace non-Java bytecodes
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
224
11513
8d4e5e08d83f Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11381
diff changeset
225 for (BytecodeStream s(method); s.next() != Bytecodes::_illegal; ) {
8d4e5e08d83f Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11381
diff changeset
226 Bytecodes::Code code = s.code();
8d4e5e08d83f Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11381
diff changeset
227 Bytecodes::Code raw_code = s.raw_code();
8d4e5e08d83f Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11381
diff changeset
228 int bci = s.bci();
8d4e5e08d83f Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11381
diff changeset
229 int len = s.instruction_size();
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
230
11513
8d4e5e08d83f Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11381
diff changeset
231 // Restore original byte code.
8d4e5e08d83f Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11381
diff changeset
232 reconstituted_code[bci] = (jbyte) (s.is_wide()? Bytecodes::_wide : code);
8d4e5e08d83f Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11381
diff changeset
233 if (len > 1) {
8d4e5e08d83f Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11381
diff changeset
234 memcpy(&reconstituted_code[bci+1], s.bcp()+1, len-1);
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
235 }
10567
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
236
11519
a3b39ab7c453 Make is_rewritten a guarantee in initializeBytecode
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11513
diff changeset
237 if (len > 1) {
10567
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
238 // Restore the big-endian constant pool indexes.
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
239 // Cf. Rewriter::scan_method
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
240 switch (code) {
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
241 case Bytecodes::_getstatic:
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
242 case Bytecodes::_putstatic:
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
243 case Bytecodes::_getfield:
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
244 case Bytecodes::_putfield:
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
245 case Bytecodes::_invokevirtual:
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
246 case Bytecodes::_invokespecial:
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
247 case Bytecodes::_invokestatic:
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
248 case Bytecodes::_invokeinterface:
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
249 case Bytecodes::_invokehandle: {
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
250 int cp_index = Bytes::get_native_u2((address) &reconstituted_code[bci + 1]);
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
251 Bytes::put_Java_u2((address) &reconstituted_code[bci + 1], (u2) cp_index);
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
252 break;
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
253 }
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
254
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
255 case Bytecodes::_invokedynamic:
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
256 int cp_index = Bytes::get_native_u4((address) &reconstituted_code[bci + 1]);
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
257 Bytes::put_Java_u4((address) &reconstituted_code[bci + 1], (u4) cp_index);
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
258 break;
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
259 }
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
260
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
261 // Not all ldc byte code are rewritten.
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
262 switch (raw_code) {
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
263 case Bytecodes::_fast_aldc: {
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
264 int cpc_index = reconstituted_code[bci + 1] & 0xff;
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
265 int cp_index = method->constants()->object_to_cp_index(cpc_index);
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
266 assert(cp_index < method->constants()->length(), "sanity check");
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
267 reconstituted_code[bci + 1] = (jbyte) cp_index;
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
268 break;
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
269 }
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
270
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
271 case Bytecodes::_fast_aldc_w: {
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
272 int cpc_index = Bytes::get_native_u2((address) &reconstituted_code[bci + 1]);
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
273 int cp_index = method->constants()->object_to_cp_index(cpc_index);
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
274 assert(cp_index < method->constants()->length(), "sanity check");
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
275 Bytes::put_Java_u2((address) &reconstituted_code[bci + 1], (u2) cp_index);
7cd21876c116 Revert bytecode indexes back to Java endianess.
twisti
parents: 10542
diff changeset
276 break;
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
277 }
5154
ae72dd38eeb1 bugfix, parallel GC seems stable
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5150
diff changeset
278 }
5150
fdd9dd4508fa some GC fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5130
diff changeset
279 }
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
280 }
5150
fdd9dd4508fa some GC fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5130
diff changeset
281
11513
8d4e5e08d83f Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 11381
diff changeset
282 env->SetByteArrayRegion(result, 0, code_size, reconstituted_code);
5150
fdd9dd4508fa some GC fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents: 5130
diff changeset
283
1413
1ecc8f0aad00 Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1412
diff changeset
284 return result;
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
285 C2V_END
1414
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
286
14105
f62c770c22be make HotSpotResolvedJavaMethod leaner
twisti
parents: 14104
diff changeset
287 C2V_VMENTRY(jint, exceptionTableLength, (JNIEnv *, jobject, jlong metaspace_method))
f62c770c22be make HotSpotResolvedJavaMethod leaner
twisti
parents: 14104
diff changeset
288 ResourceMark rm;
f62c770c22be make HotSpotResolvedJavaMethod leaner
twisti
parents: 14104
diff changeset
289 methodHandle method = asMethod(metaspace_method);
f62c770c22be make HotSpotResolvedJavaMethod leaner
twisti
parents: 14104
diff changeset
290 return method->exception_table_length();
f62c770c22be make HotSpotResolvedJavaMethod leaner
twisti
parents: 14104
diff changeset
291 C2V_END
f62c770c22be make HotSpotResolvedJavaMethod leaner
twisti
parents: 14104
diff changeset
292
13305
a63d65b682a8 moved most HotSpotResolvedJavaMethod.getExceptionHandlers logic to Java
twisti
parents: 13295
diff changeset
293 C2V_VMENTRY(jlong, exceptionTableStart, (JNIEnv *, jobject, jlong metaspace_method))
3650
0e8a2a629afb Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3649
diff changeset
294 ResourceMark rm;
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
295 methodHandle method = asMethod(metaspace_method);
13305
a63d65b682a8 moved most HotSpotResolvedJavaMethod.getExceptionHandlers logic to Java
twisti
parents: 13295
diff changeset
296 assert(method->exception_table_length() != 0, "should be handled in Java code");
a63d65b682a8 moved most HotSpotResolvedJavaMethod.getExceptionHandlers logic to Java
twisti
parents: 13295
diff changeset
297 return (jlong) (address) method->exception_table_start();
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
298 C2V_END
1429
abc670a709dc * -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1428
diff changeset
299
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
300 C2V_VMENTRY(jint, hasBalancedMonitors, (JNIEnv *, jobject, jlong metaspace_method))
3559
f70a4cc629e7 remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 3555
diff changeset
301 // Analyze the method to see if monitors are used properly.
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
302 methodHandle method(THREAD, asMethod(metaspace_method));
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
303 {
3559
f70a4cc629e7 remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 3555
diff changeset
304 EXCEPTION_MARK;
f70a4cc629e7 remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 3555
diff changeset
305 ResourceMark rm(THREAD);
f70a4cc629e7 remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 3555
diff changeset
306 GeneratePairingInfo gpi(method);
f70a4cc629e7 remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 3555
diff changeset
307 gpi.compute_map(CATCH);
f70a4cc629e7 remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 3555
diff changeset
308 if (!gpi.monitor_safe()) {
f70a4cc629e7 remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 3555
diff changeset
309 return false;
f70a4cc629e7 remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 3555
diff changeset
310 }
f70a4cc629e7 remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 3555
diff changeset
311 method->set_guaranteed_monitor_matching();
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
312 }
3559
f70a4cc629e7 remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents: 3555
diff changeset
313 return true;
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
314 C2V_END
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1432
diff changeset
315
13264
b23cbfb4366a merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents: 13263
diff changeset
316 C2V_VMENTRY(jlong, getMetaspaceMethod, (JNIEnv *, jobject, jclass holder_handle, jint slot))
b23cbfb4366a merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents: 13263
diff changeset
317 oop java_class = JNIHandles::resolve(holder_handle);
b23cbfb4366a merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents: 13263
diff changeset
318 Klass* holder = java_lang_Class::as_Klass(java_class);
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
319 methodHandle method = InstanceKlass::cast(holder)->method_with_idnum(slot);
7044
34753b057324 added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents: 7037
diff changeset
320 return (jlong) (address) method();
34753b057324 added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents: 7037
diff changeset
321 }
34753b057324 added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents: 7037
diff changeset
322
13373
430c9f08728d moved most CompilerToVM.getUniqueConcreteMethod logic up to Java and replace getUniqueConcreteMethod with findUniqueConcreteMethod
twisti
parents: 13364
diff changeset
323 C2V_VMENTRY(jlong, findUniqueConcreteMethod, (JNIEnv *, jobject, jlong metaspace_method))
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
324 methodHandle method = asMethod(metaspace_method);
3653
6aef50c6d967 Handlize to fix GC issue.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3650
diff changeset
325 KlassHandle holder = method->method_holder();
13373
430c9f08728d moved most CompilerToVM.getUniqueConcreteMethod logic up to Java and replace getUniqueConcreteMethod with findUniqueConcreteMethod
twisti
parents: 13364
diff changeset
326 assert(!holder->is_interface(), "should be handled in Java code");
430c9f08728d moved most CompilerToVM.getUniqueConcreteMethod logic up to Java and replace getUniqueConcreteMethod with findUniqueConcreteMethod
twisti
parents: 13364
diff changeset
327 ResourceMark rm;
430c9f08728d moved most CompilerToVM.getUniqueConcreteMethod logic up to Java and replace getUniqueConcreteMethod with findUniqueConcreteMethod
twisti
parents: 13364
diff changeset
328 MutexLocker locker(Compile_lock);
430c9f08728d moved most CompilerToVM.getUniqueConcreteMethod logic up to Java and replace getUniqueConcreteMethod with findUniqueConcreteMethod
twisti
parents: 13364
diff changeset
329 Method* ucm = Dependencies::find_unique_concrete_method(holder(), method());
430c9f08728d moved most CompilerToVM.getUniqueConcreteMethod logic up to Java and replace getUniqueConcreteMethod with findUniqueConcreteMethod
twisti
parents: 13364
diff changeset
330 return (jlong) (address) ucm;
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
331 C2V_END
2049
7e09ea4a8f36 Added leaf method assumptions.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2048
diff changeset
332
13478
fe03864a2c72 replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents: 13461
diff changeset
333 C2V_VMENTRY(jlong, getKlassImplementor, (JNIEnv *, jobject, jlong metaspace_klass))
fe03864a2c72 replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents: 13461
diff changeset
334 InstanceKlass* klass = (InstanceKlass*) asKlass(metaspace_klass);
fe03864a2c72 replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents: 13461
diff changeset
335 return (jlong) (address) klass->implementor();
7226
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7225 7154
diff changeset
336 C2V_END
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7225 7154
diff changeset
337
14717
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14545
diff changeset
338 C2V_VMENTRY(jboolean, methodIsIgnoredBySecurityStackWalk,(JNIEnv *, jobject, jlong metaspace_method))
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
339 methodHandle method = asMethod(metaspace_method);
14717
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14545
diff changeset
340 return method->is_ignored_by_security_stack_walk();
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
341 C2V_END
2926
0e3ec0a4eda4 RiTypeProfile information and invocation counters for RiMethods
Lukas Stadler <lukas.stadler@jku.at>
parents: 2901
diff changeset
342
13953
d587baa55dd7 Add shouldBeInlined method to ResolvedJavaMethod, implement it for HotSpot and use it in the inlining phase
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13895
diff changeset
343 C2V_VMENTRY(jboolean, canInlineMethod,(JNIEnv *, jobject, jlong metaspace_method))
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6948
diff changeset
344 methodHandle method = asMethod(metaspace_method);
13953
d587baa55dd7 Add shouldBeInlined method to ResolvedJavaMethod, implement it for HotSpot and use it in the inlining phase
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13895
diff changeset
345 return !method->is_not_compilable() && !CompilerOracle::should_not_inline(method) && !method->dont_inline();
d587baa55dd7 Add shouldBeInlined method to ResolvedJavaMethod, implement it for HotSpot and use it in the inlining phase
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13895
diff changeset
346 C2V_END
d587baa55dd7 Add shouldBeInlined method to ResolvedJavaMethod, implement it for HotSpot and use it in the inlining phase
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13895
diff changeset
347
d587baa55dd7 Add shouldBeInlined method to ResolvedJavaMethod, implement it for HotSpot and use it in the inlining phase
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13895
diff changeset
348 C2V_VMENTRY(jboolean, shouldInlineMethod,(JNIEnv *, jobject, jlong metaspace_method))
d587baa55dd7 Add shouldBeInlined method to ResolvedJavaMethod, implement it for HotSpot and use it in the inlining phase
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13895
diff changeset
349 methodHandle method = asMethod(metaspace_method);
d587baa55dd7 Add shouldBeInlined method to ResolvedJavaMethod, implement it for HotSpot and use it in the inlining phase
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13895
diff changeset
350 return CompilerOracle::should_inline(method) || method->force_inline();
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
351 C2V_END
4441
4e3aaf14cbc6 fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4439
diff changeset
352
14117
2b2f0022900f removed unnecessary lookupKlassByName method
Doug Simon <doug.simon@oracle.com>
parents: 14107
diff changeset
353 C2V_VMENTRY(jlong, lookupType, (JNIEnv *env, jobject, jstring jname, jclass accessing_class, jboolean resolve))
3650
0e8a2a629afb Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3649
diff changeset
354 ResourceMark rm;
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
355 Handle name = JNIHandles::resolve(jname);
13483
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13479
diff changeset
356 Symbol* class_name = java_lang_String::as_symbol(name, THREAD);
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13479
diff changeset
357 assert(class_name != NULL, "name to symbol creation failed");
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13479
diff changeset
358 assert(class_name->size() > 1, "primitive types should be handled in Java code");
1414
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
359
13483
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13479
diff changeset
360 Klass* resolved_klass = NULL;
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13479
diff changeset
361 Handle class_loader;
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13479
diff changeset
362 Handle protection_domain;
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13479
diff changeset
363 if (JNIHandles::resolve(accessing_class) != NULL) {
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13479
diff changeset
364 Klass* accessing_klass = java_lang_Class::as_Klass(JNIHandles::resolve(accessing_class));
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13479
diff changeset
365 class_loader = accessing_klass->class_loader();
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13479
diff changeset
366 protection_domain = accessing_klass->protection_domain();
13258
fdd6ef90d66d move HotSpotResolvedPrimitiveType's from VMToCompilerImpl to HotSpotGraalRuntime
twisti
parents: 13254
diff changeset
367 }
fdd6ef90d66d move HotSpotResolvedPrimitiveType's from VMToCompilerImpl to HotSpotGraalRuntime
twisti
parents: 13254
diff changeset
368
14117
2b2f0022900f removed unnecessary lookupKlassByName method
Doug Simon <doug.simon@oracle.com>
parents: 14107
diff changeset
369 if (resolve) {
13483
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13479
diff changeset
370 resolved_klass = SystemDictionary::resolve_or_fail(class_name, class_loader, protection_domain, true, THREAD);
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
371 } else {
13483
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13479
diff changeset
372 resolved_klass = SystemDictionary::resolve_or_null(class_name, class_loader, protection_domain, THREAD);
13258
fdd6ef90d66d move HotSpotResolvedPrimitiveType's from VMToCompilerImpl to HotSpotGraalRuntime
twisti
parents: 13254
diff changeset
373 }
7027
58dbea9fb973 CompilerToVM.lookupType() now fails with an exception if eagerResolve is true and resolution fails
Doug Simon <doug.simon@oracle.com>
parents: 7019
diff changeset
374
13483
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13479
diff changeset
375 return (jlong) (address) resolved_klass;
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
376 C2V_END
1414
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
377
14529
82c3b54d1f08 added HotSpotConstantPool.JVM_CONSTANT enum
twisti
parents: 14172
diff changeset
378 C2V_VMENTRY(jobject, resolveConstantInPool, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index))
13259
b16fb0b7479b every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents: 13258
diff changeset
379 ConstantPool* cp = (ConstantPool*) metaspace_constant_pool;
14529
82c3b54d1f08 added HotSpotConstantPool.JVM_CONSTANT enum
twisti
parents: 14172
diff changeset
380 oop result = cp->resolve_constant_at(index, CHECK_NULL);
82c3b54d1f08 added HotSpotConstantPool.JVM_CONSTANT enum
twisti
parents: 14172
diff changeset
381 return JNIHandles::make_local(THREAD, result);
82c3b54d1f08 added HotSpotConstantPool.JVM_CONSTANT enum
twisti
parents: 14172
diff changeset
382 C2V_END
82c3b54d1f08 added HotSpotConstantPool.JVM_CONSTANT enum
twisti
parents: 14172
diff changeset
383
82c3b54d1f08 added HotSpotConstantPool.JVM_CONSTANT enum
twisti
parents: 14172
diff changeset
384 C2V_VMENTRY(jobject, resolvePossiblyCachedConstantInPool, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index))
82c3b54d1f08 added HotSpotConstantPool.JVM_CONSTANT enum
twisti
parents: 14172
diff changeset
385 ConstantPool* cp = (ConstantPool*) metaspace_constant_pool;
82c3b54d1f08 added HotSpotConstantPool.JVM_CONSTANT enum
twisti
parents: 14172
diff changeset
386 oop result = cp->resolve_possibly_cached_constant_at(index, CHECK_NULL);
1414
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
387 return JNIHandles::make_local(THREAD, result);
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
388 C2V_END
1414
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
389
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
390 C2V_VMENTRY(jint, lookupNameAndTypeRefIndexInPool, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index))
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
391 constantPoolHandle cp = (ConstantPool*) metaspace_constant_pool;
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
392 return cp->name_and_type_ref_index_at(index);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
393 C2V_END
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
394
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
395 C2V_VMENTRY(jlong, lookupNameRefInPool, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index))
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
396 constantPoolHandle cp = (ConstantPool*) metaspace_constant_pool;
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
397 return (jlong) (address) cp->name_ref_at(index);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
398 C2V_END
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
399
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
400 C2V_VMENTRY(jlong, lookupSignatureRefInPool, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index))
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
401 constantPoolHandle cp = (ConstantPool*) metaspace_constant_pool;
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
402 return (jlong) (address) cp->signature_ref_at(index);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
403 C2V_END
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
404
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
405 C2V_VMENTRY(jint, lookupKlassRefIndexInPool, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index))
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
406 constantPoolHandle cp = (ConstantPool*) metaspace_constant_pool;
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
407 return cp->klass_ref_index_at(index);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
408 C2V_END
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
409
14530
d87b84dade7d moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents: 14529
diff changeset
410 C2V_VMENTRY(jlong, constantPoolKlassAt, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index))
d87b84dade7d moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents: 14529
diff changeset
411 ConstantPool* cp = (ConstantPool*) metaspace_constant_pool;
d87b84dade7d moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents: 14529
diff changeset
412 return (jlong) (address) cp->klass_at(index, THREAD);
d87b84dade7d moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents: 14529
diff changeset
413 C2V_END
d87b84dade7d moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents: 14529
diff changeset
414
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
415 C2V_VMENTRY(jlong, lookupKlassInPool, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index, jbyte opcode))
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
416 constantPoolHandle cp = (ConstantPool*) metaspace_constant_pool;
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
417 KlassHandle loading_klass(cp->pool_holder());
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
418 bool is_accessible = false;
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
419 KlassHandle klass = GraalEnv::get_klass_by_index(cp, index, is_accessible, loading_klass);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
420 if (klass.is_null()) {
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
421 // We have to lock the cpool to keep the oop from being resolved
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
422 // while we are accessing it.
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
423 MonitorLockerEx ml(cp->lock());
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
424 constantTag tag = cp->tag_at(index);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
425 if (tag.is_klass()) {
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
426 // The klass has been inserted into the constant pool
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
427 // very recently.
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
428 return (jlong) CompilerToVM::tag_pointer(cp->resolved_klass_at(index));
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
429 } else if (tag.is_symbol()) {
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
430 return (jlong) CompilerToVM::tag_pointer(cp->symbol_at(index));
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
431 } else {
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
432 assert(cp->tag_at(index).is_unresolved_klass(), "wrong tag");
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
433 return (jlong) CompilerToVM::tag_pointer(cp->unresolved_klass_at(index));
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
434 }
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
435 }
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
436 return (jlong) CompilerToVM::tag_pointer(klass());
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
437 C2V_END
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
438
14052
361acb279104 moved to-constant-pool-index conversion up to Java
twisti
parents: 14012
diff changeset
439 C2V_VMENTRY(jobject, lookupAppendixInPool, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index))
13259
b16fb0b7479b every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents: 13258
diff changeset
440 constantPoolHandle cp = (ConstantPool*) metaspace_constant_pool;
b16fb0b7479b every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents: 13258
diff changeset
441 oop appendix_oop = ConstantPool::appendix_at_if_loaded(cp, index);
8945
7ef66078d837 add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents: 8613
diff changeset
442 return JNIHandles::make_local(THREAD, appendix_oop);
7ef66078d837 add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents: 8613
diff changeset
443 C2V_END
7ef66078d837 add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents: 8613
diff changeset
444
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
445 C2V_VMENTRY(jlong, lookupMethodInPool, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index, jbyte opcode))
13259
b16fb0b7479b every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents: 13258
diff changeset
446 constantPoolHandle cp = (ConstantPool*) metaspace_constant_pool;
3670
f198b24093f3 put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3669
diff changeset
447 instanceKlassHandle pool_holder(cp->pool_holder());
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
448 Bytecodes::Code bc = (Bytecodes::Code) (((int) opcode) & 0xFF);
14052
361acb279104 moved to-constant-pool-index conversion up to Java
twisti
parents: 14012
diff changeset
449 methodHandle method = GraalEnv::get_method_by_index(cp, index, bc, pool_holder);
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
450 return (jlong) (address) method();
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
451 C2V_END
1414
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
452
14530
d87b84dade7d moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents: 14529
diff changeset
453 C2V_VMENTRY(jint, constantPoolRemapInstructionOperandFromCache, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index))
13259
b16fb0b7479b every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents: 13258
diff changeset
454 ConstantPool* cp = (ConstantPool*) metaspace_constant_pool;
14530
d87b84dade7d moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents: 14529
diff changeset
455 return cp->remap_instruction_operand_from_cache(index);
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
456 C2V_END
3577
96c40b338c1a Added new method that loads and initializes a class that is referenced by a cp entry.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3572
diff changeset
457
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
458 C2V_VMENTRY(jlong, resolveField, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index, jbyte opcode, jlongArray info_handle))
3650
0e8a2a629afb Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3649
diff changeset
459 ResourceMark rm;
13259
b16fb0b7479b every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents: 13258
diff changeset
460 constantPoolHandle cp = (ConstantPool*) metaspace_constant_pool;
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
461 Bytecodes::Code code = (Bytecodes::Code)(((int) opcode) & 0xFF);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
462 fieldDescriptor result;
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
463 LinkResolver::resolve_field_access(result, cp, index, Bytecodes::java_code(code), true, false, CHECK_0);
14069
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
464 typeArrayOop info = (typeArrayOop) JNIHandles::resolve(info_handle);
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
465 assert(info != NULL && info->length() == 2, "must be");
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
466 info->long_at_put(0, (jlong) result.access_flags().as_int());
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
467 info->long_at_put(1, (jlong) result.offset());
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
468 return (jlong) (address) result.field_holder();
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
469 C2V_END
1414
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
470
15725
ef6b8d1898e6 Add resolved receiver type to ResolvedJavaMethod.isInVirtualMethodTable in order to be able to do vtable-calls for miranda and default methods
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15722
diff changeset
471 C2V_VMENTRY(jint, getVtableIndexForInterface, (JNIEnv *, jobject, jlong metaspace_klass, jlong metaspace_method))
ef6b8d1898e6 Add resolved receiver type to ResolvedJavaMethod.isInVirtualMethodTable in order to be able to do vtable-calls for miranda and default methods
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15722
diff changeset
472 Klass* klass = (Klass*) metaspace_klass;
ef6b8d1898e6 Add resolved receiver type to ResolvedJavaMethod.isInVirtualMethodTable in order to be able to do vtable-calls for miranda and default methods
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15722
diff changeset
473 Method* method = (Method*) metaspace_method;
15784
fb530b9fa474 ResolvedJavaType.resolveMethod: fix javadoc, add assert in native code. update changelog
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15726
diff changeset
474 assert(!klass->is_interface(), "");
15725
ef6b8d1898e6 Add resolved receiver type to ResolvedJavaMethod.isInVirtualMethodTable in order to be able to do vtable-calls for miranda and default methods
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15722
diff changeset
475 return LinkResolver::vtable_index_of_interface_method(klass, method);
ef6b8d1898e6 Add resolved receiver type to ResolvedJavaMethod.isInVirtualMethodTable in order to be able to do vtable-calls for miranda and default methods
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15722
diff changeset
476 C2V_END
ef6b8d1898e6 Add resolved receiver type to ResolvedJavaMethod.isInVirtualMethodTable in order to be able to do vtable-calls for miranda and default methods
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15722
diff changeset
477
15722
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
478 C2V_VMENTRY(jlong, resolveMethod, (JNIEnv *, jobject, jlong metaspace_klass_receiver, jlong metaspace_method, jlong metaspace_klass_caller))
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
479 Klass* recv_klass = (Klass*) metaspace_klass_receiver;
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
480 Klass* caller_klass = (Klass*) metaspace_klass_caller;
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
481 Method* method = (Method*) metaspace_method;
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
482
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
483 if (recv_klass->oop_is_array() || (InstanceKlass::cast(recv_klass)->is_linked())) {
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
484 Klass* holder_klass = method->method_holder();
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
485 Symbol* method_name = method->name();
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
486 Symbol* method_signature = method->signature();
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
487
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
488
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
489 if (holder_klass->is_interface()) {
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
490 // do link-time resolution to check all access rules.
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
491 methodHandle resolved_method;
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
492 LinkResolver::linktime_resolve_interface_method(resolved_method, holder_klass, method_name, method_signature, caller_klass, true, CHECK_AND_CLEAR_0);
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
493 if (resolved_method->is_private()) {
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
494 return (jlong) NULL;
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
495 }
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
496 assert(recv_klass->is_subtype_of(holder_klass), "");
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
497 // do actual lookup
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
498 methodHandle sel_method;
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
499 LinkResolver::lookup_instance_method_in_klasses(sel_method, recv_klass,
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
500 resolved_method->name(),
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
501 resolved_method->signature(), CHECK_AND_CLEAR_0);
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
502 return (jlong) (address) sel_method();
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
503 } else {
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
504 // do link-time resolution to check all access rules.
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
505 methodHandle resolved_method;
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
506 LinkResolver::linktime_resolve_virtual_method(resolved_method, holder_klass, method_name, method_signature, caller_klass, true, CHECK_AND_CLEAR_0);
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
507 // do actual lookup (see LinkResolver::runtime_resolve_virtual_method)
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
508 int vtable_index = Method::invalid_vtable_index;
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
509 Method* selected_method;
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
510
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
511 if (resolved_method->method_holder()->is_interface()) { // miranda method
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
512 vtable_index = LinkResolver::vtable_index_of_interface_method(holder_klass, resolved_method);
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
513 assert(vtable_index >= 0 , "we should have valid vtable index at this point");
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
514
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
515 InstanceKlass* inst = InstanceKlass::cast(recv_klass);
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
516 selected_method = inst->method_at_vtable(vtable_index);
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
517 } else {
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
518 // at this point we are sure that resolved_method is virtual and not
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
519 // a miranda method; therefore, it must have a valid vtable index.
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
520 assert(!resolved_method->has_itable_index(), "");
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
521 vtable_index = resolved_method->vtable_index();
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
522 // We could get a negative vtable_index for final methods,
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
523 // because as an optimization they are they are never put in the vtable,
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
524 // unless they override an existing method.
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
525 // If we do get a negative, it means the resolved method is the the selected
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
526 // method, and it can never be changed by an override.
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
527 if (vtable_index == Method::nonvirtual_vtable_index) {
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
528 assert(resolved_method->can_be_statically_bound(), "cannot override this method");
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
529 selected_method = resolved_method();
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
530 } else {
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
531 // recv_klass might be an arrayKlassOop but all vtables start at
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
532 // the same place. The cast is to avoid virtual call and assertion.
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
533 InstanceKlass* inst = (InstanceKlass*)recv_klass;
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
534 selected_method = inst->method_at_vtable(vtable_index);
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
535 }
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
536 }
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
537 return (jlong) (address) selected_method;
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
538 }
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
539 }
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
540 return (jlong) NULL;
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
541 C2V_END
1414
e1a275dbc8cd Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1413
diff changeset
542
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
543 C2V_VMENTRY(jboolean, hasFinalizableSubclass,(JNIEnv *, jobject, jlong metaspace_klass))
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
544 Klass* klass = (Klass*) metaspace_klass;
9126
bc26f978b0ce HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
Bernhard Urban <bernhard.urban@jku.at>
parents: 9108
diff changeset
545 assert(klass != NULL, "method must not be called for primitive types");
bc26f978b0ce HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
Bernhard Urban <bernhard.urban@jku.at>
parents: 9108
diff changeset
546 return Dependencies::find_finalizable_subclass(klass) != NULL;
bc26f978b0ce HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
Bernhard Urban <bernhard.urban@jku.at>
parents: 9108
diff changeset
547 C2V_END
bc26f978b0ce HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
Bernhard Urban <bernhard.urban@jku.at>
parents: 9108
diff changeset
548
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
549 C2V_VMENTRY(jlong, getClassInitializer, (JNIEnv *, jobject, jlong metaspace_klass))
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
550 InstanceKlass* klass = (InstanceKlass*) metaspace_klass;
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
551 return (jlong) (address) klass->class_initializer();
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
552 C2V_END
3090
536528f48708 more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents: 3055
diff changeset
553
9649
dd62ccda1849 rename parameter
Doug Simon <doug.simon@oracle.com>
parents: 9610
diff changeset
554 C2V_VMENTRY(jlong, getMaxCallTargetOffset, (JNIEnv *env, jobject, jlong addr))
dd62ccda1849 rename parameter
Doug Simon <doug.simon@oracle.com>
parents: 9610
diff changeset
555 address target_addr = (address) addr;
3563
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3559
diff changeset
556 if (target_addr != 0x0) {
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3559
diff changeset
557 int64_t off_low = (int64_t)target_addr - ((int64_t)CodeCache::low_bound() + sizeof(int));
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3559
diff changeset
558 int64_t off_high = (int64_t)target_addr - ((int64_t)CodeCache::high_bound() + sizeof(int));
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3559
diff changeset
559 return MAX2(ABS(off_low), ABS(off_high));
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3559
diff changeset
560 }
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3559
diff changeset
561 return -1;
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
562 C2V_END
3563
8780fa370aab Support runtime calls to targets that don't fit in a 32-bit immediate: allow to query the maximum offset of a CiRuntimeCall target to determine the required immediate size and patch call sites with a mov/call instruction pair for indirect calls
Peter Hofer <peter.hofer@jku.at>
parents: 3559
diff changeset
563
12535
cee7f686c470 rename CompilerToVm.dontInline to doNotInlineOrCompile
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12533
diff changeset
564 C2V_VMENTRY(void, doNotInlineOrCompile,(JNIEnv *, jobject, jlong metaspace_method))
12532
9b1cc2628961 Extend the CompilerToVM interface to explicitly avoid compilation and inlining of methods
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12409
diff changeset
565 methodHandle method = asMethod(metaspace_method);
9b1cc2628961 Extend the CompilerToVM interface to explicitly avoid compilation and inlining of methods
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12409
diff changeset
566 method->set_not_c1_compilable();
9b1cc2628961 Extend the CompilerToVM interface to explicitly avoid compilation and inlining of methods
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12409
diff changeset
567 method->set_not_c2_compilable();
9b1cc2628961 Extend the CompilerToVM interface to explicitly avoid compilation and inlining of methods
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12409
diff changeset
568 method->set_dont_inline(true);
9b1cc2628961 Extend the CompilerToVM interface to explicitly avoid compilation and inlining of methods
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12409
diff changeset
569 C2V_END
9b1cc2628961 Extend the CompilerToVM interface to explicitly avoid compilation and inlining of methods
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12409
diff changeset
570
13641
5a9afbf72714 Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13630
diff changeset
571 C2V_VMENTRY(jint, installCode0, (JNIEnv *jniEnv, jobject, jobject compiled_code, jobject installed_code, jobject speculation_log))
3669
53636e2c9d03 No longer use shared ciFactory. Remove make_global usage in code installer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3667
diff changeset
572 ResourceMark rm;
3670
f198b24093f3 put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 3669
diff changeset
573 HandleMark hm;
9669
ed6202820ecf renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents: 9668
diff changeset
574 Handle compiled_code_handle = JNIHandles::resolve(compiled_code);
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
575 CodeBlob* cb = NULL;
7000
bf2ea3ed3bce Fixed nmethod not being unloaded after their classloader has been unloaded by initializing _graal_installed_code in an nmethod's constructor
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 6990
diff changeset
576 Handle installed_code_handle = JNIHandles::resolve(installed_code);
13641
5a9afbf72714 Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13630
diff changeset
577 Handle speculation_log_handle = JNIHandles::resolve(speculation_log);
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
578
13493
03bb0ee05409 made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents: 13483
diff changeset
579 CodeInstaller installer;
13641
5a9afbf72714 Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13630
diff changeset
580 GraalEnv::CodeInstallResult result = installer.install(compiled_code_handle, cb, installed_code_handle, speculation_log_handle);
7019
6838696d54ac cleanly handle a failure to install Graal compiled code due to failed dependency (re)checking
Doug Simon <doug.simon@oracle.com>
parents: 7002
diff changeset
581
8526
3a105dec912f Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8513
diff changeset
582 if (PrintCodeCacheOnCompilation) {
3a105dec912f Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8513
diff changeset
583 stringStream s;
3a105dec912f Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8513
diff changeset
584 // Dump code cache into a buffer before locking the tty,
3a105dec912f Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8513
diff changeset
585 {
3a105dec912f Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8513
diff changeset
586 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
3a105dec912f Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8513
diff changeset
587 CodeCache::print_summary(&s, false);
3a105dec912f Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8513
diff changeset
588 }
3a105dec912f Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8513
diff changeset
589 ttyLocker ttyl;
3a105dec912f Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8513
diff changeset
590 tty->print_cr(s.as_string());
3a105dec912f Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8513
diff changeset
591 }
3a105dec912f Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8513
diff changeset
592
7089
af30115c9d0e added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
593 if (result != GraalEnv::ok) {
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
594 assert(cb == NULL, "should be");
7089
af30115c9d0e added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
595 } else {
af30115c9d0e added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
596 if (!installed_code_handle.is_null()) {
15161
2c940b1a48d8 Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15104
diff changeset
597 assert(installed_code_handle->is_a(InstalledCode::klass()), "wrong type");
2c940b1a48d8 Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15104
diff changeset
598 InstalledCode::set_address(installed_code_handle, (jlong) cb);
15166
7bc92bdfd322 Introduce versioning of installed code.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15161
diff changeset
599 InstalledCode::set_version(installed_code_handle, InstalledCode::version(installed_code_handle) + 1);
10577
9c7d9e2c8326 PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents: 10567
diff changeset
600 oop comp_result = HotSpotCompiledCode::comp(compiled_code_handle);
9c7d9e2c8326 PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents: 10567
diff changeset
601 if (comp_result->is_a(ExternalCompilationResult::klass())) {
10879
d55f24eac4b1 PTX support for Linux
Morris Meyer <morris.meyer@oracle.com>
parents: 10772
diff changeset
602 if (TraceGPUInteraction) {
10588
b0b368d38b40 CR-1032 - change ExternalCompilationResult kernel -> entryPoint
Morris Meyer <morris.meyer@oracle.com>
parents: 10577
diff changeset
603 tty->print_cr("installCode0: ExternalCompilationResult");
b0b368d38b40 CR-1032 - change ExternalCompilationResult kernel -> entryPoint
Morris Meyer <morris.meyer@oracle.com>
parents: 10577
diff changeset
604 }
11381
001c41b01d13 HotSpotInstalledCode: moved getCode to Java and added the ability to get the whole blob
twisti
parents: 11238
diff changeset
605 HotSpotInstalledCode::set_codeStart(installed_code_handle, ExternalCompilationResult::entryPoint(comp_result));
15161
2c940b1a48d8 Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15104
diff changeset
606 } else if (installed_code_handle->is_a(HotSpotInstalledCode::klass())) {
11381
001c41b01d13 HotSpotInstalledCode: moved getCode to Java and added the ability to get the whole blob
twisti
parents: 11238
diff changeset
607 HotSpotInstalledCode::set_size(installed_code_handle, cb->size());
001c41b01d13 HotSpotInstalledCode: moved getCode to Java and added the ability to get the whole blob
twisti
parents: 11238
diff changeset
608 HotSpotInstalledCode::set_codeStart(installed_code_handle, (jlong) cb->code_begin());
001c41b01d13 HotSpotInstalledCode: moved getCode to Java and added the ability to get the whole blob
twisti
parents: 11238
diff changeset
609 HotSpotInstalledCode::set_codeSize(installed_code_handle, cb->code_size());
10577
9c7d9e2c8326 PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents: 10567
diff changeset
610 }
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
611 nmethod* nm = cb->as_nmethod_or_null();
7089
af30115c9d0e added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
612 assert(nm == NULL || !installed_code_handle->is_scavengable() || nm->on_scavenge_root_list(), "nm should be scavengable if installed_code is scavengable");
af30115c9d0e added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
613 }
3683
345c3bbf9c3c store RiCompiledMethod in nmethod and:
Lukas Stadler <lukas.stadler@jku.at>
parents: 3632
diff changeset
614 }
7089
af30115c9d0e added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
Doug Simon <doug.simon@oracle.com>
parents: 7084
diff changeset
615 return result;
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
616 C2V_END
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
617
13103
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
618 C2V_VMENTRY(void, notifyCompilationStatistics, (JNIEnv *jniEnv, jobject, jint id, jobject hotspot_method, jboolean osr, jint processedBytecodes, jlong time, jlong timeUnitsPerSecond, jobject installed_code))
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
619 CompilerStatistics* stats = GraalCompiler::instance()->stats();
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
620
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
621 elapsedTimer timer = elapsedTimer(time, timeUnitsPerSecond);
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
622 if (osr) {
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
623 stats->_osr.update(timer, processedBytecodes);
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
624 } else {
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
625 stats->_standard.update(timer, processedBytecodes);
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
626 }
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
627 Handle installed_code_handle = JNIHandles::resolve(installed_code);
15161
2c940b1a48d8 Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15104
diff changeset
628 if (installed_code_handle->is_a(HotSpotInstalledCode::klass())) {
2c940b1a48d8 Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15104
diff changeset
629 stats->_nmethods_size += HotSpotInstalledCode::size(installed_code_handle);
2c940b1a48d8 Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15104
diff changeset
630 stats->_nmethods_code_size += HotSpotInstalledCode::codeSize(installed_code_handle);
2c940b1a48d8 Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15104
diff changeset
631 }
13103
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
632
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
633 if (CITimeEach) {
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
634 methodHandle method = asMethod(HotSpotResolvedJavaMethod::metaspaceMethod(hotspot_method));
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
635 float bytes_per_sec = 1.0 * processedBytecodes / timer.seconds();
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
636 tty->print_cr("%3d seconds: %f bytes/sec: %f (bytes %d)",
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
637 id, timer.seconds(), bytes_per_sec, processedBytecodes);
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
638 }
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
639 C2V_END
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
640
13364
5a4293f24642 added -G:PrintCompRate option for periodically printing out the current compilation rate
Doug Simon <doug.simon@oracle.com>
parents: 13306
diff changeset
641 C2V_VMENTRY(void, printCompilationStatistics, (JNIEnv *jniEnv, jobject, jboolean per_compiler, jboolean aggregate))
13461
52eb34dd84d7 JS: fix, evaluating jboolean directly gives a warning (and thus error) on Windows
Christian Wirth <christian.wirth@oracle.com>
parents: 13375
diff changeset
642 CompileBroker::print_times(per_compiler == JNI_TRUE, aggregate == JNI_TRUE);
13364
5a4293f24642 added -G:PrintCompRate option for periodically printing out the current compilation rate
Doug Simon <doug.simon@oracle.com>
parents: 13306
diff changeset
643 C2V_END
5a4293f24642 added -G:PrintCompRate option for periodically printing out the current compilation rate
Doug Simon <doug.simon@oracle.com>
parents: 13306
diff changeset
644
13103
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
645 C2V_VMENTRY(void, resetCompilationStatistics, (JNIEnv *jniEnv, jobject))
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
646 CompilerStatistics* stats = GraalCompiler::instance()->stats();
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
647 stats->_standard._time.reset();
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
648 stats->_standard._bytes = 0;
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
649 stats->_standard._count = 0;
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
650 stats->_osr._time.reset();
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
651 stats->_osr._bytes = 0;
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
652 stats->_osr._count = 0;
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
653 C2V_END
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12779
diff changeset
654
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
655 C2V_VMENTRY(jobject, disassembleCodeBlob, (JNIEnv *jniEnv, jobject, jlong codeBlob))
8349
8d6ea1915d42 merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents: 8348
diff changeset
656 ResourceMark rm;
8d6ea1915d42 merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents: 8348
diff changeset
657 HandleMark hm;
8d6ea1915d42 merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents: 8348
diff changeset
658
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
659 CodeBlob* cb = (CodeBlob*) (address) codeBlob;
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
660 if (cb == NULL) {
8349
8d6ea1915d42 merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents: 8348
diff changeset
661 return NULL;
8d6ea1915d42 merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents: 8348
diff changeset
662 }
8d6ea1915d42 merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents: 8348
diff changeset
663
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
664 // We don't want the stringStream buffer to resize during disassembly as it
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
665 // uses scoped resource memory. If a nested function called during disassembly uses
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
666 // a ResourceMark and the buffer expands within the scope of the mark,
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
667 // the buffer becomes garbage when that scope is exited. Experience shows that
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
668 // the disassembled code is typically about 10x the code size so a fixed buffer
13236
25da0f4e5c77 added extra space to disassembler buffer to account for disassembly header
Doug Simon <doug.simon@oracle.com>
parents: 13181
diff changeset
669 // sized to 20x code size plus a fixed amount for header info should be sufficient.
25da0f4e5c77 added extra space to disassembler buffer to account for disassembly header
Doug Simon <doug.simon@oracle.com>
parents: 13181
diff changeset
670 int bufferSize = cb->code_size() * 20 + 1024;
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
671 char* buffer = NEW_RESOURCE_ARRAY(char, bufferSize);
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
672 stringStream st(buffer, bufferSize);
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
673 if (cb->is_nmethod()) {
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
674 nmethod* nm = (nmethod*) cb;
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
675 if (!nm->is_alive()) {
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
676 return NULL;
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
677 }
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
678 Disassembler::decode(nm, &st);
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
679 } else {
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
680 Disassembler::decode(cb, &st);
7784
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7760
diff changeset
681 }
13772
284aea4028ca Fix: HotSpotDisassemblerProvider should return null when the code could not be disassembled.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13769
diff changeset
682 if (st.size() <= 0) {
284aea4028ca Fix: HotSpotDisassemblerProvider should return null when the code could not be disassembled.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13769
diff changeset
683 return NULL;
284aea4028ca Fix: HotSpotDisassemblerProvider should return null when the code could not be disassembled.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13769
diff changeset
684 }
7784
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7760
diff changeset
685
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7760
diff changeset
686 Handle result = java_lang_String::create_from_platform_dependent_str(st.as_string(), CHECK_NULL);
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7760
diff changeset
687 return JNIHandles::make_local(result());
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7760
diff changeset
688 C2V_END
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7760
diff changeset
689
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
690 C2V_VMENTRY(jobject, getStackTraceElement, (JNIEnv *env, jobject, jlong metaspace_method, int bci))
5238
cce31bc56c00 made HotSpotResolvedMethodImpl.toStackTraceElement() call into native code to get an object containing source file info
Doug Simon <doug.simon@oracle.com>
parents: 5154
diff changeset
691 ResourceMark rm;
cce31bc56c00 made HotSpotResolvedMethodImpl.toStackTraceElement() call into native code to get an object containing source file info
Doug Simon <doug.simon@oracle.com>
parents: 5154
diff changeset
692 HandleMark hm;
cce31bc56c00 made HotSpotResolvedMethodImpl.toStackTraceElement() call into native code to get an object containing source file info
Doug Simon <doug.simon@oracle.com>
parents: 5154
diff changeset
693
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
694 methodHandle method = asMethod(metaspace_method);
5238
cce31bc56c00 made HotSpotResolvedMethodImpl.toStackTraceElement() call into native code to get an object containing source file info
Doug Simon <doug.simon@oracle.com>
parents: 5154
diff changeset
695 oop element = java_lang_StackTraceElement::create(method, bci, CHECK_NULL);
cce31bc56c00 made HotSpotResolvedMethodImpl.toStackTraceElement() call into native code to get an object containing source file info
Doug Simon <doug.simon@oracle.com>
parents: 5154
diff changeset
696 return JNIHandles::make_local(element);
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
697 C2V_END
5238
cce31bc56c00 made HotSpotResolvedMethodImpl.toStackTraceElement() call into native code to get an object containing source file info
Doug Simon <doug.simon@oracle.com>
parents: 5154
diff changeset
698
10475
3489047ffea2 Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10434
diff changeset
699 C2V_VMENTRY(jobject, executeCompiledMethodVarargs, (JNIEnv *env, jobject, jobject args, jobject hotspotInstalledCode))
5246
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
700 ResourceMark rm;
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
701 HandleMark hm;
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
702
15161
2c940b1a48d8 Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15104
diff changeset
703 jlong nmethodValue = InstalledCode::address(hotspotInstalledCode);
13698
c3370b2e1cbc added check for invalidated code in executeCompiledMethodVarargs
Doug Simon <doug.simon@oracle.com>
parents: 13641
diff changeset
704 if (nmethodValue == 0L) {
c3370b2e1cbc added check for invalidated code in executeCompiledMethodVarargs
Doug Simon <doug.simon@oracle.com>
parents: 13641
diff changeset
705 THROW_(vmSymbols::com_oracle_graal_api_code_InvalidInstalledCodeException(), NULL);
c3370b2e1cbc added check for invalidated code in executeCompiledMethodVarargs
Doug Simon <doug.simon@oracle.com>
parents: 13641
diff changeset
706 }
9338
0266549ff6e0 added support from compiled stubs to be installed as RuntimeStubs and to be able to directly call C/C++ runtime functions (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents: 9232
diff changeset
707 nmethod* nm = (nmethod*) (address) nmethodValue;
9024
2b840ae76df1 Move nmethod parameter to the last position to keep passed on arguments in the correct registers.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 9023
diff changeset
708 methodHandle mh = nm->method();
5246
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
709 Symbol* signature = mh->signature();
7281
e960cda050d7 fixed bug in executing InstalledCode with more than 8 arguments
Doug Simon <doug.simon@oracle.com>
parents: 7232
diff changeset
710 JavaCallArguments jca(mh->size_of_parameters());
5246
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
711
5747
120820e30baa added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents: 5624
diff changeset
712 JavaArgumentUnboxer jap(signature, &jca, (arrayOop) JNIHandles::resolve(args), mh->is_static());
5246
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
713 JavaValue result(jap.get_ret_type());
8151
b8f261ba79c6 Minimize diff to plain HotSpot version.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8127
diff changeset
714 jca.set_alternative_target(nm);
b8f261ba79c6 Minimize diff to plain HotSpot version.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8127
diff changeset
715 JavaCalls::call(&result, mh, &jca, CHECK_NULL);
5246
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
716
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
717 if (jap.get_ret_type() == T_VOID) {
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
718 return NULL;
5395
fc1943f18fef fixed bug in returning array values from CompilerToVMImpl.executeCompiledMethodVarargs
Doug Simon <doug.simon@oracle.com>
parents: 5318
diff changeset
719 } else if (jap.get_ret_type() == T_OBJECT || jap.get_ret_type() == T_ARRAY) {
5246
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
720 return JNIHandles::make_local((oop) result.get_jobject());
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
721 } else {
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
722 oop o = java_lang_boxing_object::create(jap.get_ret_type(), (jvalue *) result.get_value_addr(), CHECK_NULL);
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
723 return JNIHandles::make_local(o);
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
724 }
6376
e957c9ff0bda put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents: 6367
diff changeset
725 C2V_END
5246
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
726
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
727 C2V_ENTRY(jlongArray, getLineNumberTable, (JNIEnv *env, jobject, jlong metaspace_method))
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
728 Method* method = (Method*) metaspace_method;
8269
985a97ba083c Fix spacing.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8215
diff changeset
729 if (!method->has_linenumber_table()) {
7310
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
730 return NULL;
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
731 }
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
732 u2 num_entries = 0;
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
733 CompressedLineNumberReadStream streamForSize(method->compressed_linenumber_table());
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
734 while (streamForSize.read_pair()) {
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
735 num_entries++;
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
736 }
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
737
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
738 CompressedLineNumberReadStream stream(method->compressed_linenumber_table());
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
739 jlongArray result = env->NewLongArray(2 * num_entries);
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
740
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
741 int i = 0;
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
742 jlong value;
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
743 while (stream.read_pair()) {
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
744 value = ((long) stream.bci());
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
745 env->SetLongArrayRegion(result,i,1,&value);
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
746 value = ((long) stream.line());
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
747 env->SetLongArrayRegion(result,i + 1,1,&value);
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
748 i += 2;
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
749 }
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
750
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
751 return result;
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
752 C2V_END
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
753
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
754 C2V_VMENTRY(jlong, getLocalVariableTableStart, (JNIEnv *, jobject, jlong metaspace_method))
7786
8bbbde9d0a52 extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 7784
diff changeset
755 ResourceMark rm;
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
756 Method* method = (Method*) metaspace_method;
8269
985a97ba083c Fix spacing.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8215
diff changeset
757 if (!method->has_localvariable_table()) {
13306
dfb780080923 moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents: 13305
diff changeset
758 return 0;
7786
8bbbde9d0a52 extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 7784
diff changeset
759 }
13306
dfb780080923 moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents: 13305
diff changeset
760 return (jlong) (address) method->localvariable_table_start();
7786
8bbbde9d0a52 extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 7784
diff changeset
761 C2V_END
8bbbde9d0a52 extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 7784
diff changeset
762
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
763 C2V_VMENTRY(jint, getLocalVariableTableLength, (JNIEnv *, jobject, jlong metaspace_method))
13306
dfb780080923 moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents: 13305
diff changeset
764 ResourceMark rm;
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
765 Method* method = (Method*) metaspace_method;
13306
dfb780080923 moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents: 13305
diff changeset
766 return method->localvariable_table_length();
dfb780080923 moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents: 13305
diff changeset
767 C2V_END
7310
79a7b761755c Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7232
diff changeset
768
8611
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
769 C2V_VMENTRY(void, reprofile, (JNIEnv *env, jobject, jlong metaspace_method))
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
770 Method* method = asMethod(metaspace_method);
10408
836a62f43af9 Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
Doug Simon <doug.simon@oracle.com>
parents: 10072
diff changeset
771 MethodCounters* mcs = method->method_counters();
836a62f43af9 Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
Doug Simon <doug.simon@oracle.com>
parents: 10072
diff changeset
772 if (mcs != NULL) {
836a62f43af9 Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
Doug Simon <doug.simon@oracle.com>
parents: 10072
diff changeset
773 mcs->clear_counters();
836a62f43af9 Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
Doug Simon <doug.simon@oracle.com>
parents: 10072
diff changeset
774 }
836a62f43af9 Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
Doug Simon <doug.simon@oracle.com>
parents: 10072
diff changeset
775 NOT_PRODUCT(method->set_compiled_invocation_count(0));
8611
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
776
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
777 nmethod* code = method->code();
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
778 if (code != NULL) {
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
779 code->make_not_entrant();
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
780 }
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
781
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
782 MethodData* method_data = method->method_data();
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
783 if (method_data == NULL) {
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
784 ClassLoaderData* loader_data = method->method_holder()->class_loader_data();
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
785 method_data = MethodData::allocate(loader_data, method, CHECK);
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
786 method->set_method_data(method_data);
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
787 } else {
13181
389d40d7d99f fixed bug in MethodData and added assertion that precomputed size == initialized size
Doug Simon <doug.simon@oracle.com>
parents: 13103
diff changeset
788 method_data->initialize(true);
8611
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
789 }
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
790 C2V_END
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
791
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8451
diff changeset
792
10476
cd68d6902328 Fix invalidateInstalledCode and delete isInstalledCodeValid.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10475
diff changeset
793 C2V_VMENTRY(void, invalidateInstalledCode, (JNIEnv *env, jobject, jobject hotspotInstalledCode))
15161
2c940b1a48d8 Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15104
diff changeset
794 jlong nativeMethod = InstalledCode::address(hotspotInstalledCode);
9023
f94bb5d20e5d Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8996
diff changeset
795 nmethod* m = (nmethod*)nativeMethod;
10477
7943479d36f3 Fix for invalidateInstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10476
diff changeset
796 if (m != NULL && !m->is_not_entrant()) {
9025
ff5a32117e02 Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 9024
diff changeset
797 m->mark_for_deoptimization();
ff5a32117e02 Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 9024
diff changeset
798 VM_Deoptimize op;
ff5a32117e02 Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 9024
diff changeset
799 VMThread::execute(&op);
ff5a32117e02 Implement fast invocation of installed code (direct tail call to the target machine code address).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 9024
diff changeset
800 }
15161
2c940b1a48d8 Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15104
diff changeset
801 InstalledCode::set_address(hotspotInstalledCode, 0);
9023
f94bb5d20e5d Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8996
diff changeset
802 C2V_END
f94bb5d20e5d Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8996
diff changeset
803
15052
5e6f29f287d6 added InstanceKlass::_graal_node_class field to accelerate Node.getNodeClass()
Doug Simon <doug.simon@oracle.com>
parents: 14717
diff changeset
804 C2V_VMENTRY(jobject, getJavaMirror, (JNIEnv *env, jobject, jlong metaspace_klass))
5e6f29f287d6 added InstanceKlass::_graal_node_class field to accelerate Node.getNodeClass()
Doug Simon <doug.simon@oracle.com>
parents: 14717
diff changeset
805 Klass* klass = asKlass(metaspace_klass);
5e6f29f287d6 added InstanceKlass::_graal_node_class field to accelerate Node.getNodeClass()
Doug Simon <doug.simon@oracle.com>
parents: 14717
diff changeset
806 return JNIHandles::make_local(klass->java_mirror());
5e6f29f287d6 added InstanceKlass::_graal_node_class field to accelerate Node.getNodeClass()
Doug Simon <doug.simon@oracle.com>
parents: 14717
diff changeset
807 C2V_END
9023
f94bb5d20e5d Rename MethodInvalidatedException to InvalidInstalledCodeException (and make it a checked exception). Make sure that a compiled code object can always be directly called without first doing a check on the native method pointer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8996
diff changeset
808
10715
c3760150dc29 Add function to read compressed klass pointers of constant objects natively
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10714
diff changeset
809 C2V_VMENTRY(jlong, readUnsafeKlassPointer, (JNIEnv *env, jobject, jobject o))
c3760150dc29 Add function to read compressed klass pointers of constant objects natively
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10714
diff changeset
810 oop resolved_o = JNIHandles::resolve(o);
c3760150dc29 Add function to read compressed klass pointers of constant objects natively
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10714
diff changeset
811 jlong klass = (jlong)(address)resolved_o->klass();
c3760150dc29 Add function to read compressed klass pointers of constant objects natively
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10714
diff changeset
812 return klass;
c3760150dc29 Add function to read compressed klass pointers of constant objects natively
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10714
diff changeset
813 C2V_END
10536
26c69598db3e Fix bug in canonicalization of non-compressed object pointers.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10477
diff changeset
814
11852
d7964e96b0b0 move benchmark counters into separate class and make them correct for multithreaded applications
Lukas Stadler <lukas.stadler@jku.at>
parents: 11520
diff changeset
815 C2V_VMENTRY(jlongArray, collectCounters, (JNIEnv *env, jobject))
13796
8cd953e97e2d rework of benchmark counters: fix size at VM entry, not at build time
Lukas Stadler <lukas.stadler@jku.at>
parents: 13772
diff changeset
816 typeArrayOop arrayOop = oopFactory::new_longArray(GraalCounterSize, CHECK_NULL);
11852
d7964e96b0b0 move benchmark counters into separate class and make them correct for multithreaded applications
Lukas Stadler <lukas.stadler@jku.at>
parents: 11520
diff changeset
817 JavaThread::collect_counters(arrayOop);
d7964e96b0b0 move benchmark counters into separate class and make them correct for multithreaded applications
Lukas Stadler <lukas.stadler@jku.at>
parents: 11520
diff changeset
818 return (jlongArray) JNIHandles::make_local(arrayOop);
d7964e96b0b0 move benchmark counters into separate class and make them correct for multithreaded applications
Lukas Stadler <lukas.stadler@jku.at>
parents: 11520
diff changeset
819 C2V_END
d7964e96b0b0 move benchmark counters into separate class and make them correct for multithreaded applications
Lukas Stadler <lukas.stadler@jku.at>
parents: 11520
diff changeset
820
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13796
diff changeset
821 C2V_ENTRY(jobject, getGPUs, (JNIEnv *env, jobject))
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13796
diff changeset
822 #if defined(TARGET_OS_FAMILY_bsd) || defined(TARGET_OS_FAMILY_linux) || defined(TARGET_OS_FAMILY_windows)
15177
66e3af78ea96 HSAIL: added safepoint support
Doug Simon <doug.simon@oracle.com>
parents: 15169
diff changeset
823 return Gpu::probe_gpus(env);
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13796
diff changeset
824 #else
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13796
diff changeset
825 return env->NewStringUTF("");
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13796
diff changeset
826 #endif
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13796
diff changeset
827 C2V_END
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13796
diff changeset
828
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
829 C2V_VMENTRY(int, allocateCompileId, (JNIEnv *env, jobject, jlong metaspace_method, int entry_bci))
13630
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13578
diff changeset
830 HandleMark hm;
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13578
diff changeset
831 ResourceMark rm;
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
832 Method* method = (Method*) metaspace_method;
13969
fe034af88233 Acquire proper locks before calling assign_compile_id
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13953
diff changeset
833 return CompileBroker::assign_compile_id_unlocked(THREAD, method, entry_bci);
13630
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13578
diff changeset
834 C2V_END
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13578
diff changeset
835
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13578
diff changeset
836
13769
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13698
diff changeset
837 C2V_VMENTRY(jboolean, isMature, (JNIEnv *env, jobject, jlong metaspace_method_data))
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13698
diff changeset
838 MethodData* mdo = asMethodData(metaspace_method_data);
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13698
diff changeset
839 return mdo != NULL && mdo->is_mature();
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13698
diff changeset
840 C2V_END
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13698
diff changeset
841
14107
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14106
diff changeset
842 C2V_VMENTRY(jboolean, hasCompiledCodeForOSR, (JNIEnv *env, jobject, jlong metaspace_method, int entry_bci, int comp_level))
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14106
diff changeset
843 Method* method = asMethod(metaspace_method);
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14106
diff changeset
844 return method->lookup_osr_nmethod_for(entry_bci, comp_level, true) != NULL;
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14106
diff changeset
845 C2V_END
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14106
diff changeset
846
15045
0286888f792b fix PrintCompilation formatting and use same time source
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14717
diff changeset
847 C2V_VMENTRY(jlong, getTimeStamp, (JNIEnv *env, jobject))
0286888f792b fix PrintCompilation formatting and use same time source
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14717
diff changeset
848 // tty->time_stamp is the time since VM start which should be used
0286888f792b fix PrintCompilation formatting and use same time source
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14717
diff changeset
849 // for all HotSpot log output when a timestamp is required.
0286888f792b fix PrintCompilation formatting and use same time source
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14717
diff changeset
850 return tty->time_stamp().milliseconds();
0286888f792b fix PrintCompilation formatting and use same time source
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14717
diff changeset
851 C2V_END
0286888f792b fix PrintCompilation formatting and use same time source
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14717
diff changeset
852
15088
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
853 bool matches(jlongArray methods, Method* method) {
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
854 typeArrayOop methods_oop = (typeArrayOop) JNIHandles::resolve(methods);
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
855
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
856 for (int i = 0; i < methods_oop->length(); i++) {
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
857 if (methods_oop->long_at(i) == (jlong) method) {
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
858 return true;
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
859 }
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
860 }
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
861 return false;
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
862 }
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
863
15092
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
864 C2V_VMENTRY(jobject, getNextStackFrame, (JNIEnv *env, jobject compilerToVM, jobject hs_frame, jlongArray methods, jint initialSkip))
15063
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
865 ResourceMark rm;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
866
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
867 if (!thread->has_last_Java_frame()) return NULL;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
868 Handle result = InstanceKlass::cast(HotSpotStackFrameReference::klass())->allocate_instance(thread);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
869 HotSpotStackFrameReference::klass()->initialize(thread);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
870
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
871 StackFrameStream fst(thread);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
872 if (hs_frame != NULL) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
873 // look for the correct stack frame if one is given
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
874 intptr_t* stack_pointer = (intptr_t*) HotSpotStackFrameReference::stackPointer(hs_frame);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
875 while (fst.current()->sp() != stack_pointer && !fst.is_done()) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
876 fst.next();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
877 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
878 if (fst.current()->sp() != stack_pointer) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
879 THROW_MSG_NULL(vmSymbols::java_lang_IllegalStateException(), "stack frame not found")
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
880 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
881 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
882
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
883 int frame_number = 0;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
884 vframe* vf = vframe::new_vframe(fst.current(), fst.register_map(), thread);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
885 if (hs_frame != NULL) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
886 // look for the correct vframe within the stack frame if one is given
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
887 int last_frame_number = HotSpotStackFrameReference::frameNumber(hs_frame);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
888 while (frame_number < last_frame_number) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
889 if (vf->is_top()) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
890 THROW_MSG_NULL(vmSymbols::java_lang_IllegalStateException(), "invalid frame number")
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
891 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
892 vf = vf->sender();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
893 frame_number ++;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
894 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
895 // move one frame forward
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
896 if (vf->is_top()) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
897 if (fst.is_done()) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
898 return NULL;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
899 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
900 fst.next();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
901 vf = vframe::new_vframe(fst.current(), fst.register_map(), thread);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
902 frame_number = 0;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
903 } else {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
904 vf = vf->sender();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
905 frame_number++;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
906 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
907 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
908
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
909 while (true) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
910 // look for the given method
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
911 while (true) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
912 StackValueCollection* locals = NULL;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
913 if (vf->is_compiled_frame()) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
914 // compiled method frame
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
915 compiledVFrame* cvf = compiledVFrame::cast(vf);
15088
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
916 if (methods == NULL || matches(methods, cvf->method())) {
15092
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
917 if (initialSkip > 0) {
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
918 initialSkip --;
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
919 } else {
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
920 GrowableArray<ScopeValue*>* objects = cvf->scope()->objects();
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
921 bool reallocated = false;
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
922 if (objects != NULL) {
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
923 reallocated = Deoptimization::realloc_objects(thread, fst.current(), objects, THREAD);
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
924 if (reallocated) {
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
925 Deoptimization::reassign_fields(fst.current(), fst.register_map(), objects);
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
926 }
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
927
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
928 GrowableArray<ScopeValue*>* local_values = cvf->scope()->locals();
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
929 typeArrayHandle array = oopFactory::new_boolArray(local_values->length(), thread);
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
930 for (int i = 0; i < local_values->length(); i++) {
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
931 ScopeValue* value = local_values->at(i);
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
932 if (value->is_object()) {
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
933 array->bool_at_put(i, true);
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
934 }
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
935 }
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
936 HotSpotStackFrameReference::set_localIsVirtual(result, array());
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
937 } else {
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
938 HotSpotStackFrameReference::set_localIsVirtual(result, NULL);
15063
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
939 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
940
15092
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
941 locals = cvf->locals();
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
942 HotSpotStackFrameReference::set_bci(result, cvf->bci());
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
943 HotSpotStackFrameReference::set_metaspaceMethod(result, (jlong) cvf->method());
15063
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
944 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
945 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
946 } else if (vf->is_interpreted_frame()) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
947 // interpreted method frame
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
948 interpretedVFrame* ivf = interpretedVFrame::cast(vf);
15088
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
949 if (methods == NULL || matches(methods, ivf->method())) {
15092
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
950 if (initialSkip > 0) {
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
951 initialSkip --;
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
952 } else {
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
953 locals = ivf->locals();
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
954 HotSpotStackFrameReference::set_bci(result, ivf->bci());
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
955 HotSpotStackFrameReference::set_metaspaceMethod(result, (jlong) ivf->method());
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
956 HotSpotStackFrameReference::set_localIsVirtual(result, NULL);
c73ce0dd3583 add support for skipping stack frames in StackIntrospection.getStackTrace
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15088
diff changeset
957 }
15063
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
958 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
959 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
960
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
961 // locals != NULL means that we found a matching frame and result is already partially initialized
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
962 if (locals != NULL) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
963 HotSpotStackFrameReference::set_compilerToVM(result, JNIHandles::resolve(compilerToVM));
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
964 HotSpotStackFrameReference::set_stackPointer(result, (jlong) fst.current()->sp());
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
965 HotSpotStackFrameReference::set_frameNumber(result, frame_number);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
966
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
967 // initialize the locals array
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
968 objArrayHandle array = oopFactory::new_objectArray(locals->size(), thread);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
969 for (int i = 0; i < locals->size(); i++) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
970 StackValue* var = locals->at(i);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
971 if (var->type() == T_OBJECT) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
972 array->obj_at_put(i, locals->at(i)->get_obj()());
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
973 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
974 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
975 HotSpotStackFrameReference::set_locals(result, array());
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
976
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
977 return JNIHandles::make_local(thread, result());
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
978 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
979
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
980 if (vf->is_top()) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
981 break;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
982 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
983 frame_number++;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
984 vf = vf->sender();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
985 } // end of vframe loop
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
986
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
987 if (fst.is_done()) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
988 break;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
989 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
990 fst.next();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
991 vf = vframe::new_vframe(fst.current(), fst.register_map(), thread);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
992 frame_number = 0;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
993 } // end of frame loop
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
994
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
995 // the end was reached without finding a matching method
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
996 return NULL;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
997 C2V_END
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
998
15205
affef8631cf4 Add eager resolving for indy call sites
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15177
diff changeset
999 C2V_VMENTRY(void, resolveInvokeDynamic, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index))
affef8631cf4 Add eager resolving for indy call sites
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15177
diff changeset
1000 ConstantPool* cp = (ConstantPool*)metaspace_constant_pool;
affef8631cf4 Add eager resolving for indy call sites
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15177
diff changeset
1001 CallInfo callInfo;
affef8631cf4 Add eager resolving for indy call sites
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15177
diff changeset
1002 LinkResolver::resolve_invokedynamic(callInfo, cp, index, CHECK);
affef8631cf4 Add eager resolving for indy call sites
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15177
diff changeset
1003 ConstantPoolCacheEntry* cp_cache_entry = cp->invokedynamic_cp_cache_entry_at(index);
affef8631cf4 Add eager resolving for indy call sites
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15177
diff changeset
1004 cp_cache_entry->set_dynamic_call(cp, callInfo);
affef8631cf4 Add eager resolving for indy call sites
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15177
diff changeset
1005 C2V_END
15063
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1006
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1007 // public native void materializeVirtualObjects(HotSpotStackFrameReference stackFrame, boolean invalidate);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1008 C2V_VMENTRY(void, materializeVirtualObjects, (JNIEnv *env, jobject, jobject hs_frame, bool invalidate))
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1009 ResourceMark rm;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1010
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1011 if (hs_frame == NULL) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1012 THROW_MSG(vmSymbols::java_lang_NullPointerException(), "stack frame is null")
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1013 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1014
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1015 HotSpotStackFrameReference::klass()->initialize(thread);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1016
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1017 // look for the given stack frame
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1018 StackFrameStream fst(thread);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1019 intptr_t* stack_pointer = (intptr_t*) HotSpotStackFrameReference::stackPointer(hs_frame);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1020 while (fst.current()->sp() != stack_pointer && !fst.is_done()) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1021 fst.next();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1022 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1023 if (fst.current()->sp() != stack_pointer) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1024 THROW_MSG(vmSymbols::java_lang_IllegalStateException(), "stack frame not found")
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1025 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1026
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1027 if (invalidate) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1028 assert(fst.current()->cb()->is_nmethod(), "nmethod expected");
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1029 ((nmethod*) fst.current()->cb())->make_not_entrant();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1030 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1031 Deoptimization::deoptimize(thread, *fst.current(), fst.register_map(), Deoptimization::Reason_none);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1032
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1033 vframe* vf = vframe::new_vframe(fst.current(), fst.register_map(), thread);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1034 if (!vf->is_compiled_frame()) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1035 THROW_MSG(vmSymbols::java_lang_IllegalStateException(), "compiled stack frame expected")
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1036 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1037
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1038 GrowableArray<compiledVFrame*>* virtualFrames = new GrowableArray<compiledVFrame*>(10);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1039 while (true) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1040 assert(vf->is_compiled_frame(), "Wrong frame type");
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1041 virtualFrames->push(compiledVFrame::cast(vf));
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1042 if (vf->is_top()) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1043 break;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1044 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1045 vf = vf->sender();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1046 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1047
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1048 int last_frame_number = HotSpotStackFrameReference::frameNumber(hs_frame);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1049 if (last_frame_number >= virtualFrames->length()) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1050 THROW_MSG(vmSymbols::java_lang_IllegalStateException(), "invalid frame number")
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1051 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1052
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1053 // Reallocate the non-escaping objects and restore their fields.
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1054 assert (virtualFrames->at(last_frame_number)->scope() != NULL,"invalid scope");
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1055 GrowableArray<ScopeValue*>* objects = virtualFrames->at(last_frame_number)->scope()->objects();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1056
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1057 if (objects == NULL) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1058 // no objects to materialize
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1059 return;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1060 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1061
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1062 bool reallocated = Deoptimization::realloc_objects(thread, fst.current(), objects, THREAD);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1063 if (reallocated) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1064 Deoptimization::reassign_fields(fst.current(), fst.register_map(), objects);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1065
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1066 for (int frame_index = 0; frame_index < virtualFrames->length(); frame_index++) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1067 compiledVFrame* cvf = virtualFrames->at(frame_index);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1068
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1069 GrowableArray<ScopeValue*>* scopeLocals = cvf->scope()->locals();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1070 StackValueCollection* locals = cvf->locals();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1071
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1072 if (locals != NULL) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1073 for (int i2 = 0; i2 < locals->size(); i2++) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1074 StackValue* var = locals->at(i2);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1075 if (var->type() == T_OBJECT && scopeLocals->at(i2)->is_object()) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1076 jvalue val;
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1077 val.l = (jobject) locals->at(i2)->get_obj()();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1078 cvf->update_local(T_OBJECT, i2, val);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1079 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1080 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1081 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1082 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1083
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1084 // all locals are materialized by now
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1085 HotSpotStackFrameReference::set_localIsVirtual(hs_frame, NULL);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1086
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1087 // update the locals array
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1088 objArrayHandle array = (objArrayOop) HotSpotStackFrameReference::locals(hs_frame);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1089 StackValueCollection* locals = virtualFrames->at(last_frame_number)->locals();
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1090 for (int i = 0; i < locals->size(); i++) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1091 StackValue* var = locals->at(i);
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1092 if (var->type() == T_OBJECT) {
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1093 array->obj_at_put(i, locals->at(i)->get_obj()());
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1094 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1095 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1096 }
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1097 C2V_END
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1098
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1099
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1100
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
1101 #define CC (char*) /*cast a literal from (const char*)*/
6588
b89b5038ad7e removed _'s from method names in CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 6559
diff changeset
1102 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f))
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
1103
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
1104 #define TYPE "Lcom/oracle/graal/api/meta/JavaType;"
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
1105 #define METHOD "Lcom/oracle/graal/api/meta/JavaMethod;"
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
1106 #define FIELD "Lcom/oracle/graal/api/meta/JavaField;"
13641
5a9afbf72714 Add a speculation oop for uncommon trap deoptimization. Save it in the SpeculationLog during deoptimization.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13630
diff changeset
1107 #define SPECULATION_LOG "Lcom/oracle/graal/api/code/SpeculationLog;"
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6948
diff changeset
1108 #define STRING "Ljava/lang/String;"
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6948
diff changeset
1109 #define OBJECT "Ljava/lang/Object;"
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6948
diff changeset
1110 #define CLASS "Ljava/lang/Class;"
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6948
diff changeset
1111 #define STACK_TRACE_ELEMENT "Ljava/lang/StackTraceElement;"
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6948
diff changeset
1112 #define HS_RESOLVED_METHOD "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod;"
15088
d3add9b82b71 change to StackIntrospection and Truffle getStackTrace implementation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15063
diff changeset
1113 #define RESOLVED_METHOD "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;"
9669
ed6202820ecf renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents: 9668
diff changeset
1114 #define HS_COMPILED_CODE "Lcom/oracle/graal/hotspot/HotSpotCompiledCode;"
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6948
diff changeset
1115 #define HS_CONFIG "Lcom/oracle/graal/hotspot/HotSpotVMConfig;"
15161
2c940b1a48d8 Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 15104
diff changeset
1116 #define INSTALLED_CODE "Lcom/oracle/graal/api/code/InstalledCode;"
15052
5e6f29f287d6 added InstanceKlass::_graal_node_class field to accelerate Node.getNodeClass()
Doug Simon <doug.simon@oracle.com>
parents: 14717
diff changeset
1117 #define NODE_CLASS "Lcom/oracle/graal/graph/NodeClass;"
15063
36e1a11a72b3 new StackIntrospection interface to allow access to stack contents
Lukas Stadler <lukas.stadler@oracle.com>
parents: 15059
diff changeset
1118 #define HS_STACK_FRAME_REF "Lcom/oracle/graal/hotspot/HotSpotStackFrameReference;"
13478
fe03864a2c72 replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents: 13461
diff changeset
1119 #define METASPACE_KLASS "J"
6948
e522a00b91aa Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
Doug Simon <doug.simon@oracle.com>
parents: 6674
diff changeset
1120 #define METASPACE_METHOD "J"
13769
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13698
diff changeset
1121 #define METASPACE_METHOD_DATA "J"
13259
b16fb0b7479b every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents: 13258
diff changeset
1122 #define METASPACE_CONSTANT_POOL "J"
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
1123 #define METASPACE_SYMBOL "J"
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
1124
4220
5c80ccb80036 Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4199
diff changeset
1125 JNINativeMethod CompilerToVM_methods[] = {
15722
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1126 {CC"initializeBytecode", CC"("METASPACE_METHOD"[B)[B", FN_PTR(initializeBytecode)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1127 {CC"exceptionTableStart", CC"("METASPACE_METHOD")J", FN_PTR(exceptionTableStart)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1128 {CC"exceptionTableLength", CC"("METASPACE_METHOD")I", FN_PTR(exceptionTableLength)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1129 {CC"hasBalancedMonitors", CC"("METASPACE_METHOD")Z", FN_PTR(hasBalancedMonitors)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1130 {CC"findUniqueConcreteMethod", CC"("METASPACE_METHOD")"METASPACE_METHOD, FN_PTR(findUniqueConcreteMethod)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1131 {CC"getKlassImplementor", CC"("METASPACE_KLASS")"METASPACE_KLASS, FN_PTR(getKlassImplementor)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1132 {CC"getStackTraceElement", CC"("METASPACE_METHOD"I)"STACK_TRACE_ELEMENT, FN_PTR(getStackTraceElement)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1133 {CC"methodIsIgnoredBySecurityStackWalk", CC"("METASPACE_METHOD")Z", FN_PTR(methodIsIgnoredBySecurityStackWalk)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1134 {CC"doNotInlineOrCompile", CC"("METASPACE_METHOD")V", FN_PTR(doNotInlineOrCompile)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1135 {CC"canInlineMethod", CC"("METASPACE_METHOD")Z", FN_PTR(canInlineMethod)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1136 {CC"shouldInlineMethod", CC"("METASPACE_METHOD")Z", FN_PTR(shouldInlineMethod)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1137 {CC"lookupType", CC"("STRING CLASS"Z)"METASPACE_KLASS, FN_PTR(lookupType)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1138 {CC"resolveConstantInPool", CC"("METASPACE_CONSTANT_POOL"I)"OBJECT, FN_PTR(resolveConstantInPool)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1139 {CC"resolvePossiblyCachedConstantInPool", CC"("METASPACE_CONSTANT_POOL"I)"OBJECT, FN_PTR(resolvePossiblyCachedConstantInPool)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1140 {CC"lookupNameRefInPool", CC"("METASPACE_CONSTANT_POOL"I)"METASPACE_SYMBOL, FN_PTR(lookupNameRefInPool)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1141 {CC"lookupNameAndTypeRefIndexInPool", CC"("METASPACE_CONSTANT_POOL"I)I", FN_PTR(lookupNameAndTypeRefIndexInPool)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1142 {CC"lookupSignatureRefInPool", CC"("METASPACE_CONSTANT_POOL"I)"METASPACE_SYMBOL, FN_PTR(lookupSignatureRefInPool)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1143 {CC"lookupKlassRefIndexInPool", CC"("METASPACE_CONSTANT_POOL"I)I", FN_PTR(lookupKlassRefIndexInPool)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1144 {CC"constantPoolKlassAt", CC"("METASPACE_CONSTANT_POOL"I)"METASPACE_KLASS, FN_PTR(constantPoolKlassAt)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1145 {CC"lookupKlassInPool", CC"("METASPACE_CONSTANT_POOL"I)"METASPACE_KLASS, FN_PTR(lookupKlassInPool)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1146 {CC"lookupAppendixInPool", CC"("METASPACE_CONSTANT_POOL"I)"OBJECT, FN_PTR(lookupAppendixInPool)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1147 {CC"lookupMethodInPool", CC"("METASPACE_CONSTANT_POOL"IB)"METASPACE_METHOD, FN_PTR(lookupMethodInPool)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1148 {CC"constantPoolRemapInstructionOperandFromCache", CC"("METASPACE_CONSTANT_POOL"I)I", FN_PTR(constantPoolRemapInstructionOperandFromCache)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1149 {CC"resolveField", CC"("METASPACE_CONSTANT_POOL"IB[J)"METASPACE_KLASS, FN_PTR(resolveField)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1150 {CC"resolveInvokeDynamic", CC"("METASPACE_CONSTANT_POOL"I)V", FN_PTR(resolveInvokeDynamic)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1151 {CC"resolveMethod", CC"("METASPACE_KLASS METASPACE_METHOD METASPACE_KLASS")"METASPACE_METHOD, FN_PTR(resolveMethod)},
15726
668d158f780c Rename HotSpotResolvedObjectType.metaspaceKlass to getMetaspaceKlass
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15725
diff changeset
1152 {CC"getVtableIndexForInterface", CC"("METASPACE_KLASS METASPACE_METHOD")I", FN_PTR(getVtableIndexForInterface)},
15722
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1153 {CC"getClassInitializer", CC"("METASPACE_KLASS")"METASPACE_METHOD, FN_PTR(getClassInitializer)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1154 {CC"hasFinalizableSubclass", CC"("METASPACE_KLASS")Z", FN_PTR(hasFinalizableSubclass)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1155 {CC"getMaxCallTargetOffset", CC"(J)J", FN_PTR(getMaxCallTargetOffset)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1156 {CC"getMetaspaceMethod", CC"("CLASS"I)"METASPACE_METHOD, FN_PTR(getMetaspaceMethod)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1157 {CC"initializeConfiguration", CC"("HS_CONFIG")V", FN_PTR(initializeConfiguration)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1158 {CC"installCode0", CC"("HS_COMPILED_CODE INSTALLED_CODE SPECULATION_LOG")I", FN_PTR(installCode0)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1159 {CC"notifyCompilationStatistics", CC"(I"HS_RESOLVED_METHOD"ZIJJ"INSTALLED_CODE")V", FN_PTR(notifyCompilationStatistics)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1160 {CC"printCompilationStatistics", CC"(ZZ)V", FN_PTR(printCompilationStatistics)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1161 {CC"resetCompilationStatistics", CC"()V", FN_PTR(resetCompilationStatistics)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1162 {CC"disassembleCodeBlob", CC"(J)"STRING, FN_PTR(disassembleCodeBlob)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1163 {CC"executeCompiledMethodVarargs", CC"(["OBJECT INSTALLED_CODE")"OBJECT, FN_PTR(executeCompiledMethodVarargs)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1164 {CC"getLineNumberTable", CC"("METASPACE_METHOD")[J", FN_PTR(getLineNumberTable)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1165 {CC"getLocalVariableTableStart", CC"("METASPACE_METHOD")J", FN_PTR(getLocalVariableTableStart)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1166 {CC"getLocalVariableTableLength", CC"("METASPACE_METHOD")I", FN_PTR(getLocalVariableTableLength)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1167 {CC"reprofile", CC"("METASPACE_METHOD")V", FN_PTR(reprofile)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1168 {CC"invalidateInstalledCode", CC"("INSTALLED_CODE")V", FN_PTR(invalidateInstalledCode)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1169 {CC"getJavaMirror", CC"("METASPACE_KLASS")"CLASS, FN_PTR(getJavaMirror)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1170 {CC"readUnsafeKlassPointer", CC"("OBJECT")J", FN_PTR(readUnsafeKlassPointer)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1171 {CC"collectCounters", CC"()[J", FN_PTR(collectCounters)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1172 {CC"getGPUs", CC"()"STRING, FN_PTR(getGPUs)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1173 {CC"allocateCompileId", CC"("METASPACE_METHOD"I)I", FN_PTR(allocateCompileId)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1174 {CC"isMature", CC"("METASPACE_METHOD_DATA")Z", FN_PTR(isMature)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1175 {CC"hasCompiledCodeForOSR", CC"("METASPACE_METHOD"II)Z", FN_PTR(hasCompiledCodeForOSR)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1176 {CC"getTimeStamp", CC"()J", FN_PTR(getTimeStamp)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1177 {CC"getNextStackFrame", CC"("HS_STACK_FRAME_REF "[JI)"HS_STACK_FRAME_REF, FN_PTR(getNextStackFrame)},
c583759bbcfd ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 15456
diff changeset
1178 {CC"materializeVirtualObjects", CC"("HS_STACK_FRAME_REF"Z)V", FN_PTR(materializeVirtualObjects)},
1412
9195b99c841b Added first VM entry method.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1410
diff changeset
1179 };
9195b99c841b Added first VM entry method.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents: 1410
diff changeset
1180
4220
5c80ccb80036 Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4199
diff changeset
1181 int CompilerToVM_methods_count() {
5c80ccb80036 Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4199
diff changeset
1182 return sizeof(CompilerToVM_methods) / sizeof(JNINativeMethod);
1421
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
1183 }
3703
50a1d38cd7ac Add newlines at the end of files, otherwise my version of gcc complains
Christian Wimmer <christian.wimmer@oracle.com>
parents: 3701
diff changeset
1184