annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java @ 14107:800057208a2c

enable C1 + Graal tiered
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Thu, 06 Mar 2014 17:11:39 -0800
parents f62c770c22be
children 2b2f0022900f
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.*;
5507
dc71b06d09f8 Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5503
diff changeset
27 import com.oracle.graal.api.meta.*;
13170
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
28 import com.oracle.graal.graph.*;
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
29 import com.oracle.graal.hotspot.*;
5548
8872bc0eebdf Renaming hotspot.ri => hotspot.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5547
diff changeset
30 import com.oracle.graal.hotspot.meta.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
31
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
32 /**
4410
646a6bfecf73 Small doc fixes.
Doug Simon <doug.simon@oracle.com>
parents: 4297
diff changeset
33 * Calls from Java into HotSpot.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34 */
4220
5c80ccb80036 Renaming of VMExits and VMEntries part 1.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4199
diff changeset
35 public interface CompilerToVM {
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
36
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
37 /**
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
38 * Copies the original bytecode of a given method into a given byte array.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
39 *
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
40 * @param metaspaceMethod the metaspace Method object
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
41 * @param code the array into which to copy the original bytecode
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
42 * @return the value of {@code code}
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
43 */
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
44 byte[] initializeBytecode(long metaspaceMethod, byte[] code);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45
14105
f62c770c22be make HotSpotResolvedJavaMethod leaner
twisti
parents: 14104
diff changeset
46 int exceptionTableLength(long metaspaceMethod);
f62c770c22be make HotSpotResolvedJavaMethod leaner
twisti
parents: 14104
diff changeset
47
13305
a63d65b682a8 moved most HotSpotResolvedJavaMethod.getExceptionHandlers logic to Java
twisti
parents: 13295
diff changeset
48 long exceptionTableStart(long metaspaceMethod);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
50 /**
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
51 * Determines if a given metaspace Method object has balanced monitors.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
52 *
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
53 * @param metaspaceMethod the metaspace Method object to query
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
54 * @return true if the method has balanced monitors
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
55 */
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
56 boolean hasBalancedMonitors(long metaspaceMethod);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
57
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
58 /**
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
59 * Determines if a given metaspace Method can be inlined. A method may not be inlinable for a
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
60 * number of reasons such as:
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
61 * <ul>
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
62 * <li>a CompileOracle directive may prevent inlining or compilation of this methods</li>
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
63 * <li>the method may have a bytecode breakpoint set</li>
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
64 * <li>the method may have other bytecode features that require special handling by the VM</li>
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
65 * </ul>
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
66 *
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
67 * @param metaspaceMethod the metaspace Method object to query
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
68 * @return true if the method can be inlined
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
69 */
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
70 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
71
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
72 /**
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
73 * Determines if a given metaspace Method should be inlined at any cost. This could be because:
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
74 * <ul>
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
75 * <li>a CompileOracle directive may forces inlining of this methods</li>
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
76 * <li>an annotation forces inlining of this method</li>
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
77 * </ul>
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
78 *
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
79 * @param metaspaceMethod the metaspace Method object to query
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
80 * @return true if the method should be inlined
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
81 */
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
82 boolean shouldInlineMethod(long metaspaceMethod);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
83
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
84 /**
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
85 * Used to implement {@link ResolvedJavaType#findUniqueConcreteMethod(ResolvedJavaMethod)}.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
86 *
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
87 * @param metaspaceMethod the metaspace Method on which to based the search
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
88 * @return the metaspace Method result or 0 is there is no unique concrete method for
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
89 * {@code metaspaceMethod}
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
90 */
13373
430c9f08728d moved most CompilerToVM.getUniqueConcreteMethod logic up to Java and replace getUniqueConcreteMethod with findUniqueConcreteMethod
twisti
parents: 13364
diff changeset
91 long findUniqueConcreteMethod(long metaspaceMethod);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
92
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
93 /**
13478
fe03864a2c72 replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents: 13374
diff changeset
94 * Returns the implementor for the given interface class.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
95 *
13478
fe03864a2c72 replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents: 13374
diff changeset
96 * @param metaspaceKlass the metaspace klass to get the implementor for
fe03864a2c72 replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents: 13374
diff changeset
97 * @return the implementor as metaspace klass pointer or null if there is no implementor
7225
31c4d9f9e922 adder better CHA support
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7147
diff changeset
98 */
13478
fe03864a2c72 replaced CompilerToVM.getUniqueImplementor with getKlassImplementor and moved the logic into Java
twisti
parents: 13374
diff changeset
99 long getKlassImplementor(long metaspaceKlass);
7225
31c4d9f9e922 adder better CHA support
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7147
diff changeset
100
31c4d9f9e922 adder better CHA support
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7147
diff changeset
101 /**
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
102 * Initializes a {@link HotSpotResolvedJavaMethod} object from a metaspace Method object.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
103 *
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
104 * @param metaspaceMethod the metaspace Method object
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
105 * @param method address of a metaspace Method object
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
106 */
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
107 void initializeMethod(long metaspaceMethod, HotSpotResolvedJavaMethod method);
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
108
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
109 /**
13483
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13478
diff changeset
110 * Converts a name to a metaspace klass.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
111 *
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
112 * @param name a well formed Java type in {@linkplain JavaType#getName() internal} format
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
113 * @param accessingClass the context of resolution (may be null)
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
114 * @param eagerResolve force resolution to a {@link ResolvedJavaType}. If true, this method will
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
115 * either return a {@link ResolvedJavaType} or throw an exception
13483
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13478
diff changeset
116 * @return a metaspace klass for {@code name}
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
117 * @throws LinkageError if {@code eagerResolve == true} and the resolution failed
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
118 */
13483
37ec2cabf397 moved JavaType creation in CompilerToVM.lookupType into Java
twisti
parents: 13478
diff changeset
119 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
120
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
121 long lookupKlassByName(String name, Class<?> accessingClass);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
122
13259
b16fb0b7479b every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents: 13258
diff changeset
123 Object lookupConstantInPool(long metaspaceConstantPool, int cpi);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
124
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
125 int lookupNameAndTypeRefIndexInPool(long metaspaceConstantPool, int cpi);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
126
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
127 long lookupNameRefInPool(long metaspaceConstantPool, int cpi);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
128
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
129 long lookupSignatureRefInPool(long metaspaceConstantPool, int cpi);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
130
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
131 int lookupKlassRefIndexInPool(long metaspaceConstantPool, int cpi);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
132
14069
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
133 /**
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
134 * Looks up a class entry in a constant pool.
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
135 *
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
136 * @param metaspaceConstantPool metaspace constant pool pointer
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
137 * @param cpi constant pool index
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
138 * @return a metaspace Klass for a resolved method entry, a metaspace Symbol otherwise (with
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
139 * tagging)
14069
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
140 */
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
141 long lookupKlassInPool(long metaspaceConstantPool, int cpi);
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
142
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
143 /**
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
144 * Looks up a method entry in a constant pool.
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
145 *
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
146 * @param metaspaceConstantPool metaspace constant pool pointer
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
147 * @param cpi constant pool index
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
148 * @return a metaspace Method for a resolved method entry, 0 otherwise
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
149 */
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
150 long lookupMethodInPool(long metaspaceConstantPool, int cpi, byte opcode);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
151
14069
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
152 /**
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
153 * Looks up a field entry in a constant pool and attempts to resolve it. The values returned in
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
154 * {@code info} are:
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
155 *
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
156 * <pre>
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
157 * [(int) flags, // only valid if field is resolved
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
158 * (int) offset] // only valid if field is resolved
14069
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
159 * </pre>
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
160 *
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
161 * @param metaspaceConstantPool metaspace constant pool pointer
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
162 * @param cpi constant pool index
14069
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
163 * @param info an array in which the details of the field are returned
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
164 * @return true if the field is resolved
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
165 */
14093
dd783f0ecf17 refactor CompilerToVM interface
twisti
parents: 14069
diff changeset
166 long resolveField(long metaspaceConstantPool, int cpi, byte opcode, long[] info);
14069
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
167
2f37b0e442fe removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents: 14052
diff changeset
168 void loadReferencedTypeInPool(long metaspaceConstantPool, int cpi, byte opcode);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
169
14052
361acb279104 moved to-constant-pool-index conversion up to Java
twisti
parents: 14012
diff changeset
170 Object lookupAppendixInPool(long metaspaceConstantPool, int cpi);
9011
23762f2438b6 support for compiling LambdaForm invocations (invokevirtual instructions that were rewritten to invokehandle instructions)
Doug Simon <doug.simon@oracle.com>
parents: 8945
diff changeset
171
7113
38076efb9062 Do not print code installation failures from Java.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7089
diff changeset
172 public enum CodeInstallResult {
13170
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
173 OK("ok"), DEPENDENCIES_FAILED("dependencies failed"), CACHE_FULL("code cache is full"), CODE_TOO_LARGE("code is too large");
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
174
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
175 private int value;
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
176 private String message;
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
177
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
178 private CodeInstallResult(String name) {
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
179 HotSpotVMConfig config = HotSpotGraalRuntime.runtime().getConfig();
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
180 switch (name) {
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
181 case "ok":
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
182 this.value = config.codeInstallResultOk;
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
183 break;
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
184 case "dependencies failed":
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
185 this.value = config.codeInstallResultDependenciesFailed;
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
186 break;
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
187 case "code cache is full":
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
188 this.value = config.codeInstallResultCacheFull;
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
189 break;
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
190 case "code is too large":
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
191 this.value = config.codeInstallResultCodeTooLarge;
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
192 break;
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
193 default:
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
194 throw GraalInternalError.shouldNotReachHere("unknown enum name " + name);
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
195 }
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
196 this.message = name;
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
197 }
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
198
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
199 /**
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
200 * Returns the enum object for the given value.
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
201 */
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
202 public static CodeInstallResult getEnum(int value) {
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
203 for (CodeInstallResult e : values()) {
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
204 if (e.value == value) {
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
205 return e;
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
206 }
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
207 }
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
208 throw GraalInternalError.shouldNotReachHere("unknown enum value " + value);
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
209 }
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
210
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
211 @Override
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
212 public String toString() {
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
213 return message;
f294b4ee2d47 make CodeInstallResult enum independent of the actual values in C++ code
twisti
parents: 13103
diff changeset
214 }
7113
38076efb9062 Do not print code installation failures from Java.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7089
diff changeset
215 }
38076efb9062 Do not print code installation failures from Java.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7089
diff changeset
216
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
217 /**
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
218 * Installs the result of a compilation into the code cache.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
219 *
9669
ed6202820ecf renamed HotSpotCompilationResult to HotSpotCompiledCode and added subclasses HotSpotCompiledNmethod and HotSpotCompiledRuntimeStub
Doug Simon <doug.simon@oracle.com>
parents: 9649
diff changeset
220 * @param compiledCode the result of a compilation
9604
8fe7e6e7b443 javadoc fix
Doug Simon <doug.simon@oracle.com>
parents: 9338
diff changeset
221 * @param code the details of the installed CodeBlob are written to this object
7113
38076efb9062 Do not print code installation failures from Java.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 7089
diff changeset
222 * @return the outcome of the installation as a {@link CodeInstallResult}.
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
223 */
13669
034706a93f27 CodeCacheProvider.addMethod: add speculationLog argument
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 13630
diff changeset
224 CodeInstallResult installCode(HotSpotCompiledCode compiledCode, HotSpotInstalledCode code, SpeculationLog speculationLog);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
225
13103
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
226 /**
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
227 * Notifies the VM of statistics for a completed compilation.
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
228 *
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
229 * @param id the identifier of the compilation
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
230 * @param method the method compiled
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
231 * @param osr specifies if the compilation was for on-stack-replacement
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
232 * @param processedBytecodes the number of bytecodes processed during the compilation, including
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
233 * the bytecodes of all inlined methods
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
234 * @param time the amount time spent compiling {@code method}
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
235 * @param timeUnitsPerSecond the granularity of the units for the {@code time} value
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
236 * @param installedCode the nmethod installed as a result of the compilation
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
237 */
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
238 void notifyCompilationStatistics(int id, HotSpotResolvedJavaMethod method, boolean osr, int processedBytecodes, long time, long timeUnitsPerSecond, HotSpotInstalledCode installedCode);
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
239
13364
5a4293f24642 added -G:PrintCompRate option for periodically printing out the current compilation rate
Doug Simon <doug.simon@oracle.com>
parents: 13306
diff changeset
240 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
241
13103
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
242 void resetCompilationStatistics();
c0b0974dd509 moved notification of Graal compilation statistics from VMToCompiler to CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
243
6363
a73fcf1639fc HotSpotVMConfig object is now allocated in Java
Doug Simon <doug.simon@oracle.com>
parents: 5780
diff changeset
244 void initializeConfiguration(HotSpotVMConfig config);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
245
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
246 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
247
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
248 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: 9669
diff changeset
249
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
250 boolean hasFinalizableSubclass(long metaspaceKlass);
9126
bc26f978b0ce HotSpotResolvedObjectType: implement hasFinalizeSubclass() correctly
Bernhard Urban <bernhard.urban@jku.at>
parents: 9108
diff changeset
251
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
252 /**
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
253 * Gets the compiled code size for a method.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
254 *
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
255 * @param metaspaceMethod the metaspace Method object to query
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
256 * @return the compiled code size the method
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
257 */
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
258 int getCompiledCodeSize(long metaspaceMethod);
4528
e6e14d25e608 added two inlining policies for comparison
Christian Haeubl <christian.haeubl@oracle.com>
parents: 4461
diff changeset
259
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
260 /**
13264
b23cbfb4366a merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents: 13263
diff changeset
261 * Gets the metaspace Method object corresponding to a given {@link Class} object and slot
b23cbfb4366a merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents: 13263
diff changeset
262 * number.
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7307
diff changeset
263 *
13264
b23cbfb4366a merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents: 13263
diff changeset
264 * @param holder method holder
b23cbfb4366a merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents: 13263
diff changeset
265 * @param slot slot number of the method
b23cbfb4366a merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents: 13263
diff changeset
266 * @return the metaspace Method
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
267 */
13264
b23cbfb4366a merged CompilerToVM.getMetaspaceConstructor into CompilerToVM.getMetaspaceMethod
twisti
parents: 13263
diff changeset
268 long getMetaspaceMethod(Class<?> holder, int slot);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
269
9649
dd62ccda1849 rename parameter
Doug Simon <doug.simon@oracle.com>
parents: 9610
diff changeset
270 long getMaxCallTargetOffset(long address);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
271
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
272 String disassembleCodeBlob(long codeBlob);
7784
016e23829147 added HotSpot implementation of disassembling APIs
Doug Simon <doug.simon@oracle.com>
parents: 7530
diff changeset
273
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6588
diff changeset
274 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
275
10475
3489047ffea2 Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10056
diff changeset
276 Object executeCompiledMethod(Object arg1, Object arg2, Object arg3, HotSpotInstalledCode hotspotInstalledCode) throws InvalidInstalledCodeException;
4993
897b7d18bebc added RiCompiledMethod.execute and the required VM infrastructure
Lukas Stadler <lukas.stadler@jku.at>
parents: 4635
diff changeset
277
10475
3489047ffea2 Restructure the handling of HotSpotInstalledCode and their link to nmethods.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10056
diff changeset
278 Object executeCompiledMethodVarargs(Object[] args, HotSpotInstalledCode hotspotInstalledCode) throws InvalidInstalledCodeException;
5246
8bf2c37c46c4 added RiCompiledMethod.executeVarargs(Object...) to support compiling and calling arbitrary Java methods
Doug Simon <doug.simon@oracle.com>
parents: 5238
diff changeset
279
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
280 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
281
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
282 long[] getLineNumberTable(long metaspaceMethod);
7307
dc3e86fd3be1 Introduce cutomization capability for canonicalizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7225
diff changeset
283
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
284 long getLocalVariableTableStart(long metaspaceMethod);
13306
dfb780080923 moved most CompilerToVM.getLocalVariableTable to Java
twisti
parents: 13305
diff changeset
285
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
286 int getLocalVariableTableLength(long metaspaceMethod);
7786
8bbbde9d0a52 extended ResolvedJavaMethod API by getLocalVariableTable
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 7784
diff changeset
287
7307
dc3e86fd3be1 Introduce cutomization capability for canonicalizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7225
diff changeset
288 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
289
10536
26c69598db3e Fix bug in canonicalization of non-compressed object pointers.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10476
diff changeset
290 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
291
10715
c3760150dc29 Add function to read compressed klass pointers of constant objects natively
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10639
diff changeset
292 long readUnsafeKlassPointer(Object o);
c3760150dc29 Add function to read compressed klass pointers of constant objects natively
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 10639
diff changeset
293
12535
cee7f686c470 rename CompilerToVm.dontInline to doNotInlineOrCompile
Matthias Grimmer <grimmer@ssw.jku.at>
parents: 12533
diff changeset
294 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
295
8611
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8349
diff changeset
296 /**
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8349
diff changeset
297 * Invalidates the profiling information and restarts profiling upon the next invocation.
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8349
diff changeset
298 *
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8349
diff changeset
299 * @param metaspaceMethod the metaspace Method object
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8349
diff changeset
300 */
6c4db417385a added API to reset the profiling information for a method
Christian Haeubl <haeubl@ssw.jku.at>
parents: 8349
diff changeset
301 void reprofile(long metaspaceMethod);
8945
7ef66078d837 add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents: 8614
diff changeset
302
10476
cd68d6902328 Fix invalidateInstalledCode and delete isInstalledCodeValid.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 10475
diff changeset
303 void invalidateInstalledCode(HotSpotInstalledCode hotspotInstalledCode);
11520
7cca436d600b Add isLinked method to ResolvedJavaType
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 10715
diff changeset
304
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
305 /**
d7964e96b0b0 move benchmark counters into separate class and make them correct for multithreaded applications
Lukas Stadler <lukas.stadler@jku.at>
parents: 11520
diff changeset
306 * Collects the current values of all Graal benchmark counters, summed up over all threads.
d7964e96b0b0 move benchmark counters into separate class and make them correct for multithreaded applications
Lukas Stadler <lukas.stadler@jku.at>
parents: 11520
diff changeset
307 */
d7964e96b0b0 move benchmark counters into separate class and make them correct for multithreaded applications
Lukas Stadler <lukas.stadler@jku.at>
parents: 11520
diff changeset
308 long[] collectCounters();
13630
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13483
diff changeset
309
13769
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13669
diff changeset
310 boolean isMature(long metaspaceMethodData);
af344056124f Only use mature method datas
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13669
diff changeset
311
13630
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13483
diff changeset
312 /**
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13483
diff changeset
313 * Generate a unique id to identify the result of the compile.
b1838411e896 Use compile ids assigned by hotspot
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 13483
diff changeset
314 */
14104
a38a54030ea2 pass metaspace pointers instead of object to VM
twisti
parents: 14093
diff changeset
315 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
316
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13769
diff changeset
317 /**
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13769
diff changeset
318 * Gets the names of the supported GPU architectures.
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13769
diff changeset
319 *
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13769
diff changeset
320 * @return a comma separated list of names
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13769
diff changeset
321 */
49db2c1e3bee added support for co-existing GPU backends (JBS:GRAAL-1)
Doug Simon <doug.simon@oracle.com>
parents: 13769
diff changeset
322 String getGPUs();
14107
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
323
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
324 /**
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
325 *
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
326 * @param metaspaceMethod the method to check
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
327 * @param entryBCI
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
328 * @param level the compilation level
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
329 * @return true if the {@code metaspaceMethod} has code for {@code level}
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
330 */
800057208a2c enable C1 + Graal tiered
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 14105
diff changeset
331 boolean hasCompiledCodeForOSR(long metaspaceMethod, int entryBCI, int level);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
332 }