annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java @ 14717:aa1a43bfdf4e

make HotSpotResolvedJavaMethod leaner
author twisti
date Fri, 21 Mar 2014 14:26:58 -0700
parents 4877b0cb446f
children 4062efea018b
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
14105
f62c770c22be make HotSpotResolvedJavaMethod leaner
twisti
parents: 14104
diff changeset
49 public native int exceptionTableLength(long metaspaceMethod);
f62c770c22be make HotSpotResolvedJavaMethod leaner
twisti
parents: 14104
diff changeset
50
f62c770c22be make HotSpotResolvedJavaMethod leaner
twisti
parents: 14104
diff changeset
51 @Override
13305
a63d65b682a8 moved most HotSpotResolvedJavaMethod.getExceptionHandlers logic to Java
twisti
parents: 13295
diff changeset
52 public native long exceptionTableStart(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
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
55 public native boolean hasBalancedMonitors(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
13373
430c9f08728d moved most CompilerToVM.getUniqueConcreteMethod logic up to Java and replace getUniqueConcreteMethod with findUniqueConcreteMethod
twisti
parents: 13364
diff changeset
58 public native long findUniqueConcreteMethod(long metaspaceMethod);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
59
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
60 @Override
13478
fe03864a2c72 replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents: 13374
diff changeset
61 public native long getKlassImplementor(long metaspaceKlass);
7225
31c4d9f9e922 adder better CHA support
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7147
diff changeset
62
31c4d9f9e922 adder better CHA support
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7147
diff changeset
63 @Override
13483
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13478
diff changeset
64 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
65
14529
82c3b54d1f08 added HotSpotConstantPool.JVM_CONSTANT enum
twisti
parents: 14172
diff changeset
66 public native Object resolveConstantInPool(long metaspaceConstantPool, int cpi);
82c3b54d1f08 added HotSpotConstantPool.JVM_CONSTANT enum
twisti
parents: 14172
diff changeset
67
82c3b54d1f08 added HotSpotConstantPool.JVM_CONSTANT enum
twisti
parents: 14172
diff changeset
68 public native Object resolvePossiblyCachedConstantInPool(long metaspaceConstantPool, int cpi);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
69
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
70 @Override
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
71 public native int lookupNameAndTypeRefIndexInPool(long metaspaceConstantPool, int cpi);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
72
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
73 @Override
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
74 public native long lookupNameRefInPool(long metaspaceConstantPool, int cpi);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
75
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
76 @Override
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
77 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
78
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
79 @Override
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
80 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
81
14530
d87b84dade7d moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents: 14529
diff changeset
82 public native long constantPoolKlassAt(long metaspaceConstantPool, int cpi);
d87b84dade7d moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents: 14529
diff changeset
83
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
84 @Override
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
85 public native long lookupKlassInPool(long metaspaceConstantPool, int cpi);
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 lookupMethodInPool(long metaspaceConstantPool, int cpi, byte opcode);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
89
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
90 @Override
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
91 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
92
14530
d87b84dade7d moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents: 14529
diff changeset
93 public native int constantPoolRemapInstructionOperandFromCache(long metaspaceConstantPool, int cpi);
13259
b16fb0b7479b every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents: 13258
diff changeset
94
b16fb0b7479b every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents: 13258
diff changeset
95 @Override
14052
361acb279104 moved to-constant-pool-index conversion up to Java
twisti
parents: 14012
diff changeset
96 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
97
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
98 @Override
6363
a73fcf1639fc HotSpotVMConfig object is now allocated in Java
Doug Simon <doug.simon@oracle.com>
parents: 5776
diff changeset
99 public native void initializeConfiguration(HotSpotVMConfig config);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
100
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
101 @Override
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
102 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
103
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
104 @Override
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
105 public native boolean hasFinalizableSubclass(long metaspaceKlass);
9126
bc26f978b0ce HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
Bernhard Urban <bernhard.urban@jku.at>
parents: 9108
diff changeset
106
14717
aa1a43bfdf4e make HotSpotResolvedJavaMethod leaner
twisti
parents: 14545
diff changeset
107 public native boolean methodIsIgnoredBySecurityStackWalk(long metaspaceMethod);
4439
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4220
diff changeset
108
f7251c729b31 profiling info first try
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4220
diff changeset
109 @Override
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
110 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
111
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
112 @Override
9649
dd62ccda1849 rename parameter
Doug Simon <doug.simon@oracle.com>
parents: 9610
diff changeset
113 public native long getMaxCallTargetOffset(long address);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
114
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
115 // 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
116 @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
117 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
118
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
119 @Override
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
120 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
121
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
122 @Override
10475
3489047ffea2 Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10056
diff changeset
123 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
124
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
125 @Override
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
126 public native long[] getLineNumberTable(long metaspaceMethod);
7307
dc3e86fd3be1 Introduce cutomization capability for canonicalizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7225
diff changeset
127
dc3e86fd3be1 Introduce cutomization capability for canonicalizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7225
diff changeset
128 @Override
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
129 public native long getLocalVariableTableStart(long metaspaceMethod);
13306
dfb780080923 moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents: 13305
diff changeset
130
dfb780080923 moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents: 13305
diff changeset
131 @Override
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
132 public native int getLocalVariableTableLength(long metaspaceMethod);
7786
8bbbde9d0a52 extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 7784
diff changeset
133
8bbbde9d0a52 extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 7784
diff changeset
134 @Override
7307
dc3e86fd3be1 Introduce cutomization capability for canonicalizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7225
diff changeset
135 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
136
8a526d8b4604 Always clear 'queued for compilation' flag at the end of a compilation task
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 8349
diff changeset
137 @Override
8611
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8349
diff changeset
138 public native void reprofile(long metaspaceMethod);
8945
7ef66078d837 add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents: 8614
diff changeset
139
7ef66078d837 add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents: 8614
diff changeset
140 @Override
10476
cd68d6902328 Fix invalidateInstalledCode and delete isInstalledCodeValid.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10475
diff changeset
141 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
142
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
143 @Override
10536
26c69598db3e Fix bug in canonicalization of non-compressed object pointers.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10476
diff changeset
144 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
145
26c69598db3e Fix bug in canonicalization of non-compressed object pointers.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10476
diff changeset
146 @Override
10715
c3760150dc29 Add function to read compressed klass pointers of constant objects natively
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10655
diff changeset
147 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
148
c3760150dc29 Add function to read compressed klass pointers of constant objects natively
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10655
diff changeset
149 @Override
12535
cee7f686c470 rename CompilerToVm.dontInline to doNotInlineOrCompile
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12533
diff changeset
150 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
151
9b1cc2628961 Extend the CompilerToVM interface to explicitly avoid compilation and inlining of methods
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 11852
diff changeset
152 @Override
10475
3489047ffea2 Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10056
diff changeset
153 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
154 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
155 }
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
156
13103
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
157 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
158 HotSpotInstalledCode installedCode);
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
159
13364
5a4293f24642 added -G:PrintCompRate option for periodically printing out the current compilation rate
Doug Simon <doug.simon@oracle.com>
parents: 13306
diff changeset
160 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
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 native void resetCompilationStatistics();
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
163
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
164 /**
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
165 * 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
166 * 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
167 * 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
168 * 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
169 * 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
170 */
10654
d71c56c67921 Improve performance of calling Truffle call targets.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10536
diff changeset
171 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
172
d7964e96b0b0 move benchmark counters into separate class and make them correct for multithreaded applications
Lukas Stadler <lukas.stadler@jku.at>
parents: 11520
diff changeset
173 public native long[] collectCounters();
13630
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13483
diff changeset
174
13769
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13641
diff changeset
175 public native boolean isMature(long method);
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13641
diff changeset
176
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
177 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
178
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13769
diff changeset
179 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
180
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
181 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
182
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
183 public native boolean shouldInlineMethod(long metaspaceMethod);
14107
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
184
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
185 public native boolean hasCompiledCodeForOSR(long metaspaceMethod, int entryBCI, int level);
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
186
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
187 }