Mercurial > hg > graal-compiler
annotate src/share/vm/graal/graalCompilerToVM.cpp @ 14069:2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 05 Mar 2014 19:07:29 +0100 |
parents | 361acb279104 |
children | dd783f0ecf17 |
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" |
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
|
25 #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
|
26 #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
|
27 #include "oops/fieldStreams.hpp" |
12356
359f7e70ae7f
Reduce HotSpot diff and fix previous merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11852
diff
changeset
|
28 #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
|
29 #include "runtime/javaCalls.hpp" |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
7094
diff
changeset
|
30 #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
|
31 #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
|
32 #include "compiler/compilerOracle.hpp" |
7735 | 33 #include "compiler/disassembler.hpp" |
4222
8e2985cdaaa5
Renaming of VMExits and VMEntries part 3.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4220
diff
changeset
|
34 #include "graal/graalCompilerToVM.hpp" |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
35 #include "graal/graalCompiler.hpp" |
3637
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3636
diff
changeset
|
36 #include "graal/graalEnv.hpp" |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
37 #include "graal/graalJavaAccess.hpp" |
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2890
diff
changeset
|
38 #include "graal/graalCodeInstaller.hpp" |
4222
8e2985cdaaa5
Renaming of VMExits and VMEntries part 3.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4220
diff
changeset
|
39 #include "graal/graalVMToCompiler.hpp" |
8490
1567c6cc6561
Towards porting G1 WBs
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8489
diff
changeset
|
40 #include "gc_implementation/g1/heapRegion.hpp" |
12559
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
41 #include "runtime/javaCalls.hpp" |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
42 #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
|
43 #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
|
44 |
1414
e1a275dbc8cd
Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1413
diff
changeset
|
45 |
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
|
46 Method* getMethodFromHotSpotMethod(oop hotspot_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
|
47 assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotResolvedJavaMethod::klass()), "sanity"); |
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
|
48 return asMethod(HotSpotResolvedJavaMethod::metaspaceMethod(hotspot_method)); |
4446 | 49 } |
50 | |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
51 // 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
|
52 #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
|
53 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
|
54 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
|
55 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
|
56 |
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
57 // 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
|
58 // 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
|
59 #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
|
60 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
|
61 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
|
62 |
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
63 #define C2V_END } |
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
64 |
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
|
65 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
|
66 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
|
67 ResourceMark rm; |
8945
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
8613
diff
changeset
|
68 |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1422
diff
changeset
|
69 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
|
70 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
|
71 |
11519
a3b39ab7c453
Make is_rewritten a guarantee in initializeBytecode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11513
diff
changeset
|
72 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
|
73 // 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
|
74 |
11513
8d4e5e08d83f
Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11381
diff
changeset
|
75 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
|
76 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
|
77 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
|
78 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
|
79 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
|
80 |
11513
8d4e5e08d83f
Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11381
diff
changeset
|
81 // 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
|
82 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
|
83 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
|
84 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
|
85 } |
10567 | 86 |
11519
a3b39ab7c453
Make is_rewritten a guarantee in initializeBytecode
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11513
diff
changeset
|
87 if (len > 1) { |
10567 | 88 // Restore the big-endian constant pool indexes. |
89 // Cf. Rewriter::scan_method | |
90 switch (code) { | |
91 case Bytecodes::_getstatic: | |
92 case Bytecodes::_putstatic: | |
93 case Bytecodes::_getfield: | |
94 case Bytecodes::_putfield: | |
95 case Bytecodes::_invokevirtual: | |
96 case Bytecodes::_invokespecial: | |
97 case Bytecodes::_invokestatic: | |
98 case Bytecodes::_invokeinterface: | |
99 case Bytecodes::_invokehandle: { | |
100 int cp_index = Bytes::get_native_u2((address) &reconstituted_code[bci + 1]); | |
101 Bytes::put_Java_u2((address) &reconstituted_code[bci + 1], (u2) cp_index); | |
102 break; | |
103 } | |
104 | |
105 case Bytecodes::_invokedynamic: | |
106 int cp_index = Bytes::get_native_u4((address) &reconstituted_code[bci + 1]); | |
107 Bytes::put_Java_u4((address) &reconstituted_code[bci + 1], (u4) cp_index); | |
108 break; | |
109 } | |
110 | |
111 // Not all ldc byte code are rewritten. | |
112 switch (raw_code) { | |
113 case Bytecodes::_fast_aldc: { | |
114 int cpc_index = reconstituted_code[bci + 1] & 0xff; | |
115 int cp_index = method->constants()->object_to_cp_index(cpc_index); | |
116 assert(cp_index < method->constants()->length(), "sanity check"); | |
117 reconstituted_code[bci + 1] = (jbyte) cp_index; | |
118 break; | |
119 } | |
120 | |
121 case Bytecodes::_fast_aldc_w: { | |
122 int cpc_index = Bytes::get_native_u2((address) &reconstituted_code[bci + 1]); | |
123 int cp_index = method->constants()->object_to_cp_index(cpc_index); | |
124 assert(cp_index < method->constants()->length(), "sanity check"); | |
125 Bytes::put_Java_u2((address) &reconstituted_code[bci + 1], (u2) cp_index); | |
126 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
|
127 } |
5154
ae72dd38eeb1
bugfix, parallel GC seems stable
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5150
diff
changeset
|
128 } |
5150
fdd9dd4508fa
some GC fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5130
diff
changeset
|
129 } |
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
|
130 } |
5150
fdd9dd4508fa
some GC fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5130
diff
changeset
|
131 |
11513
8d4e5e08d83f
Fix graalCompilerToVM::initializeBytecode regarding bytecode rewritting for methods that are not rewritten.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11381
diff
changeset
|
132 env->SetByteArrayRegion(result, 0, code_size, reconstituted_code); |
5150
fdd9dd4508fa
some GC fixes
Christian Haeubl <christian.haeubl@oracle.com>
parents:
5130
diff
changeset
|
133 |
1413
1ecc8f0aad00
Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1412
diff
changeset
|
134 return result; |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
135 C2V_END |
1414
e1a275dbc8cd
Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1413
diff
changeset
|
136 |
13305
a63d65b682a8
moved most HotSpotResolvedJavaMethod.getExceptionHandlers logic to Java
twisti
parents:
13295
diff
changeset
|
137 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
|
138 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
|
139 methodHandle method = asMethod(metaspace_method); |
13305
a63d65b682a8
moved most HotSpotResolvedJavaMethod.getExceptionHandlers logic to Java
twisti
parents:
13295
diff
changeset
|
140 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
|
141 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
|
142 C2V_END |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
143 |
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
|
144 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
|
145 |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
146 // 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
|
147 methodHandle method(THREAD, asMethod(metaspace_method)); |
3559
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
148 assert(method->has_monitor_bytecodes(), "should have checked this"); |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
149 |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
150 // Check to see if a previous compilation computed the monitor-matching analysis. |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
151 if (method->guaranteed_monitor_matching()) { |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
152 return true; |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
153 } |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
154 |
1433
efba53f86c4f
various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1432
diff
changeset
|
155 { |
3559
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
156 EXCEPTION_MARK; |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
157 ResourceMark rm(THREAD); |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
158 GeneratePairingInfo gpi(method); |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
159 gpi.compute_map(CATCH); |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
160 if (!gpi.monitor_safe()) { |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
161 return false; |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
162 } |
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
163 method->set_guaranteed_monitor_matching(); |
1433
efba53f86c4f
various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1432
diff
changeset
|
164 } |
3559
f70a4cc629e7
remove some dependencies on ci interface
Lukas Stadler <lukas.stadler@jku.at>
parents:
3555
diff
changeset
|
165 return true; |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
166 C2V_END |
1433
efba53f86c4f
various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1432
diff
changeset
|
167 |
13264
b23cbfb4366a
merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents:
13263
diff
changeset
|
168 C2V_VMENTRY(jlong, getMetaspaceMethod, (JNIEnv *, jobject, jclass holder_handle, jint slot)) |
b23cbfb4366a
merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents:
13263
diff
changeset
|
169 oop java_class = JNIHandles::resolve(holder_handle); |
b23cbfb4366a
merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents:
13263
diff
changeset
|
170 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
|
171 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
|
172 return (jlong) (address) method(); |
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7037
diff
changeset
|
173 } |
34753b057324
added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
7037
diff
changeset
|
174 |
13373
430c9f08728d
moved most CompilerToVM.getUniqueConcreteMethod logic up to Java and replace getUniqueConcreteMethod with findUniqueConcreteMethod
twisti
parents:
13364
diff
changeset
|
175 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
|
176 methodHandle method = asMethod(metaspace_method); |
3653
6aef50c6d967
Handlize to fix GC issue.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3650
diff
changeset
|
177 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
|
178 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
|
179 ResourceMark rm; |
430c9f08728d
moved most CompilerToVM.getUniqueConcreteMethod logic up to Java and replace getUniqueConcreteMethod with findUniqueConcreteMethod
twisti
parents:
13364
diff
changeset
|
180 MutexLocker locker(Compile_lock); |
430c9f08728d
moved most CompilerToVM.getUniqueConcreteMethod logic up to Java and replace getUniqueConcreteMethod with findUniqueConcreteMethod
twisti
parents:
13364
diff
changeset
|
181 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
|
182 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
|
183 C2V_END |
2049
7e09ea4a8f36
Added leaf method assumptions.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
2048
diff
changeset
|
184 |
13478
fe03864a2c72
replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents:
13461
diff
changeset
|
185 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
|
186 InstanceKlass* klass = (InstanceKlass*) asKlass(metaspace_klass); |
fe03864a2c72
replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents:
13461
diff
changeset
|
187 return (jlong) (address) klass->implementor(); |
7226 | 188 C2V_END |
189 | |
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
|
190 C2V_VMENTRY(void, initializeMethod,(JNIEnv *, jobject, jlong metaspace_method, jobject hotspot_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
|
191 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
|
192 InstanceKlass::cast(HotSpotResolvedJavaMethod::klass())->initialize(CHECK); |
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
|
193 HotSpotResolvedJavaMethod::set_exceptionHandlerCount(hotspot_method, method->exception_table_length()); |
9416 | 194 HotSpotResolvedJavaMethod::set_callerSensitive(hotspot_method, method->caller_sensitive()); |
195 HotSpotResolvedJavaMethod::set_forceInline(hotspot_method, method->force_inline()); | |
196 HotSpotResolvedJavaMethod::set_dontInline(hotspot_method, method->dont_inline()); | |
197 HotSpotResolvedJavaMethod::set_ignoredBySecurityStackWalk(hotspot_method, 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
|
198 C2V_END |
2926
0e3ec0a4eda4
RiTypeProfile information and invocation counters for RiMethods
Lukas Stadler <lukas.stadler@jku.at>
parents:
2901
diff
changeset
|
199 |
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
|
200 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
|
201 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
|
202 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
|
203 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
|
204 |
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
|
205 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
|
206 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
|
207 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
|
208 C2V_END |
4441
4e3aaf14cbc6
fixed graal to hotspot
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4439
diff
changeset
|
209 |
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
|
210 C2V_ENTRY(jint, getCompiledCodeSize, (JNIEnv *env, jobject, jlong 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
|
211 nmethod* code = (asMethod(metaspace_method))->code(); |
4528
e6e14d25e608
added two inlining policies for comparison
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4475
diff
changeset
|
212 return code == NULL ? 0 : code->insts_size(); |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
213 C2V_END |
4528
e6e14d25e608
added two inlining policies for comparison
Christian Haeubl <christian.haeubl@oracle.com>
parents:
4475
diff
changeset
|
214 |
13483
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
215 C2V_VMENTRY(jlong, lookupType, (JNIEnv *env, jobject, jstring jname, jclass accessing_class, jboolean eagerResolve)) |
3650
0e8a2a629afb
Pass-by compilation broker.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3649
diff
changeset
|
216 ResourceMark rm; |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1422
diff
changeset
|
217 Handle name = JNIHandles::resolve(jname); |
13483
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
218 Symbol* class_name = java_lang_String::as_symbol(name, THREAD); |
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
219 assert(class_name != NULL, "name to symbol creation failed"); |
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
220 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
|
221 |
13483
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
222 Klass* resolved_klass = NULL; |
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
223 Handle class_loader; |
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
224 Handle protection_domain; |
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
225 if (JNIHandles::resolve(accessing_class) != NULL) { |
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
226 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
|
227 class_loader = accessing_klass->class_loader(); |
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
228 protection_domain = accessing_klass->protection_domain(); |
13258
fdd6ef90d66d
move HotSpotResolvedPrimitiveType's from VMToCompilerImpl to HotSpotGraalRuntime
twisti
parents:
13254
diff
changeset
|
229 } |
fdd6ef90d66d
move HotSpotResolvedPrimitiveType's from VMToCompilerImpl to HotSpotGraalRuntime
twisti
parents:
13254
diff
changeset
|
230 |
fdd6ef90d66d
move HotSpotResolvedPrimitiveType's from VMToCompilerImpl to HotSpotGraalRuntime
twisti
parents:
13254
diff
changeset
|
231 if (eagerResolve) { |
13483
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
232 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
|
233 } else { |
13483
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
234 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
|
235 } |
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
|
236 |
13483
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
237 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
|
238 C2V_END |
1414
e1a275dbc8cd
Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1413
diff
changeset
|
239 |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13258
diff
changeset
|
240 C2V_VMENTRY(jobject, lookupConstantInPool, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index)) |
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13258
diff
changeset
|
241 ConstantPool* cp = (ConstantPool*) metaspace_constant_pool; |
1413
1ecc8f0aad00
Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1412
diff
changeset
|
242 oop result = NULL; |
1ecc8f0aad00
Draft implementation of HotSpot CRI / first method compiling without exception.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1412
diff
changeset
|
243 constantTag tag = cp->tag_at(index); |
9584 | 244 switch (tag.value()) { |
245 case JVM_CONSTANT_String: | |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
13241
diff
changeset
|
246 result = cp->resolve_possibly_cached_constant_at(index, CHECK_NULL); |
9584 | 247 break; |
248 case JVM_CONSTANT_MethodHandle: | |
249 case JVM_CONSTANT_MethodHandleInError: | |
250 case JVM_CONSTANT_MethodType: | |
251 case JVM_CONSTANT_MethodTypeInError: | |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
13241
diff
changeset
|
252 result = cp->resolve_constant_at(index, CHECK_NULL); |
9584 | 253 break; |
254 default: | |
255 fatal(err_msg_res("unknown constant pool tag %s at cpi %d in %s", tag.internal_name(), index, cp->pool_holder()->name()->as_C_string())); | |
1414
e1a275dbc8cd
Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1413
diff
changeset
|
256 } |
e1a275dbc8cd
Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1413
diff
changeset
|
257 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
|
258 C2V_END |
1414
e1a275dbc8cd
Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1413
diff
changeset
|
259 |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
14012
diff
changeset
|
260 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
|
261 constantPoolHandle cp = (ConstantPool*) metaspace_constant_pool; |
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13258
diff
changeset
|
262 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
|
263 return JNIHandles::make_local(THREAD, appendix_oop); |
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
8613
diff
changeset
|
264 C2V_END |
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
8613
diff
changeset
|
265 |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
266 C2V_VMENTRY(jlong, lookupMethodInPool, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index, jbyte opcode, jlongArray unresolvedInfo_handle)) |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13258
diff
changeset
|
267 constantPoolHandle cp = (ConstantPool*) metaspace_constant_pool; |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3669
diff
changeset
|
268 instanceKlassHandle pool_holder(cp->pool_holder()); |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1422
diff
changeset
|
269 |
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
|
270 Bytecodes::Code bc = (Bytecodes::Code) (((int) opcode) & 0xFF); |
8945
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
8613
diff
changeset
|
271 |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
14012
diff
changeset
|
272 methodHandle method = GraalEnv::get_method_by_index(cp, index, bc, pool_holder); |
3648
81ad8ab1f9fe
Remove ci usage on method lookup.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3647
diff
changeset
|
273 if (!method.is_null()) { |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
274 return (jlong) method(); |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
275 } else { |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
276 // Get the unresolved method's name and signature. |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
277 typeArrayOop unresolvedInfo = (typeArrayOop) JNIHandles::resolve(unresolvedInfo_handle); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
278 assert(unresolvedInfo != NULL && unresolvedInfo->length() == 4, "must be"); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
279 unresolvedInfo->long_at_put(0, (jlong) cp->name_ref_at(index)); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
280 unresolvedInfo->long_at_put(1, (jlong) cp->signature_ref_at(index)); |
8945
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
8613
diff
changeset
|
281 Handle type; |
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
8613
diff
changeset
|
282 if (bc != Bytecodes::_invokedynamic) { |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
14012
diff
changeset
|
283 int holder_index = cp->klass_ref_index_at(index); |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
284 Symbol* klass_name = NULL; |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
285 KlassHandle klass = GraalCompiler::get_Klass(cp, holder_index, cp->pool_holder(), klass_name); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
286 unresolvedInfo->long_at_put(2, (jlong) klass_name); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
287 unresolvedInfo->long_at_put(3, (jlong) klass()); |
8945
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
8613
diff
changeset
|
288 } else { |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
289 unresolvedInfo->long_at_put(3, (jlong) SystemDictionary::MethodHandle_klass()); |
8945
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
8613
diff
changeset
|
290 } |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
291 return 0L; |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
292 } |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
293 C2V_END |
1414
e1a275dbc8cd
Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1413
diff
changeset
|
294 |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
295 C2V_VMENTRY(jlong, lookupTypeInPool, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index, jlongArray unresolvedTypeName_handle)) |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13258
diff
changeset
|
296 ConstantPool* cp = (ConstantPool*) metaspace_constant_pool; |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
297 Symbol* klass_name = NULL; |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
298 KlassHandle klass = GraalCompiler::get_Klass(cp, index, cp->pool_holder(), klass_name); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
299 typeArrayOop unresolvedTypeName = (typeArrayOop) JNIHandles::resolve(unresolvedTypeName_handle); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
300 unresolvedTypeName->long_at_put(0, (jlong) klass_name); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
301 return (jlong) klass(); |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
302 C2V_END |
1414
e1a275dbc8cd
Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1413
diff
changeset
|
303 |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
304 C2V_VMENTRY(void, loadReferencedTypeInPool, (JNIEnv *env, jobject, jlong metaspace_constant_pool, jint index, jbyte op)) |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13258
diff
changeset
|
305 ConstantPool* cp = (ConstantPool*) metaspace_constant_pool; |
9011
23762f2438b6
support for compiling LambdaForm invocations (invokevirtual instructions that were rewritten to invokehandle instructions)
Doug Simon <doug.simon@oracle.com>
parents:
8996
diff
changeset
|
306 Bytecodes::Code bc = (Bytecodes::Code) (((int) op) & 0xFF); |
23762f2438b6
support for compiling LambdaForm invocations (invokevirtual instructions that were rewritten to invokehandle instructions)
Doug Simon <doug.simon@oracle.com>
parents:
8996
diff
changeset
|
307 if (bc != Bytecodes::_checkcast && bc != Bytecodes::_instanceof && bc != Bytecodes::_new && bc != Bytecodes::_anewarray |
23762f2438b6
support for compiling LambdaForm invocations (invokevirtual instructions that were rewritten to invokehandle instructions)
Doug Simon <doug.simon@oracle.com>
parents:
8996
diff
changeset
|
308 && bc != Bytecodes::_multianewarray && bc != Bytecodes::_ldc && bc != Bytecodes::_ldc_w && bc != Bytecodes::_ldc2_w) |
4316
b4b16e4e043f
Fix eager resolving for class constants
Peter Hofer <peter.hofer@jku.at>
parents:
4297
diff
changeset
|
309 { |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
14012
diff
changeset
|
310 index = cp->remap_instruction_operand_from_cache(index); |
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
|
311 } |
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
|
312 constantTag tag = cp->tag_at(index); |
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
|
313 if (tag.is_field_or_method()) { |
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
|
314 index = cp->uncached_klass_ref_index_at(index); |
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
|
315 tag = cp->tag_at(index); |
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
|
316 } |
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
|
317 |
4176
a428df0139f3
Initialize resolved as well as unresolved classes in the native implementation of HotSpotConstantPool.loadReferencedType()
Peter Hofer <peter.hofer@jku.at>
parents:
4139
diff
changeset
|
318 if (tag.is_unresolved_klass() || tag.is_klass()) { |
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 Klass* klass = cp->klass_at(index, CHECK); |
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
|
320 if (klass->oop_is_instance()) { |
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
|
321 InstanceKlass::cast(klass)->initialize(CHECK); |
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
|
322 } |
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
|
323 } |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
324 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
|
325 |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
326 C2V_VMENTRY(jboolean, lookupFieldInPool, (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
|
327 ResourceMark rm; |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1422
diff
changeset
|
328 |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13258
diff
changeset
|
329 constantPoolHandle cp = (ConstantPool*) metaspace_constant_pool; |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1422
diff
changeset
|
330 |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
14012
diff
changeset
|
331 int nt_index = cp->name_and_type_ref_index_at(index); |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
332 int type_index = cp->signature_ref_index_at(nt_index); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
333 Symbol* type_name = cp->symbol_at(type_index); |
3649
5a8c44b5fb80
Remove ci usage on field lookup.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3648
diff
changeset
|
334 int name_index = cp->name_ref_index_at(nt_index); |
5a8c44b5fb80
Remove ci usage on field lookup.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3648
diff
changeset
|
335 Symbol* name = cp->symbol_at(name_index); |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
14012
diff
changeset
|
336 int holder_index = cp->klass_ref_index_at(index); |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
337 Symbol* holder_name = NULL; |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
338 KlassHandle holder = GraalCompiler::get_Klass(cp, holder_index, cp->pool_holder(), holder_name); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
339 KlassHandle type = GraalCompiler::get_KlassFromSignature(type_name, cp->pool_holder()); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
340 typeArrayOop info = (typeArrayOop) JNIHandles::resolve(info_handle); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
341 assert(info != NULL && info->length() == 7, "must be"); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
342 info->long_at_put(0, (jlong) name); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
343 info->long_at_put(1, (jlong) type_name); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
344 info->long_at_put(2, (jlong) type()); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
345 info->long_at_put(3, (jlong) holder_name); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
346 info->long_at_put(4, (jlong) holder()); |
8945
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
8613
diff
changeset
|
347 |
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
|
348 Bytecodes::Code code = (Bytecodes::Code)(((int) opcode) & 0xFF); |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
349 if (!holder.is_null()) { |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
350 int offset = -1; |
12356
359f7e70ae7f
Reduce HotSpot diff and fix previous merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11852
diff
changeset
|
351 fieldDescriptor result; |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
14012
diff
changeset
|
352 LinkResolver::resolve_field_access(result, cp, index, Bytecodes::java_code(code), true, false, Thread::current()); |
12356
359f7e70ae7f
Reduce HotSpot diff and fix previous merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11852
diff
changeset
|
353 |
3637
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3636
diff
changeset
|
354 if (HAS_PENDING_EXCEPTION) { |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3636
diff
changeset
|
355 CLEAR_PENDING_EXCEPTION; |
3655
2a0cb564e470
Do not use result when resolve_field throws an exception.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3653
diff
changeset
|
356 } else { |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
357 info->long_at_put(4, (jlong) result.field_holder()); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
358 info->long_at_put(5, (jlong) result.access_flags().as_int()); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
359 info->long_at_put(6, (jlong) result.offset()); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
360 return true; |
3637
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3636
diff
changeset
|
361 } |
ff6a991c6e3c
Use GraalEnv to look up types.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3636
diff
changeset
|
362 } |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
363 return false; |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
364 C2V_END |
1414
e1a275dbc8cd
Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1413
diff
changeset
|
365 |
13374
ad187607b784
make CompilerToVM.resolveMethod return a metadata method instead of a Java type
twisti
parents:
13373
diff
changeset
|
366 C2V_VMENTRY(jlong, resolveMethod, (JNIEnv *, jobject, jobject resolved_type, jstring name, jstring signature)) |
1942
00bc9eaf0e24
Support for -XX:+UseFastLocking flag. Fixed monitor enter XIR template for correct debug info at the runtime call.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1941
diff
changeset
|
367 assert(JNIHandles::resolve(resolved_type) != NULL, ""); |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13260
diff
changeset
|
368 Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaClass(resolved_type)); |
7812
a42dc71ad051
Remove usages of VmIds.toSymbol.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7811
diff
changeset
|
369 Symbol* name_symbol = java_lang_String::as_symbol(JNIHandles::resolve(name), THREAD); |
a42dc71ad051
Remove usages of VmIds.toSymbol.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7811
diff
changeset
|
370 Symbol* signature_symbol = java_lang_String::as_symbol(JNIHandles::resolve(signature), THREAD); |
13374
ad187607b784
make CompilerToVM.resolveMethod return a metadata method instead of a Java type
twisti
parents:
13373
diff
changeset
|
371 Method* method = klass->lookup_method(name_symbol, signature_symbol); |
ad187607b784
make CompilerToVM.resolveMethod return a metadata method instead of a Java type
twisti
parents:
13373
diff
changeset
|
372 if (method == NULL) { |
2901
d577d07cedec
Added time measurement for phases.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2891
diff
changeset
|
373 if (TraceGraal >= 3) { |
1477
30e1f67703da
Fix for failed method lookup.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1470
diff
changeset
|
374 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
|
375 tty->print_cr("Could not resolve method %s %s on klass %s", name_symbol->as_C_string(), signature_symbol->as_C_string(), klass->name()->as_C_string()); |
1477
30e1f67703da
Fix for failed method lookup.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1470
diff
changeset
|
376 } |
13374
ad187607b784
make CompilerToVM.resolveMethod return a metadata method instead of a Java type
twisti
parents:
13373
diff
changeset
|
377 return 0; |
1477
30e1f67703da
Fix for failed method lookup.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1470
diff
changeset
|
378 } |
13374
ad187607b784
make CompilerToVM.resolveMethod return a metadata method instead of a Java type
twisti
parents:
13373
diff
changeset
|
379 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
|
380 C2V_END |
1414
e1a275dbc8cd
Executing a+b with C1X on HotSpot ;-) !
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1413
diff
changeset
|
381 |
9126
bc26f978b0ce
HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
Bernhard Urban <bernhard.urban@jku.at>
parents:
9108
diff
changeset
|
382 C2V_VMENTRY(jboolean, hasFinalizableSubclass,(JNIEnv *, jobject, jobject hotspot_klass)) |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13260
diff
changeset
|
383 Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaClass(hotspot_klass)); |
9126
bc26f978b0ce
HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
Bernhard Urban <bernhard.urban@jku.at>
parents:
9108
diff
changeset
|
384 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
|
385 return Dependencies::find_finalizable_subclass(klass) != NULL; |
bc26f978b0ce
HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
Bernhard Urban <bernhard.urban@jku.at>
parents:
9108
diff
changeset
|
386 C2V_END |
bc26f978b0ce
HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
Bernhard Urban <bernhard.urban@jku.at>
parents:
9108
diff
changeset
|
387 |
13295
903fd774dd61
simplified implementation of HotSpotResolvedObjectType.getClassInitializer()
Doug Simon <doug.simon@oracle.com>
parents:
13264
diff
changeset
|
388 C2V_VMENTRY(jlong, getClassInitializer, (JNIEnv *, jobject, jobject klass)) |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13260
diff
changeset
|
389 instanceKlassHandle k(THREAD, java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaClass(klass))); |
13295
903fd774dd61
simplified implementation of HotSpotResolvedObjectType.getClassInitializer()
Doug Simon <doug.simon@oracle.com>
parents:
13264
diff
changeset
|
390 Method* clinit = k->class_initializer(); |
903fd774dd61
simplified implementation of HotSpotResolvedObjectType.getClassInitializer()
Doug Simon <doug.simon@oracle.com>
parents:
13264
diff
changeset
|
391 return (jlong) (address) clinit; |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
392 C2V_END |
3090
536528f48708
more escape analysis work: debug info
Lukas Stadler <lukas.stadler@jku.at>
parents:
3055
diff
changeset
|
393 |
9649 | 394 C2V_VMENTRY(jlong, getMaxCallTargetOffset, (JNIEnv *env, jobject, jlong addr)) |
395 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
|
396 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
|
397 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
|
398 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
|
399 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
|
400 } |
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
|
401 return -1; |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
402 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
|
403 |
1433
efba53f86c4f
various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1432
diff
changeset
|
404 |
efba53f86c4f
various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1432
diff
changeset
|
405 // helpers used to set fields in the HotSpotVMConfig object |
efba53f86c4f
various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1432
diff
changeset
|
406 jfieldID getFieldID(JNIEnv* env, jobject obj, const char* name, const char* sig) { |
efba53f86c4f
various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1432
diff
changeset
|
407 jfieldID id = env->GetFieldID(env->GetObjectClass(obj), name, sig); |
efba53f86c4f
various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1432
diff
changeset
|
408 if (id == NULL) { |
3552
aa7b62997aa0
better error message of field not found
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
3549
diff
changeset
|
409 fatal(err_msg("field not found: %s (%s)", name, sig)); |
1433
efba53f86c4f
various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1432
diff
changeset
|
410 } |
efba53f86c4f
various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1432
diff
changeset
|
411 return id; |
efba53f86c4f
various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1432
diff
changeset
|
412 } |
1429
abc670a709dc
* -XX:TraceC1X=0...5 controls the native c1x tracing
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1428
diff
changeset
|
413 |
12535
cee7f686c470
rename CompilerToVm.dontInline to doNotInlineOrCompile
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
12533
diff
changeset
|
414 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
|
415 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
|
416 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
|
417 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
|
418 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
|
419 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
|
420 |
12559
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
421 extern "C" { |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
422 extern VMStructEntry* gHotSpotVMStructs; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
423 extern uint64_t gHotSpotVMStructEntryTypeNameOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
424 extern uint64_t gHotSpotVMStructEntryFieldNameOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
425 extern uint64_t gHotSpotVMStructEntryTypeStringOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
426 extern uint64_t gHotSpotVMStructEntryIsStaticOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
427 extern uint64_t gHotSpotVMStructEntryOffsetOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
428 extern uint64_t gHotSpotVMStructEntryAddressOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
429 extern uint64_t gHotSpotVMStructEntryArrayStride; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
430 |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
431 extern VMTypeEntry* gHotSpotVMTypes; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
432 extern uint64_t gHotSpotVMTypeEntryTypeNameOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
433 extern uint64_t gHotSpotVMTypeEntrySuperclassNameOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
434 extern uint64_t gHotSpotVMTypeEntryIsOopTypeOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
435 extern uint64_t gHotSpotVMTypeEntryIsIntegerTypeOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
436 extern uint64_t gHotSpotVMTypeEntryIsUnsignedOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
437 extern uint64_t gHotSpotVMTypeEntrySizeOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
438 extern uint64_t gHotSpotVMTypeEntryArrayStride; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
439 |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
440 extern VMIntConstantEntry* gHotSpotVMIntConstants; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
441 extern uint64_t gHotSpotVMIntConstantEntryNameOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
442 extern uint64_t gHotSpotVMIntConstantEntryValueOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
443 extern uint64_t gHotSpotVMIntConstantEntryArrayStride; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
444 |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
445 extern VMLongConstantEntry* gHotSpotVMLongConstants; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
446 extern uint64_t gHotSpotVMLongConstantEntryNameOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
447 extern uint64_t gHotSpotVMLongConstantEntryValueOffset; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
448 extern uint64_t gHotSpotVMLongConstantEntryArrayStride; |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
449 } |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
450 |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
451 C2V_ENTRY(void, initializeConfiguration, (JNIEnv *env, jobject, jobject config)) |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
452 |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
453 #define set_boolean(name, value) do { env->SetBooleanField(config, getFieldID(env, config, name, "Z"), value); } while (0) |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
454 #define set_int(name, value) do { env->SetIntField(config, getFieldID(env, config, name, "I"), value); } while (0) |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
455 #define set_long(name, value) do { env->SetLongField(config, getFieldID(env, config, name, "J"), value); } while (0) |
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
|
456 #define set_address(name, value) do { set_long(name, (jlong) value); } while (0) |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
457 |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
458 guarantee(HeapWordSize == sizeof(char*), "Graal assumption that HeadWordSize == machine word size is wrong"); |
9585 | 459 |
12559
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
460 set_address("gHotSpotVMStructs", gHotSpotVMStructs); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
461 set_long("gHotSpotVMStructEntryTypeNameOffset", gHotSpotVMStructEntryTypeNameOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
462 set_long("gHotSpotVMStructEntryFieldNameOffset", gHotSpotVMStructEntryFieldNameOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
463 set_long("gHotSpotVMStructEntryTypeStringOffset", gHotSpotVMStructEntryTypeStringOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
464 set_long("gHotSpotVMStructEntryIsStaticOffset", gHotSpotVMStructEntryIsStaticOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
465 set_long("gHotSpotVMStructEntryOffsetOffset", gHotSpotVMStructEntryOffsetOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
466 set_long("gHotSpotVMStructEntryAddressOffset", gHotSpotVMStructEntryAddressOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
467 set_long("gHotSpotVMStructEntryArrayStride", gHotSpotVMStructEntryArrayStride); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
468 |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
469 set_address("gHotSpotVMTypes", gHotSpotVMTypes); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
470 set_long("gHotSpotVMTypeEntryTypeNameOffset", gHotSpotVMTypeEntryTypeNameOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
471 set_long("gHotSpotVMTypeEntrySuperclassNameOffset", gHotSpotVMTypeEntrySuperclassNameOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
472 set_long("gHotSpotVMTypeEntryIsOopTypeOffset", gHotSpotVMTypeEntryIsOopTypeOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
473 set_long("gHotSpotVMTypeEntryIsIntegerTypeOffset", gHotSpotVMTypeEntryIsIntegerTypeOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
474 set_long("gHotSpotVMTypeEntryIsUnsignedOffset", gHotSpotVMTypeEntryIsUnsignedOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
475 set_long("gHotSpotVMTypeEntrySizeOffset", gHotSpotVMTypeEntrySizeOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
476 set_long("gHotSpotVMTypeEntryArrayStride", gHotSpotVMTypeEntryArrayStride); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
477 |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
478 set_address("gHotSpotVMIntConstants", gHotSpotVMIntConstants); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
479 set_long("gHotSpotVMIntConstantEntryNameOffset", gHotSpotVMIntConstantEntryNameOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
480 set_long("gHotSpotVMIntConstantEntryValueOffset", gHotSpotVMIntConstantEntryValueOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
481 set_long("gHotSpotVMIntConstantEntryArrayStride", gHotSpotVMIntConstantEntryArrayStride); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
482 |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
483 set_address("gHotSpotVMLongConstants", gHotSpotVMLongConstants); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
484 set_long("gHotSpotVMLongConstantEntryNameOffset", gHotSpotVMLongConstantEntryNameOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
485 set_long("gHotSpotVMLongConstantEntryValueOffset", gHotSpotVMLongConstantEntryValueOffset); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
486 set_long("gHotSpotVMLongConstantEntryArrayStride", gHotSpotVMLongConstantEntryArrayStride); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
487 |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
488 //------------------------------------------------------------------------------------------------ |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
489 |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
490 set_int("arrayLengthOffset", arrayOopDesc::length_offset_in_bytes()); |
12559
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
491 |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
492 set_int("extraStackEntries", Method::extra_stack_entries()); |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
493 |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
494 set_int("tlabAlignmentReserve", (int32_t)ThreadLocalAllocBuffer::alignment_reserve()); |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
495 set_long("heapTopAddress", (jlong)(address) Universe::heap()->top_addr()); |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
496 set_long("heapEndAddress", (jlong)(address) Universe::heap()->end_addr()); |
12559
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
497 |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
498 set_boolean("inlineContiguousAllocationSupported", !CMSIncrementalMode && Universe::heap()->supports_inline_contig_alloc()); |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1422
diff
changeset
|
499 |
9574
df3aa336a313
replaced verify_oop assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9562
diff
changeset
|
500 set_long("verifyOopMask", Universe::verify_oop_mask()); |
df3aa336a313
replaced verify_oop assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9562
diff
changeset
|
501 set_long("verifyOopBits", Universe::verify_oop_bits()); |
df3aa336a313
replaced verify_oop assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9562
diff
changeset
|
502 |
12559
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
503 set_int("instanceKlassVtableStartOffset", InstanceKlass::vtable_start_offset() * HeapWordSize); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
504 |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
505 //------------------------------------------------------------------------------------------------ |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
506 |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
507 set_address("handleDeoptStub", SharedRuntime::deopt_blob()->unpack()); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
508 set_address("uncommonTrapStub", SharedRuntime::deopt_blob()->uncommon_trap()); |
7147
88d626e2c2a8
added TLAB fast refill stub for array allocation
Doug Simon <doug.simon@oracle.com>
parents:
7145
diff
changeset
|
509 |
12559
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
510 set_address("registerFinalizerAddress", SharedRuntime::register_finalizer); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
511 set_address("exceptionHandlerForReturnAddressAddress", SharedRuntime::exception_handler_for_return_address); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
512 set_address("osrMigrationEndAddress", SharedRuntime::OSR_migration_end); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
513 |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
514 set_address("javaTimeMillisAddress", CAST_FROM_FN_PTR(address, os::javaTimeMillis)); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
515 set_address("javaTimeNanosAddress", CAST_FROM_FN_PTR(address, os::javaTimeNanos)); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
516 set_address("arithmeticSinAddress", CAST_FROM_FN_PTR(address, SharedRuntime::dsin)); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
517 set_address("arithmeticCosAddress", CAST_FROM_FN_PTR(address, SharedRuntime::dcos)); |
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
518 set_address("arithmeticTanAddress", CAST_FROM_FN_PTR(address, SharedRuntime::dtan)); |
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
|
519 |
9352
d4684b468e93
made NewInstanceStub a RuntimeStub that directly calls the C runtime (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9338
diff
changeset
|
520 set_address("newInstanceAddress", GraalRuntime::new_instance); |
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
|
521 set_address("newArrayAddress", GraalRuntime::new_array); |
9355
4e260c2ced0e
removed new_multi_array assembler stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9352
diff
changeset
|
522 set_address("newMultiArrayAddress", GraalRuntime::new_multi_array); |
10542
554f67e4ff3f
Use slow-path stub call instead of deopt in lowering of DynamicNewArrayNode.
Roland Schatz <roland.schatz@oracle.com>
parents:
10536
diff
changeset
|
523 set_address("dynamicNewArrayAddress", GraalRuntime::dynamic_new_array); |
13578
d8143c431d63
Add DynamicNewInstanceNode and use it to intrinsify Unsafe.allocateInstance
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13540
diff
changeset
|
524 set_address("dynamicNewInstanceAddress", GraalRuntime::dynamic_new_instance); |
9420
393d62a868da
replaced thread_is_interrupted assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9419
diff
changeset
|
525 set_address("threadIsInterruptedAddress", GraalRuntime::thread_is_interrupted); |
9471
5fa54bf57f8c
replaced exception_handler_nofpu assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9463
diff
changeset
|
526 set_address("vmMessageAddress", GraalRuntime::vm_message); |
9461
a14fef4fca7d
replaced identity_hash_code assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9421
diff
changeset
|
527 set_address("identityHashCodeAddress", GraalRuntime::identity_hash_code); |
9562
99ef9bcb3f32
replaced unwind_exception_call assembler stub with a compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9519
diff
changeset
|
528 set_address("exceptionHandlerForPcAddress", GraalRuntime::exception_handler_for_pc); |
9590
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9582
diff
changeset
|
529 set_address("monitorenterAddress", GraalRuntime::monitorenter); |
5f9c41cd3b1e
replaced monitorenter/monitorexit assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9582
diff
changeset
|
530 set_address("monitorexitAddress", GraalRuntime::monitorexit); |
9591
0381c7937e7a
replaced create_null_pointer_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9590
diff
changeset
|
531 set_address("createNullPointerExceptionAddress", GraalRuntime::create_null_exception); |
9592
efb8c1918ea5
replaced create_out_of_bounds_exception assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9591
diff
changeset
|
532 set_address("createOutOfBoundsExceptionAddress", GraalRuntime::create_out_of_bounds_exception); |
9593
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
533 set_address("logPrimitiveAddress", GraalRuntime::log_primitive); |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
534 set_address("logObjectAddress", GraalRuntime::log_object); |
a3b4bcc22313
replaced log_* assembler stubs with compiled stubs (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9592
diff
changeset
|
535 set_address("logPrintfAddress", GraalRuntime::log_printf); |
9594
743326387173
replaced vm_error assembler stub with compiled stub (GRAAL-81)
Doug Simon <doug.simon@oracle.com>
parents:
9593
diff
changeset
|
536 set_address("vmErrorAddress", GraalRuntime::vm_error); |
9820
1b60f639ac4b
implemented alternative implementation for loading the exception object from the thread at the start of an exception dispatcher
Doug Simon <doug.simon@oracle.com>
parents:
9760
diff
changeset
|
537 set_address("loadAndClearExceptionAddress", GraalRuntime::load_and_clear_exception); |
10434
8b22524df53b
Add G1 Barriers' foreign calls
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
10408
diff
changeset
|
538 set_address("writeBarrierPreAddress", GraalRuntime::write_barrier_pre); |
8b22524df53b
Add G1 Barriers' foreign calls
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
10408
diff
changeset
|
539 set_address("writeBarrierPostAddress", GraalRuntime::write_barrier_post); |
10953
97e282186b5b
Add heap sanity checker with premature hard crash for debugging write barriers
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
10916
diff
changeset
|
540 set_address("validateObject", GraalRuntime::validate_object); |
3683
345c3bbf9c3c
store RiCompiledMethod in nmethod and:
Lukas Stadler <lukas.stadler@jku.at>
parents:
3632
diff
changeset
|
541 |
12559
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
542 //------------------------------------------------------------------------------------------------ |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
543 |
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
|
544 set_int("graalCountersThreadOffset", in_bytes(JavaThread::graal_counters_offset())); |
13839 | 545 set_int("graalCountersSize", (jint) GraalCounterSize); |
13837
ed3a1471e133
Add the Graal Native Function Interface
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
13819
diff
changeset
|
546 |
ed3a1471e133
Add the Graal Native Function Interface
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
13819
diff
changeset
|
547 //------------------------------------------------------------------------------------------------ |
ed3a1471e133
Add the Graal Native Function Interface
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
13819
diff
changeset
|
548 |
13895
4731c1a0b1f3
consolidated GNFI code into graal.hotspot project and cleaned up the documentation and code
Doug Simon <doug.simon@oracle.com>
parents:
13871
diff
changeset
|
549 set_long("dllLoad", (jlong) os::dll_load); |
4731c1a0b1f3
consolidated GNFI code into graal.hotspot project and cleaned up the documentation and code
Doug Simon <doug.simon@oracle.com>
parents:
13871
diff
changeset
|
550 set_long("dllLookup", (jlong) os::dll_lookup); |
13837
ed3a1471e133
Add the Graal Native Function Interface
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
13819
diff
changeset
|
551 #if defined(TARGET_OS_FAMILY_bsd) || defined(TARGET_OS_FAMILY_linux) |
ed3a1471e133
Add the Graal Native Function Interface
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
13819
diff
changeset
|
552 set_long("rtldDefault", (jlong) RTLD_DEFAULT); |
ed3a1471e133
Add the Graal Native Function Interface
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
13819
diff
changeset
|
553 #endif |
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
|
554 |
7143
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
555 #undef set_boolean |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
556 #undef set_int |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
557 #undef set_long |
445193cc2a7d
added support for writing stubs in Java and wrote the TLAB fast refill stub
Doug Simon <doug.simon@oracle.com>
parents:
7126
diff
changeset
|
558 |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
559 C2V_END |
1412
9195b99c841b
Added first VM entry method.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1410
diff
changeset
|
560 |
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
|
561 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
|
562 ResourceMark rm; |
3670
f198b24093f3
put back in thread transitions.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3669
diff
changeset
|
563 HandleMark hm; |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9668
diff
changeset
|
564 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
|
565 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
|
566 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
|
567 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
|
568 |
13493
03bb0ee05409
made CodeInstaller subclassable and virtualized the methods for creating ScopeValues
Doug Simon <doug.simon@oracle.com>
parents:
13483
diff
changeset
|
569 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
|
570 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
|
571 |
8526
3a105dec912f
Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8513
diff
changeset
|
572 if (PrintCodeCacheOnCompilation) { |
3a105dec912f
Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8513
diff
changeset
|
573 stringStream s; |
3a105dec912f
Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8513
diff
changeset
|
574 // 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
|
575 { |
3a105dec912f
Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8513
diff
changeset
|
576 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
|
577 CodeCache::print_summary(&s, false); |
3a105dec912f
Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8513
diff
changeset
|
578 } |
3a105dec912f
Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8513
diff
changeset
|
579 ttyLocker ttyl; |
3a105dec912f
Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8513
diff
changeset
|
580 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
|
581 } |
3a105dec912f
Respect the PrintCodeCacheOnCompilation flag in the graal compiler
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8513
diff
changeset
|
582 |
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
|
583 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
|
584 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
|
585 } 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
|
586 if (!installed_code_handle.is_null()) { |
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
|
587 assert(installed_code_handle->is_a(HotSpotInstalledCode::klass()), "wrong type"); |
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
|
588 HotSpotInstalledCode::set_codeBlob(installed_code_handle, (jlong) cb); |
10577
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10567
diff
changeset
|
589 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
|
590 if (comp_result->is_a(ExternalCompilationResult::klass())) { |
10879
d55f24eac4b1
PTX support for Linux
Morris Meyer <morris.meyer@oracle.com>
parents:
10772
diff
changeset
|
591 if (TraceGPUInteraction) { |
10588
b0b368d38b40
CR-1032 - change ExternalCompilationResult kernel -> entryPoint
Morris Meyer <morris.meyer@oracle.com>
parents:
10577
diff
changeset
|
592 tty->print_cr("installCode0: ExternalCompilationResult"); |
b0b368d38b40
CR-1032 - change ExternalCompilationResult kernel -> entryPoint
Morris Meyer <morris.meyer@oracle.com>
parents:
10577
diff
changeset
|
593 } |
11381
001c41b01d13
HotSpotInstalledCode: moved getCode to Java and added the ability to get the whole blob
twisti
parents:
11238
diff
changeset
|
594 HotSpotInstalledCode::set_codeStart(installed_code_handle, ExternalCompilationResult::entryPoint(comp_result)); |
10577
9c7d9e2c8326
PTX kernel execution - no args or return value
Morris Meyer <morris.meyer@oracle.com>
parents:
10567
diff
changeset
|
595 } else { |
11381
001c41b01d13
HotSpotInstalledCode: moved getCode to Java and added the ability to get the whole blob
twisti
parents:
11238
diff
changeset
|
596 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
|
597 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
|
598 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
|
599 } |
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
|
600 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
|
601 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
|
602 } |
3683
345c3bbf9c3c
store RiCompiledMethod in nmethod and:
Lukas Stadler <lukas.stadler@jku.at>
parents:
3632
diff
changeset
|
603 } |
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
|
604 return result; |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
605 C2V_END |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1422
diff
changeset
|
606 |
13103
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
607 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
|
608 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
|
609 |
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
610 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
|
611 if (osr) { |
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
612 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
|
613 } else { |
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
614 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
|
615 } |
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
616 Handle installed_code_handle = JNIHandles::resolve(installed_code); |
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
617 stats->_nmethods_size += HotSpotInstalledCode::size(installed_code_handle); |
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
618 stats->_nmethods_code_size += HotSpotInstalledCode::codeSize(installed_code_handle); |
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
619 |
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
620 if (CITimeEach) { |
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
621 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
|
622 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
|
623 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
|
624 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
|
625 } |
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
626 C2V_END |
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
627 |
13364
5a4293f24642
added -G:PrintCompRate option for periodically printing out the current compilation rate
Doug Simon <doug.simon@oracle.com>
parents:
13306
diff
changeset
|
628 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
|
629 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
|
630 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
|
631 |
13103
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
632 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
|
633 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
|
634 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
|
635 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
|
636 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
|
637 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
|
638 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
|
639 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
|
640 C2V_END |
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
641 |
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
|
642 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
|
643 ResourceMark rm; |
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8348
diff
changeset
|
644 HandleMark hm; |
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8348
diff
changeset
|
645 |
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
|
646 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
|
647 if (cb == NULL) { |
8349
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8348
diff
changeset
|
648 return NULL; |
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8348
diff
changeset
|
649 } |
8d6ea1915d42
merged CodeInfo into InstalledCode (GRAAL-156)
Doug Simon <doug.simon@oracle.com>
parents:
8348
diff
changeset
|
650 |
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
|
651 // 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
|
652 // 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
|
653 // 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
|
654 // 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
|
655 // 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
|
656 // 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
|
657 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
|
658 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
|
659 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
|
660 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
|
661 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
|
662 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
|
663 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
|
664 } |
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 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
|
666 } 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
|
667 Disassembler::decode(cb, &st); |
7784
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7760
diff
changeset
|
668 } |
13772
284aea4028ca
Fix: HotSpotDisassemblerProvider should return null when the code could not be disassembled.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13769
diff
changeset
|
669 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
|
670 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
|
671 } |
7784
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7760
diff
changeset
|
672 |
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7760
diff
changeset
|
673 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
|
674 return JNIHandles::make_local(result()); |
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7760
diff
changeset
|
675 C2V_END |
016e23829147
added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents:
7760
diff
changeset
|
676 |
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
|
677 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
|
678 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
|
679 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
|
680 |
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
|
681 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
|
682 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
|
683 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
|
684 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
|
685 |
10475
3489047ffea2
Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10434
diff
changeset
|
686 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
|
687 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
|
688 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
|
689 |
10475
3489047ffea2
Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10434
diff
changeset
|
690 jlong nmethodValue = HotSpotInstalledCode::codeBlob(hotspotInstalledCode); |
13698
c3370b2e1cbc
added check for invalidated code in executeCompiledMethodVarargs
Doug Simon <doug.simon@oracle.com>
parents:
13641
diff
changeset
|
691 if (nmethodValue == 0L) { |
c3370b2e1cbc
added check for invalidated code in executeCompiledMethodVarargs
Doug Simon <doug.simon@oracle.com>
parents:
13641
diff
changeset
|
692 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
|
693 } |
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
|
694 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
|
695 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
|
696 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
|
697 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
|
698 |
5747
120820e30baa
added basic high-level interpreter support to HotSpot
Christian Haeubl <haeubl@ssw.jku.at>
parents:
5624
diff
changeset
|
699 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
|
700 JavaValue result(jap.get_ret_type()); |
8151
b8f261ba79c6
Minimize diff to plain HotSpot version.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
8127
diff
changeset
|
701 jca.set_alternative_target(nm); |
b8f261ba79c6
Minimize diff to plain HotSpot version.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
8127
diff
changeset
|
702 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
|
703 |
8bf2c37c46c4
added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents:
5238
diff
changeset
|
704 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
|
705 return NULL; |
5395
fc1943f18fef
fixed bug in returning array values from CompilerToVMImpl.executeCompiledMethodVarargs
Doug Simon <doug.simon@oracle.com>
parents:
5318
diff
changeset
|
706 } 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
|
707 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
|
708 } else { |
8bf2c37c46c4
added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents:
5238
diff
changeset
|
709 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
|
710 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
|
711 } |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
712 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
|
713 |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
714 C2V_VMENTRY(jobject, getDeoptedLeafGraphIds, (JNIEnv *, jobject)) |
5129
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
715 |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
716 // the contract for this method is as follows: |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
717 // returning null: no deopted leaf graphs |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
718 // returning array (size > 0): the ids of the deopted leaf graphs |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
719 // returning array (size == 0): there was an overflow, the compiler needs to clear its cache completely |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
720 |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
721 oop array = GraalCompiler::instance()->dump_deopted_leaf_graphs(CHECK_NULL); |
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
722 return JNIHandles::make_local(array); |
6376
e957c9ff0bda
put boiler plate for CompilerToVM native methods in macros
Doug Simon <doug.simon@oracle.com>
parents:
6367
diff
changeset
|
723 C2V_END |
5129
51111665eda6
Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents:
5062
diff
changeset
|
724 |
7310
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
725 C2V_ENTRY(jlongArray, getLineNumberTable, (JNIEnv *env, jobject, jobject hotspot_method)) |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
726 Method* method = getMethodFromHotSpotMethod(JNIHandles::resolve(hotspot_method)); |
8269
985a97ba083c
Fix spacing.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
8215
diff
changeset
|
727 if (!method->has_linenumber_table()) { |
7310
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
728 return NULL; |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
729 } |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
730 u2 num_entries = 0; |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
731 CompressedLineNumberReadStream streamForSize(method->compressed_linenumber_table()); |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
732 while (streamForSize.read_pair()) { |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
733 num_entries++; |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
734 } |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
735 |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
736 CompressedLineNumberReadStream stream(method->compressed_linenumber_table()); |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
737 jlongArray result = env->NewLongArray(2 * num_entries); |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
738 |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
739 int i = 0; |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
740 jlong value; |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
741 while (stream.read_pair()) { |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
742 value = ((long) stream.bci()); |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
743 env->SetLongArrayRegion(result,i,1,&value); |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
744 value = ((long) stream.line()); |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
745 env->SetLongArrayRegion(result,i + 1,1,&value); |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
746 i += 2; |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
747 } |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
748 |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
749 return result; |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
750 C2V_END |
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
751 |
13306
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
13305
diff
changeset
|
752 C2V_VMENTRY(jlong, getLocalVariableTableStart, (JNIEnv *, jobject, jobject hotspot_method)) |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
7784
diff
changeset
|
753 ResourceMark rm; |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
7784
diff
changeset
|
754 Method* method = getMethodFromHotSpotMethod(JNIHandles::resolve(hotspot_method)); |
8269
985a97ba083c
Fix spacing.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
8215
diff
changeset
|
755 if (!method->has_localvariable_table()) { |
13306
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
13305
diff
changeset
|
756 return 0; |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
7784
diff
changeset
|
757 } |
13306
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
13305
diff
changeset
|
758 return (jlong) (address) method->localvariable_table_start(); |
7786
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
7784
diff
changeset
|
759 C2V_END |
8bbbde9d0a52
extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
7784
diff
changeset
|
760 |
13306
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
13305
diff
changeset
|
761 C2V_VMENTRY(jint, getLocalVariableTableLength, (JNIEnv *, jobject, jobject hotspot_method)) |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
13305
diff
changeset
|
762 ResourceMark rm; |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
13305
diff
changeset
|
763 Method* method = getMethodFromHotSpotMethod(JNIHandles::resolve(hotspot_method)); |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
13305
diff
changeset
|
764 return method->localvariable_table_length(); |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
13305
diff
changeset
|
765 C2V_END |
7310
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
766 |
8611
6c4db417385a
added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8451
diff
changeset
|
767 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
|
768 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
|
769 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
|
770 if (mcs != NULL) { |
836a62f43af9
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
Doug Simon <doug.simon@oracle.com>
parents:
10072
diff
changeset
|
771 mcs->clear_counters(); |
836a62f43af9
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
Doug Simon <doug.simon@oracle.com>
parents:
10072
diff
changeset
|
772 } |
836a62f43af9
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
Doug Simon <doug.simon@oracle.com>
parents:
10072
diff
changeset
|
773 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
|
774 |
6c4db417385a
added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8451
diff
changeset
|
775 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
|
776 if (code != NULL) { |
6c4db417385a
added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8451
diff
changeset
|
777 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
|
778 } |
6c4db417385a
added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8451
diff
changeset
|
779 |
6c4db417385a
added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8451
diff
changeset
|
780 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
|
781 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
|
782 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
|
783 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
|
784 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
|
785 } 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
|
786 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
|
787 } |
6c4db417385a
added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8451
diff
changeset
|
788 C2V_END |
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 |
10476
cd68d6902328
Fix invalidateInstalledCode and delete isInstalledCodeValid.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10475
diff
changeset
|
791 C2V_VMENTRY(void, invalidateInstalledCode, (JNIEnv *env, jobject, jobject hotspotInstalledCode)) |
cd68d6902328
Fix invalidateInstalledCode and delete isInstalledCodeValid.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10475
diff
changeset
|
792 jlong nativeMethod = HotSpotInstalledCode::codeBlob(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
|
793 nmethod* m = (nmethod*)nativeMethod; |
10477
7943479d36f3
Fix for invalidateInstalledCode.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10476
diff
changeset
|
794 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
|
795 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
|
796 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
|
797 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
|
798 } |
12409
edacadae40a0
Make sure HotSpot installed code link is cut when code is explicitely invalidated.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
12356
diff
changeset
|
799 HotSpotInstalledCode::set_codeBlob(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
|
800 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
|
801 |
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 |
10536
26c69598db3e
Fix bug in canonicalization of non-compressed object pointers.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10477
diff
changeset
|
803 C2V_VMENTRY(jobject, readUnsafeUncompressedPointer, (JNIEnv *env, jobject, jobject o, jlong offset)) |
26c69598db3e
Fix bug in canonicalization of non-compressed object pointers.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10477
diff
changeset
|
804 oop resolved_o = JNIHandles::resolve(o); |
12559
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12535
diff
changeset
|
805 address addr = ((address)resolved_o) + offset; |
12356
359f7e70ae7f
Reduce HotSpot diff and fix previous merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11852
diff
changeset
|
806 return JNIHandles::make_local(*((oop*)addr)); |
10536
26c69598db3e
Fix bug in canonicalization of non-compressed object pointers.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10477
diff
changeset
|
807 C2V_END |
26c69598db3e
Fix bug in canonicalization of non-compressed object pointers.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10477
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) |
49db2c1e3bee
added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents:
13796
diff
changeset
|
823 return gpu::probe_gpus(env); |
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 |
13630
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13578
diff
changeset
|
829 C2V_VMENTRY(int, allocateCompileId, (JNIEnv *env, jobject, jobject hotspot_method, int entry_bci)) |
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; |
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13578
diff
changeset
|
832 Method* method = getMethodFromHotSpotMethod(JNIHandles::resolve(hotspot_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 |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1422
diff
changeset
|
842 #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
|
843 #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
|
844 |
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
|
845 #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
|
846 #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
|
847 #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
|
848 #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
|
849 #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
|
850 #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
|
851 #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
|
852 #define STACK_TRACE_ELEMENT "Ljava/lang/StackTraceElement;" |
7084
9ba90252ce08
HotSpotResolvedJavaType is now the HotSpot implementation of ResolvedJavaType,
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7044
diff
changeset
|
853 #define HS_RESOLVED_TYPE "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedObjectType;" |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
854 #define HS_RESOLVED_METHOD "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod;" |
9669
ed6202820ecf
renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents:
9668
diff
changeset
|
855 #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
|
856 #define HS_CONFIG "Lcom/oracle/graal/hotspot/HotSpotVMConfig;" |
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
|
857 #define HS_INSTALLED_CODE "Lcom/oracle/graal/hotspot/meta/HotSpotInstalledCode;" |
13478
fe03864a2c72
replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents:
13461
diff
changeset
|
858 #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
|
859 #define METASPACE_METHOD "J" |
13769
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13698
diff
changeset
|
860 #define METASPACE_METHOD_DATA "J" |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13258
diff
changeset
|
861 #define METASPACE_CONSTANT_POOL "J" |
1423
760213a60e8b
* rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
1422
diff
changeset
|
862 |
4220
5c80ccb80036
Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4199
diff
changeset
|
863 JNINativeMethod CompilerToVM_methods[] = { |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
864 {CC"initializeBytecode", CC"("METASPACE_METHOD"[B)[B", FN_PTR(initializeBytecode)}, |
13305
a63d65b682a8
moved most HotSpotResolvedJavaMethod.getExceptionHandlers logic to Java
twisti
parents:
13295
diff
changeset
|
865 {CC"exceptionTableStart", CC"("METASPACE_METHOD")J", FN_PTR(exceptionTableStart)}, |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
866 {CC"hasBalancedMonitors", CC"("METASPACE_METHOD")Z", FN_PTR(hasBalancedMonitors)}, |
13373
430c9f08728d
moved most CompilerToVM.getUniqueConcreteMethod logic up to Java and replace getUniqueConcreteMethod with findUniqueConcreteMethod
twisti
parents:
13364
diff
changeset
|
867 {CC"findUniqueConcreteMethod", CC"("METASPACE_METHOD")"METASPACE_METHOD, FN_PTR(findUniqueConcreteMethod)}, |
13478
fe03864a2c72
replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents:
13461
diff
changeset
|
868 {CC"getKlassImplementor", CC"("METASPACE_KLASS")"METASPACE_KLASS, FN_PTR(getKlassImplementor)}, |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
869 {CC"getStackTraceElement", CC"("METASPACE_METHOD"I)"STACK_TRACE_ELEMENT, FN_PTR(getStackTraceElement)}, |
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
870 {CC"initializeMethod", CC"("METASPACE_METHOD HS_RESOLVED_METHOD")V", FN_PTR(initializeMethod)}, |
12535
cee7f686c470
rename CompilerToVm.dontInline to doNotInlineOrCompile
Matthias Grimmer <grimmer@ssw.jku.at>
parents:
12533
diff
changeset
|
871 {CC"doNotInlineOrCompile", CC"("METASPACE_METHOD")V", FN_PTR(doNotInlineOrCompile)}, |
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
|
872 {CC"canInlineMethod", CC"("METASPACE_METHOD")Z", FN_PTR(canInlineMethod)}, |
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
|
873 {CC"shouldInlineMethod", CC"("METASPACE_METHOD")Z", FN_PTR(shouldInlineMethod)}, |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
874 {CC"getCompiledCodeSize", CC"("METASPACE_METHOD")I", FN_PTR(getCompiledCodeSize)}, |
13483
37ec2cabf397
moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents:
13479
diff
changeset
|
875 {CC"lookupType", CC"("STRING CLASS"Z)"METASPACE_KLASS, FN_PTR(lookupType)}, |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13258
diff
changeset
|
876 {CC"lookupConstantInPool", CC"("METASPACE_CONSTANT_POOL"I)"OBJECT, FN_PTR(lookupConstantInPool)}, |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
14012
diff
changeset
|
877 {CC"lookupAppendixInPool", CC"("METASPACE_CONSTANT_POOL"I)"OBJECT, FN_PTR(lookupAppendixInPool)}, |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
878 {CC"lookupMethodInPool", CC"("METASPACE_CONSTANT_POOL"IB[J)"METASPACE_METHOD, FN_PTR(lookupMethodInPool)}, |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
879 {CC"lookupTypeInPool", CC"("METASPACE_CONSTANT_POOL"I[J)"METASPACE_KLASS, FN_PTR(lookupTypeInPool)}, |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
880 {CC"loadReferencedTypeInPool", CC"("METASPACE_CONSTANT_POOL"IB)V", FN_PTR(loadReferencedTypeInPool)}, |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
881 {CC"lookupFieldInPool", CC"("METASPACE_CONSTANT_POOL"IB[J)Z", FN_PTR(lookupFieldInPool)}, |
13374
ad187607b784
make CompilerToVM.resolveMethod return a metadata method instead of a Java type
twisti
parents:
13373
diff
changeset
|
882 {CC"resolveMethod", CC"("HS_RESOLVED_TYPE STRING STRING")"METASPACE_METHOD, FN_PTR(resolveMethod)}, |
13295
903fd774dd61
simplified implementation of HotSpotResolvedObjectType.getClassInitializer()
Doug Simon <doug.simon@oracle.com>
parents:
13264
diff
changeset
|
883 {CC"getClassInitializer", CC"("HS_RESOLVED_TYPE")"METASPACE_METHOD, FN_PTR(getClassInitializer)}, |
9126
bc26f978b0ce
HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
Bernhard Urban <bernhard.urban@jku.at>
parents:
9108
diff
changeset
|
884 {CC"hasFinalizableSubclass", CC"("HS_RESOLVED_TYPE")Z", FN_PTR(hasFinalizableSubclass)}, |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
885 {CC"getMaxCallTargetOffset", CC"(J)J", FN_PTR(getMaxCallTargetOffset)}, |
13264
b23cbfb4366a
merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents:
13263
diff
changeset
|
886 {CC"getMetaspaceMethod", CC"("CLASS"I)"METASPACE_METHOD, FN_PTR(getMetaspaceMethod)}, |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
887 {CC"initializeConfiguration", CC"("HS_CONFIG")V", FN_PTR(initializeConfiguration)}, |
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
|
888 {CC"installCode0", CC"("HS_COMPILED_CODE HS_INSTALLED_CODE SPECULATION_LOG")I", FN_PTR(installCode0)}, |
13103
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
889 {CC"notifyCompilationStatistics", CC"(I"HS_RESOLVED_METHOD"ZIJJ"HS_INSTALLED_CODE")V", FN_PTR(notifyCompilationStatistics)}, |
13364
5a4293f24642
added -G:PrintCompRate option for periodically printing out the current compilation rate
Doug Simon <doug.simon@oracle.com>
parents:
13306
diff
changeset
|
890 {CC"printCompilationStatistics", CC"(ZZ)V", FN_PTR(printCompilationStatistics)}, |
13103
c0b0974dd509
moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
12779
diff
changeset
|
891 {CC"resetCompilationStatistics", CC"()V", FN_PTR(resetCompilationStatistics)}, |
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
|
892 {CC"disassembleCodeBlob", CC"(J)"STRING, FN_PTR(disassembleCodeBlob)}, |
10475
3489047ffea2
Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10434
diff
changeset
|
893 {CC"executeCompiledMethodVarargs", CC"(["OBJECT HS_INSTALLED_CODE")"OBJECT, FN_PTR(executeCompiledMethodVarargs)}, |
6950
41938af2b3d8
modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
894 {CC"getDeoptedLeafGraphIds", CC"()[J", FN_PTR(getDeoptedLeafGraphIds)}, |
7310
79a7b761755c
Added getLineNumberTable and getFileName capabilities.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7232
diff
changeset
|
895 {CC"getLineNumberTable", CC"("HS_RESOLVED_METHOD")[J", FN_PTR(getLineNumberTable)}, |
13306
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
13305
diff
changeset
|
896 {CC"getLocalVariableTableStart", CC"("HS_RESOLVED_METHOD")J", FN_PTR(getLocalVariableTableStart)}, |
dfb780080923
moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents:
13305
diff
changeset
|
897 {CC"getLocalVariableTableLength", CC"("HS_RESOLVED_METHOD")I", FN_PTR(getLocalVariableTableLength)}, |
8611
6c4db417385a
added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents:
8451
diff
changeset
|
898 {CC"reprofile", CC"("METASPACE_METHOD")V", FN_PTR(reprofile)}, |
10476
cd68d6902328
Fix invalidateInstalledCode and delete isInstalledCodeValid.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10475
diff
changeset
|
899 {CC"invalidateInstalledCode", CC"("HS_INSTALLED_CODE")V", FN_PTR(invalidateInstalledCode)}, |
10536
26c69598db3e
Fix bug in canonicalization of non-compressed object pointers.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
10477
diff
changeset
|
900 {CC"readUnsafeUncompressedPointer", CC"("OBJECT"J)"OBJECT, FN_PTR(readUnsafeUncompressedPointer)}, |
10715
c3760150dc29
Add function to read compressed klass pointers of constant objects natively
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
10714
diff
changeset
|
901 {CC"readUnsafeKlassPointer", CC"("OBJECT")J", FN_PTR(readUnsafeKlassPointer)}, |
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
|
902 {CC"collectCounters", CC"()[J", FN_PTR(collectCounters)}, |
13819
49db2c1e3bee
added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents:
13796
diff
changeset
|
903 {CC"getGPUs", CC"()"STRING, FN_PTR(getGPUs)}, |
13630
b1838411e896
Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13578
diff
changeset
|
904 {CC"allocateCompileId", CC"("HS_RESOLVED_METHOD"I)I", FN_PTR(allocateCompileId)}, |
13769
af344056124f
Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13698
diff
changeset
|
905 {CC"isMature", CC"("METASPACE_METHOD_DATA")Z", FN_PTR(isMature)}, |
1412
9195b99c841b
Added first VM entry method.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1410
diff
changeset
|
906 }; |
9195b99c841b
Added first VM entry method.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
1410
diff
changeset
|
907 |
4220
5c80ccb80036
Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4199
diff
changeset
|
908 int CompilerToVM_methods_count() { |
5c80ccb80036
Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4199
diff
changeset
|
909 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
|
910 } |
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
|
911 |