annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java @ 14104:a38a54030ea2

pass metaspace pointers instead of object to VM
author twisti
date Thu, 06 Mar 2014 21:03:59 -0800
parents dd783f0ecf17
children f62c770c22be
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
23
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
24 package com.oracle.graal.hotspot.bridge;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
25
8217
dce9cefed571 Draft speculation log.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8215
diff changeset
26 import com.oracle.graal.api.code.*;
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
27 import com.oracle.graal.hotspot.*;
5548
8872bc0eebdf Renaming hotspot.ri => hotspot.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5547
diff changeset
28 import com.oracle.graal.hotspot.meta.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
30 /**
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
31 * Entries into the HotSpot VM from Java code.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
32 */
5529
d487ae06265d Move graal.hotspot.server into its own project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5510
diff changeset
33 public class CompilerToVMImpl implements CompilerToVM {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34
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
35 private native int installCode0(HotSpotCompiledCode compiledCode, HotSpotInstalledCode code, SpeculationLog speculationLog);
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
36
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
37 @Override
9669
ed6202820ecf renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents: 9649
diff changeset
38 public CodeInstallResult installCode(HotSpotCompiledCode compiledCode, HotSpotInstalledCode code, SpeculationLog speculationLog) {
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
39 return CodeInstallResult.getEnum(installCode0(compiledCode, code, speculationLog));
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
40 }
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
41
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42 @Override
13264
b23cbfb4366a merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents: 13263
diff changeset
43 public native long getMetaspaceMethod(Class<?> holder, int slot);
7044
34753b057324 added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents: 7037
diff changeset
44
34753b057324 added unit tests for JavaType, JavaMethod and ResolvedJavaMethod
Doug Simon <doug.simon@oracle.com>
parents: 7037
diff changeset
45 @Override
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
46 public native byte[] initializeBytecode(long metaspaceMethod, byte[] code);
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
47
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
48 @Override
13305
a63d65b682a8 moved most HotSpotResolvedJavaMethod.getExceptionHandlers logic to Java
twisti
parents: 13295
diff changeset
49 public native long exceptionTableStart(long metaspaceMethod);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
51 @Override
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
52 public native boolean hasBalancedMonitors(long metaspaceMethod);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
54 @Override
13373
430c9f08728d moved most CompilerToVM.getUniqueConcreteMethod logic up to Java and replace getUniqueConcreteMethod with findUniqueConcreteMethod
twisti
parents: 13364
diff changeset
55 public native long findUniqueConcreteMethod(long metaspaceMethod);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
56
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
57 @Override
13478
fe03864a2c72 replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents: 13374
diff changeset
58 public native long getKlassImplementor(long metaspaceKlass);
7225
31c4d9f9e922 adder better CHA support
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7147
diff changeset
59
31c4d9f9e922 adder better CHA support
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7147
diff changeset
60 @Override
13483
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13478
diff changeset
61 public native long lookupType(String name, Class<?> accessingClass, boolean eagerResolve);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
62
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
63 @Override
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
64 public native long lookupKlassByName(String name, Class<?> accessingClass);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
65
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
66 @Override
13259
b16fb0b7479b every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents: 13258
diff changeset
67 public native Object lookupConstantInPool(long metaspaceConstantPool, int cpi);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
68
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
69 @Override
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
70 public native int lookupNameAndTypeRefIndexInPool(long metaspaceConstantPool, int cpi);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
71
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
72 @Override
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
73 public native long lookupNameRefInPool(long metaspaceConstantPool, int cpi);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
74
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
75 @Override
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
76 public native long lookupSignatureRefInPool(long metaspaceConstantPool, int cpi);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
77
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
78 @Override
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
79 public native int lookupKlassRefIndexInPool(long metaspaceConstantPool, int cpi);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
80
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
81 @Override
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
82 public native long lookupKlassInPool(long metaspaceConstantPool, int cpi);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
83
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
84 @Override
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
85 public native long lookupMethodInPool(long metaspaceConstantPool, int cpi, byte opcode);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
86
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
87 @Override
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
88 public native long resolveField(long metaspaceConstantPool, int cpi, byte opcode, long[] info);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
89
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
90 @Override
14069
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
91 public native void loadReferencedTypeInPool(long metaspaceConstantPool, int cpi, byte opcode);
13259
b16fb0b7479b every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents: 13258
diff changeset
92
b16fb0b7479b every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents: 13258
diff changeset
93 @Override
14052
361acb279104 moved to-constant-pool-index conversion up to Java
twisti
parents: 14012
diff changeset
94 public native Object lookupAppendixInPool(long metaspaceConstantPool, int cpi);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
95
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
96 @Override
6363
a73fcf1639fc HotSpotVMConfig object is now allocated in Java
Doug Simon <doug.simon@oracle.com>
parents: 5776
diff changeset
97 public native void initializeConfiguration(HotSpotVMConfig config);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
98
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
99 @Override
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
100 public native long resolveMethod(long metaspaceKlass, String name, String signature);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
101
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
102 @Override
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
103 public native boolean hasFinalizableSubclass(long metaspaceKlass);
9126
bc26f978b0ce HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
Bernhard Urban <bernhard.urban@jku.at>
parents: 9108
diff changeset
104
bc26f978b0ce HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
Bernhard Urban <bernhard.urban@jku.at>
parents: 9108
diff changeset
105 @Override
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
106 public native void initializeMethod(long metaspaceMethod, HotSpotResolvedJavaMethod method);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4220
diff changeset
107
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4220
diff changeset
108 @Override
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
109 public native long getClassInitializer(long metaspaceKlass);
9985
e6bd1004082a added HotSpotResolvedObjectType.getMethods() to get all methods of a class including those (such as <clinit>) not normally exposed by Java reflection
Doug Simon <doug.simon@oracle.com>
parents: 9807
diff changeset
110
e6bd1004082a added HotSpotResolvedObjectType.getMethods() to get all methods of a class including those (such as <clinit>) not normally exposed by Java reflection
Doug Simon <doug.simon@oracle.com>
parents: 9807
diff changeset
111 @Override
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
112 public native int getCompiledCodeSize(long metaspaceMethod);
4528
e6e14d25e608 added two inlining policies for comparison
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
113
e6e14d25e608 added two inlining policies for comparison
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4446
diff changeset
114 @Override
9649
dd62ccda1849 rename parameter
Doug Simon <doug.simon@oracle.com>
parents: 9610
diff changeset
115 public native long getMaxCallTargetOffset(long address);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
116
9807
d552919fbb05 Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents: 9669
diff changeset
117 // The HotSpot disassembler seems not to be thread safe so it's better to synchronize its usage
4297
874fcc2ddd9d Use HotSpot disassmblers for native code and bytecode
Christian Wimmer <christian.wimmer@oracle.com>
parents: 4220
diff changeset
118 @Override
9807
d552919fbb05 Graal's code annotations are installed into codeBlobs and are thus included in disassembler output (in a non-PRODUCT build)
Doug Simon <doug.simon@oracle.com>
parents: 9669
diff changeset
119 public synchronized native String disassembleCodeBlob(long codeBlob);
7784
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
120
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
121 @Override
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
122 public native StackTraceElement getStackTraceElement(long metaspaceMethod, 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: 5129
diff changeset
123
cce31bc56c00 made HotSpotResolvedMethodImpl.toStackTraceElement() call into native code to get an object containing source file info
Doug Simon <doug.simon@oracle.com>
parents: 5129
diff changeset
124 @Override
10475
3489047ffea2 Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10056
diff changeset
125 public native Object executeCompiledMethodVarargs(Object[] args, HotSpotInstalledCode 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
126
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
127 @Override
5129
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5061
diff changeset
128 public native long[] getDeoptedLeafGraphIds();
51111665eda6 Support for recording a leaf graph id for each deoptimization point in the debug info.
Lukas Stadler <lukas.stadler@jku.at>
parents: 5061
diff changeset
129
5318
b5cd7bc05695 Method entry counters: Enable the flag to collect an execution profile of compiled methods and their callers. This allows to, e.g., detect methods that should be inlined because they are called frequently.
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 5275
diff changeset
130 @Override
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
131 public native long[] getLineNumberTable(long metaspaceMethod);
7307
dc3e86fd3be1 Introduce cutomization capability for canonicalizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7225
diff changeset
132
dc3e86fd3be1 Introduce cutomization capability for canonicalizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7225
diff changeset
133 @Override
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
134 public native long getLocalVariableTableStart(long metaspaceMethod);
13306
dfb780080923 moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents: 13305
diff changeset
135
dfb780080923 moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents: 13305
diff changeset
136 @Override
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
137 public native int getLocalVariableTableLength(long metaspaceMethod);
7786
8bbbde9d0a52 extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 7784
diff changeset
138
8bbbde9d0a52 extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 7784
diff changeset
139 @Override
7307
dc3e86fd3be1 Introduce cutomization capability for canonicalizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7225
diff changeset
140 public native String getFileName(HotSpotResolvedJavaType method);
8527
8a526d8b4604 Always clear 'queued for compilation' flag at the end of a compilation task
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8349
diff changeset
141
8a526d8b4604 Always clear 'queued for compilation' flag at the end of a compilation task
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8349
diff changeset
142 @Override
8611
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8349
diff changeset
143 public native void reprofile(long metaspaceMethod);
8945
7ef66078d837 add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents: 8614
diff changeset
144
7ef66078d837 add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents: 8614
diff changeset
145 @Override
10476
cd68d6902328 Fix invalidateInstalledCode and delete isInstalledCodeValid.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10475
diff changeset
146 public native void invalidateInstalledCode(HotSpotInstalledCode hotspotInstalledCode);
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
147
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
148 @Override
10536
26c69598db3e Fix bug in canonicalization of non-compressed object pointers.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10476
diff changeset
149 public native Object readUnsafeUncompressedPointer(Object o, long displacement);
26c69598db3e Fix bug in canonicalization of non-compressed object pointers.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10476
diff changeset
150
26c69598db3e Fix bug in canonicalization of non-compressed object pointers.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10476
diff changeset
151 @Override
10715
c3760150dc29 Add function to read compressed klass pointers of constant objects natively
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10655
diff changeset
152 public native long readUnsafeKlassPointer(Object o);
c3760150dc29 Add function to read compressed klass pointers of constant objects natively
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10655
diff changeset
153
c3760150dc29 Add function to read compressed klass pointers of constant objects natively
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10655
diff changeset
154 @Override
12535
cee7f686c470 rename CompilerToVm.dontInline to doNotInlineOrCompile
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12533
diff changeset
155 public native void doNotInlineOrCompile(long metaspaceMethod);
12532
9b1cc2628961 Extend the CompilerToVM interface to explicitly avoid compilation and inlining of methods
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 11852
diff changeset
156
9b1cc2628961 Extend the CompilerToVM interface to explicitly avoid compilation and inlining of methods
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 11852
diff changeset
157 @Override
10475
3489047ffea2 Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10056
diff changeset
158 public Object executeCompiledMethod(Object arg1, Object arg2, Object arg3, HotSpotInstalledCode hotspotInstalledCode) throws InvalidInstalledCodeException {
3489047ffea2 Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10056
diff changeset
159 return executeCompiledMethodIntrinsic(arg1, arg2, arg3, hotspotInstalledCode);
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
160 }
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
161
13103
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
162 public synchronized native void notifyCompilationStatistics(int id, HotSpotResolvedJavaMethod method, boolean osr, int processedBytecodes, long time, long timeUnitsPerSecond,
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
163 HotSpotInstalledCode installedCode);
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
164
13364
5a4293f24642 added -G:PrintCompRate option for periodically printing out the current compilation rate
Doug Simon <doug.simon@oracle.com>
parents: 13306
diff changeset
165 public synchronized native void printCompilationStatistics(boolean perCompiler, boolean aggregate);
5a4293f24642 added -G:PrintCompRate option for periodically printing out the current compilation rate
Doug Simon <doug.simon@oracle.com>
parents: 13306
diff changeset
166
13103
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
167 public native void resetCompilationStatistics();
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
168
9046
c6a1ffc707ff Comments and #ifdef GRAAL for recent changes to C++ code for calling nmethods directly.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 9027
diff changeset
169 /**
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: 9126
diff changeset
170 * Direct call to the given nmethod with three object arguments and an object return value. This
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: 9126
diff changeset
171 * method does not have an implementation on the C++ side, but its entry points (from
9046
c6a1ffc707ff Comments and #ifdef GRAAL for recent changes to C++ code for calling nmethods directly.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 9027
diff changeset
172 * interpreter and from compiled code) are directly pointing to a manually generated assembly
c6a1ffc707ff Comments and #ifdef GRAAL for recent changes to C++ code for calling nmethods directly.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 9027
diff changeset
173 * stub that does the necessary argument shuffling and a tail call via an indirect jump to the
c6a1ffc707ff Comments and #ifdef GRAAL for recent changes to C++ code for calling nmethods directly.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 9027
diff changeset
174 * verified entry point of the given native method.
c6a1ffc707ff Comments and #ifdef GRAAL for recent changes to C++ code for calling nmethods directly.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 9027
diff changeset
175 */
10654
d71c56c67921 Improve performance of calling Truffle call targets.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10536
diff changeset
176 public static native Object executeCompiledMethodIntrinsic(Object arg1, Object arg2, Object arg3, HotSpotInstalledCode hotspotInstalledCode) throws InvalidInstalledCodeException;
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
177
d7964e96b0b0 move benchmark counters into separate class and make them correct for multithreaded applications
Lukas Stadler <lukas.stadler@jku.at>
parents: 11520
diff changeset
178 public native long[] collectCounters();
13630
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13483
diff changeset
179
13769
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13641
diff changeset
180 public native boolean isMature(long method);
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13641
diff changeset
181
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
182 public native int allocateCompileId(long metaspaceMethod, int entryBCI);
13819
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13769
diff changeset
183
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13769
diff changeset
184 public native String getGPUs();
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: 13819
diff changeset
185
d587baa55dd7 Add shouldBeInlined method to ResolvedJavaMethod, implement it for HotSpot and use it in the inlining phase
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13819
diff changeset
186 public native boolean canInlineMethod(long metaspaceMethod);
d587baa55dd7 Add shouldBeInlined method to ResolvedJavaMethod, implement it for HotSpot and use it in the inlining phase
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13819
diff changeset
187
d587baa55dd7 Add shouldBeInlined method to ResolvedJavaMethod, implement it for HotSpot and use it in the inlining phase
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13819
diff changeset
188 public native boolean shouldInlineMethod(long metaspaceMethod);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
189 }