author | kvn |
Mon, 06 May 2019 20:05:19 -0700 | |
changeset 54732 | 2d012a75d35c |
parent 54669 | ad45b3802d4e |
child 55487 | 79c32c7b0992 |
permissions | -rw-r--r-- |
43972 | 1 |
/* |
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
2 |
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. |
43972 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
||
24 |
package jdk.vm.ci.hotspot; |
|
25 |
||
26 |
import jdk.vm.ci.code.InstalledCode; |
|
27 |
import jdk.vm.ci.code.InvalidInstalledCodeException; |
|
28 |
import jdk.vm.ci.code.TargetDescription; |
|
49358 | 29 |
import jdk.vm.ci.code.stack.InspectedFrameVisitor; |
43972 | 30 |
import jdk.vm.ci.meta.ConstantPool; |
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
31 |
import jdk.vm.ci.meta.JavaConstant; |
43972 | 32 |
import jdk.vm.ci.meta.ResolvedJavaMethod; |
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
33 |
import jdk.vm.ci.meta.MetaAccessProvider; |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
34 |
import jdk.vm.ci.runtime.JVMCI; |
43972 | 35 |
import java.lang.reflect.Executable; |
36 |
||
37 |
/** |
|
38 |
* A simple "proxy" class to get test access to CompilerToVM package-private methods |
|
39 |
*/ |
|
40 |
public class CompilerToVMHelper { |
|
41 |
public static final CompilerToVM CTVM = new CompilerToVM(); |
|
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
42 |
private static final MetaAccessProvider metaAccess = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess(); |
43972 | 43 |
|
44 |
public static byte[] getBytecode(HotSpotResolvedJavaMethod method) { |
|
45 |
return CTVM.getBytecode((HotSpotResolvedJavaMethodImpl)method); |
|
46 |
} |
|
47 |
||
48 |
public static int getExceptionTableLength(HotSpotResolvedJavaMethod method) { |
|
49 |
return CTVM.getExceptionTableLength((HotSpotResolvedJavaMethodImpl)method); |
|
50 |
} |
|
51 |
||
52 |
public static long getExceptionTableStart(HotSpotResolvedJavaMethod method) { |
|
53 |
return CTVM.getExceptionTableStart((HotSpotResolvedJavaMethodImpl)method); |
|
54 |
} |
|
55 |
||
56 |
public static Object getFlagValue(String name) { |
|
57 |
return CTVM.getFlagValue(name); |
|
58 |
} |
|
59 |
||
60 |
public static boolean isCompilable(HotSpotResolvedJavaMethod method) { |
|
61 |
return CTVM.isCompilable((HotSpotResolvedJavaMethodImpl)method); |
|
62 |
} |
|
63 |
||
64 |
public static boolean hasNeverInlineDirective(HotSpotResolvedJavaMethod method) { |
|
65 |
return CTVM.hasNeverInlineDirective((HotSpotResolvedJavaMethodImpl)method); |
|
66 |
} |
|
67 |
||
68 |
public static boolean shouldInlineMethod(HotSpotResolvedJavaMethod method) { |
|
69 |
return CTVM.shouldInlineMethod((HotSpotResolvedJavaMethodImpl)method); |
|
70 |
} |
|
71 |
||
72 |
public static HotSpotResolvedJavaMethod findUniqueConcreteMethod( |
|
73 |
HotSpotResolvedObjectType actualHolderType, |
|
74 |
HotSpotResolvedJavaMethod method) { |
|
75 |
return CTVM.findUniqueConcreteMethod((HotSpotResolvedObjectTypeImpl) actualHolderType, (HotSpotResolvedJavaMethodImpl)method); |
|
76 |
} |
|
77 |
||
78 |
public static HotSpotResolvedObjectType getImplementor(HotSpotResolvedObjectType type) { |
|
79 |
return CTVM.getImplementor((HotSpotResolvedObjectTypeImpl) type); |
|
80 |
} |
|
81 |
||
82 |
public static boolean methodIsIgnoredBySecurityStackWalk(HotSpotResolvedJavaMethod method) { |
|
83 |
return CTVM.methodIsIgnoredBySecurityStackWalk((HotSpotResolvedJavaMethodImpl)method); |
|
84 |
} |
|
85 |
||
86 |
public static HotSpotResolvedObjectType lookupType(String name, |
|
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
87 |
Class<?> accessClass, boolean resolve) throws ClassNotFoundException { |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
88 |
if (accessClass == null) { |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
89 |
throw new NullPointerException(); |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
90 |
} |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
91 |
HotSpotResolvedObjectTypeImpl accessingClass = (HotSpotResolvedObjectTypeImpl) metaAccess.lookupJavaType(accessClass); |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
92 |
return (HotSpotResolvedObjectType) CTVM.lookupType(name, accessingClass, resolve); |
46972
3e88de95fccf
8186459: [JVMCI] ClassNotFoundException thrown by CompilerToVM.lookupType() should be converted to a LinkageError
dnsimon
parents:
46481
diff
changeset
|
93 |
} |
3e88de95fccf
8186459: [JVMCI] ClassNotFoundException thrown by CompilerToVM.lookupType() should be converted to a LinkageError
dnsimon
parents:
46481
diff
changeset
|
94 |
|
3e88de95fccf
8186459: [JVMCI] ClassNotFoundException thrown by CompilerToVM.lookupType() should be converted to a LinkageError
dnsimon
parents:
46481
diff
changeset
|
95 |
public static HotSpotResolvedObjectType lookupTypeHelper(String name, |
43972 | 96 |
Class<?> accessingClass, boolean resolve) { |
46972
3e88de95fccf
8186459: [JVMCI] ClassNotFoundException thrown by CompilerToVM.lookupType() should be converted to a LinkageError
dnsimon
parents:
46481
diff
changeset
|
97 |
try { |
3e88de95fccf
8186459: [JVMCI] ClassNotFoundException thrown by CompilerToVM.lookupType() should be converted to a LinkageError
dnsimon
parents:
46481
diff
changeset
|
98 |
return lookupType(name, accessingClass, resolve); |
3e88de95fccf
8186459: [JVMCI] ClassNotFoundException thrown by CompilerToVM.lookupType() should be converted to a LinkageError
dnsimon
parents:
46481
diff
changeset
|
99 |
} catch (ClassNotFoundException e) { |
3e88de95fccf
8186459: [JVMCI] ClassNotFoundException thrown by CompilerToVM.lookupType() should be converted to a LinkageError
dnsimon
parents:
46481
diff
changeset
|
100 |
throw (NoClassDefFoundError) new NoClassDefFoundError().initCause(e); |
3e88de95fccf
8186459: [JVMCI] ClassNotFoundException thrown by CompilerToVM.lookupType() should be converted to a LinkageError
dnsimon
parents:
46481
diff
changeset
|
101 |
} |
43972 | 102 |
} |
103 |
||
104 |
public static Object resolveConstantInPool(ConstantPool constantPool, int cpi) { |
|
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
105 |
DirectHotSpotObjectConstantImpl obj = (DirectHotSpotObjectConstantImpl) CTVM.resolveConstantInPool((HotSpotConstantPool) constantPool, cpi); |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
106 |
return obj.object; |
43972 | 107 |
} |
108 |
||
109 |
public static Object resolvePossiblyCachedConstantInPool(ConstantPool constantPool, int cpi) { |
|
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
110 |
DirectHotSpotObjectConstantImpl obj = (DirectHotSpotObjectConstantImpl) CTVM.resolvePossiblyCachedConstantInPool((HotSpotConstantPool) constantPool, cpi); |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
111 |
return obj.object; |
43972 | 112 |
} |
113 |
||
114 |
public static int lookupNameAndTypeRefIndexInPool(ConstantPool constantPool, int cpi) { |
|
115 |
return CTVM.lookupNameAndTypeRefIndexInPool((HotSpotConstantPool) constantPool, cpi); |
|
116 |
} |
|
117 |
||
118 |
public static String lookupNameInPool(ConstantPool constantPool, int cpi) { |
|
119 |
return CTVM.lookupNameInPool((HotSpotConstantPool) constantPool, cpi); |
|
120 |
} |
|
121 |
||
122 |
public static String lookupSignatureInPool(ConstantPool constantPool, int cpi) { |
|
123 |
return CTVM.lookupSignatureInPool((HotSpotConstantPool) constantPool, cpi); |
|
124 |
} |
|
125 |
||
126 |
public static int lookupKlassRefIndexInPool(ConstantPool constantPool, int cpi) { |
|
127 |
return CTVM.lookupKlassRefIndexInPool((HotSpotConstantPool) constantPool, cpi); |
|
128 |
} |
|
129 |
||
130 |
public static Object lookupKlassInPool(ConstantPool constantPool, int cpi) { |
|
131 |
return CTVM.lookupKlassInPool((HotSpotConstantPool) constantPool, cpi); |
|
132 |
} |
|
133 |
||
134 |
public static HotSpotResolvedJavaMethod lookupMethodInPool( |
|
135 |
ConstantPool constantPool, int cpi, byte opcode) { |
|
136 |
return CTVM.lookupMethodInPool((HotSpotConstantPool) constantPool, cpi, opcode); |
|
137 |
} |
|
138 |
||
139 |
public static void resolveInvokeDynamicInPool( |
|
140 |
ConstantPool constantPool, int cpi) { |
|
141 |
CTVM.resolveInvokeDynamicInPool((HotSpotConstantPool) constantPool, cpi); |
|
142 |
} |
|
143 |
||
144 |
public static void resolveInvokeHandleInPool( |
|
145 |
ConstantPool constantPool, int cpi) { |
|
146 |
CTVM.resolveInvokeHandleInPool((HotSpotConstantPool) constantPool, cpi); |
|
147 |
} |
|
148 |
||
149 |
public static HotSpotResolvedObjectType resolveTypeInPool( |
|
150 |
ConstantPool constantPool, int cpi) { |
|
151 |
return CTVM.resolveTypeInPool((HotSpotConstantPool) constantPool, cpi); |
|
152 |
} |
|
153 |
||
154 |
public static HotSpotResolvedObjectType resolveFieldInPool( |
|
155 |
ConstantPool constantPool, int cpi, ResolvedJavaMethod method, byte opcode, int[] info) { |
|
156 |
return CTVM.resolveFieldInPool((HotSpotConstantPool) constantPool, cpi, (HotSpotResolvedJavaMethodImpl) method, opcode, info); |
|
157 |
} |
|
158 |
||
159 |
public static int constantPoolRemapInstructionOperandFromCache( |
|
160 |
ConstantPool constantPool, int cpci) { |
|
161 |
return CTVM.constantPoolRemapInstructionOperandFromCache((HotSpotConstantPool) constantPool, cpci); |
|
162 |
} |
|
163 |
||
164 |
public static Object lookupAppendixInPool( |
|
165 |
ConstantPool constantPool, int cpi) { |
|
166 |
return CTVM.lookupAppendixInPool((HotSpotConstantPool) constantPool, cpi); |
|
167 |
} |
|
168 |
||
169 |
public static int installCode(TargetDescription target, |
|
170 |
HotSpotCompiledCode compiledCode, InstalledCode code, HotSpotSpeculationLog speculationLog) { |
|
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
171 |
byte[] speculations; |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
172 |
long failedSpeculationsAddress; |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
173 |
if (speculationLog != null) { |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
174 |
speculations = speculationLog.getFlattenedSpeculations(true); |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
175 |
failedSpeculationsAddress = speculationLog.getFailedSpeculationsAddress(); |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
176 |
} else { |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
177 |
speculations = new byte[0]; |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
178 |
failedSpeculationsAddress = 0L; |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
179 |
} |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
180 |
return CTVM.installCode(target, compiledCode, code, failedSpeculationsAddress, speculations); |
43972 | 181 |
} |
182 |
||
183 |
public static int getMetadata(TargetDescription target, |
|
184 |
HotSpotCompiledCode compiledCode, HotSpotMetaData metaData) { |
|
185 |
return CTVM.getMetadata(target, compiledCode, metaData); |
|
186 |
} |
|
187 |
||
188 |
public static void resetCompilationStatistics() { |
|
189 |
CTVM.resetCompilationStatistics(); |
|
190 |
} |
|
191 |
||
192 |
public static Object[] readConfiguration() { |
|
193 |
return CTVM.readConfiguration(); |
|
194 |
} |
|
195 |
||
196 |
public static HotSpotResolvedJavaMethod resolveMethod( |
|
197 |
HotSpotResolvedObjectType exactReceiver, |
|
198 |
HotSpotResolvedJavaMethod method, |
|
199 |
HotSpotResolvedObjectType caller) { |
|
200 |
return CTVM.resolveMethod((HotSpotResolvedObjectTypeImpl) exactReceiver, (HotSpotResolvedJavaMethodImpl) method, (HotSpotResolvedObjectTypeImpl) caller); |
|
201 |
} |
|
202 |
||
203 |
public static HotSpotResolvedJavaMethod getClassInitializer( |
|
204 |
HotSpotResolvedObjectType type) { |
|
205 |
return CTVM.getClassInitializer((HotSpotResolvedObjectTypeImpl) type); |
|
206 |
} |
|
207 |
||
208 |
public static boolean hasFinalizableSubclass(HotSpotResolvedObjectType type) { |
|
209 |
return CTVM.hasFinalizableSubclass((HotSpotResolvedObjectTypeImpl) type); |
|
210 |
} |
|
211 |
||
212 |
public static HotSpotResolvedJavaMethodImpl asResolvedJavaMethod( |
|
213 |
Executable executable) { |
|
214 |
return CTVM.asResolvedJavaMethod(executable); |
|
215 |
} |
|
216 |
||
217 |
public static long getMaxCallTargetOffset(long address) { |
|
218 |
return CTVM.getMaxCallTargetOffset(address); |
|
219 |
} |
|
220 |
||
221 |
public static String disassembleCodeBlob(InstalledCode codeBlob) { |
|
222 |
return CTVM.disassembleCodeBlob(codeBlob); |
|
223 |
} |
|
224 |
||
225 |
public static StackTraceElement getStackTraceElement( |
|
226 |
HotSpotResolvedJavaMethod method, int bci) { |
|
227 |
return CTVM.getStackTraceElement((HotSpotResolvedJavaMethodImpl)method, bci); |
|
228 |
} |
|
229 |
||
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
230 |
public static Object executeHotSpotNmethod(Object[] args, |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
231 |
HotSpotNmethod nmethodMirror) throws InvalidInstalledCodeException { |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
232 |
return CTVM.executeHotSpotNmethod(args, nmethodMirror); |
43972 | 233 |
} |
234 |
||
235 |
public static long[] getLineNumberTable(HotSpotResolvedJavaMethod method) { |
|
236 |
return CTVM.getLineNumberTable((HotSpotResolvedJavaMethodImpl)method); |
|
237 |
} |
|
238 |
||
239 |
public static int getLocalVariableTableLength(HotSpotResolvedJavaMethod method) { |
|
240 |
return CTVM.getLocalVariableTableLength((HotSpotResolvedJavaMethodImpl)method); |
|
241 |
} |
|
242 |
||
243 |
public static long getLocalVariableTableStart(HotSpotResolvedJavaMethod method) { |
|
244 |
return CTVM.getLocalVariableTableStart((HotSpotResolvedJavaMethodImpl)method); |
|
245 |
} |
|
246 |
||
47793
3dcd54513db1
8186478: [JVMCI] rename HotSpotResolvedJavaMethod#setNotInlineableOrCompileable
dnsimon
parents:
47668
diff
changeset
|
247 |
public static void setNotInlinableOrCompilable(HotSpotResolvedJavaMethod method) { |
3dcd54513db1
8186478: [JVMCI] rename HotSpotResolvedJavaMethod#setNotInlineableOrCompileable
dnsimon
parents:
47668
diff
changeset
|
248 |
CTVM.setNotInlinableOrCompilable((HotSpotResolvedJavaMethodImpl)method); |
43972 | 249 |
} |
250 |
||
251 |
public static void reprofile(HotSpotResolvedJavaMethod method) { |
|
252 |
CTVM.reprofile((HotSpotResolvedJavaMethodImpl)method); |
|
253 |
} |
|
254 |
||
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
255 |
public static void invalidateHotSpotNmethod(HotSpotNmethod nmethodMirror) { |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
256 |
CTVM.invalidateHotSpotNmethod(nmethodMirror); |
43972 | 257 |
} |
258 |
||
259 |
public static long[] collectCounters() { |
|
260 |
return CTVM.collectCounters(); |
|
261 |
} |
|
262 |
||
263 |
public static boolean isMature(long metaspaceMethodData) { |
|
264 |
return CTVM.isMature(metaspaceMethodData); |
|
265 |
} |
|
266 |
||
267 |
public static int allocateCompileId(HotSpotResolvedJavaMethod method, |
|
268 |
int entryBCI) { |
|
269 |
return CTVM.allocateCompileId((HotSpotResolvedJavaMethodImpl) method, entryBCI); |
|
270 |
} |
|
271 |
||
272 |
public static boolean hasCompiledCodeForOSR( |
|
273 |
HotSpotResolvedJavaMethod method, int entryBCI, int level) { |
|
274 |
return CTVM.hasCompiledCodeForOSR((HotSpotResolvedJavaMethodImpl) method, entryBCI, level); |
|
275 |
} |
|
276 |
||
277 |
public static String getSymbol(long metaspaceSymbol) { |
|
278 |
return CTVM.getSymbol(metaspaceSymbol); |
|
279 |
} |
|
280 |
||
49358 | 281 |
public static <T> T iterateFrames( |
282 |
ResolvedJavaMethod[] initialMethods, |
|
283 |
ResolvedJavaMethod[] matchingMethods, |
|
284 |
int initialSkip, |
|
285 |
InspectedFrameVisitor<T> visitor) { |
|
286 |
return CTVM.iterateFrames(initialMethods, matchingMethods, initialSkip, visitor); |
|
43972 | 287 |
} |
288 |
||
289 |
public static void materializeVirtualObjects( |
|
290 |
HotSpotStackFrameReference stackFrame, boolean invalidate) { |
|
291 |
CTVM.materializeVirtualObjects(stackFrame, invalidate); |
|
292 |
} |
|
293 |
||
294 |
public static int getVtableIndexForInterfaceMethod(HotSpotResolvedObjectType type, |
|
295 |
HotSpotResolvedJavaMethod method) { |
|
296 |
return CTVM.getVtableIndexForInterfaceMethod((HotSpotResolvedObjectTypeImpl) type, (HotSpotResolvedJavaMethodImpl) method); |
|
297 |
} |
|
298 |
||
299 |
public static boolean shouldDebugNonSafepoints() { |
|
300 |
return CTVM.shouldDebugNonSafepoints(); |
|
301 |
} |
|
302 |
||
303 |
public static void writeDebugOutput(byte[] bytes, int offset, int length) { |
|
54732 | 304 |
CTVM.writeDebugOutput(bytes, offset, length, true, true); |
43972 | 305 |
} |
306 |
||
307 |
public static void flushDebugOutput() { |
|
308 |
CTVM.flushDebugOutput(); |
|
309 |
} |
|
310 |
||
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
311 |
public static HotSpotResolvedJavaMethod getResolvedJavaMethod(HotSpotObjectConstantImpl base, |
43972 | 312 |
long displacement) { |
313 |
return CTVM.getResolvedJavaMethod(base, displacement); |
|
314 |
} |
|
315 |
||
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
316 |
public static HotSpotConstantPool getConstantPool(MetaspaceObject object) { |
43972 | 317 |
return CTVM.getConstantPool(object); |
318 |
} |
|
319 |
||
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
320 |
public static HotSpotResolvedObjectType getResolvedJavaType(MetaspaceObject base, |
43972 | 321 |
long displacement, boolean compressed) { |
322 |
return CTVM.getResolvedJavaType(base, displacement, compressed); |
|
323 |
} |
|
324 |
||
325 |
public static long getMetaspacePointer(Object o) { |
|
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
326 |
return ((MetaspaceObject) o).getMetaspacePointer(); |
43972 | 327 |
} |
328 |
||
329 |
public static Class<?> CompilerToVMClass() { |
|
330 |
return CompilerToVM.class; |
|
331 |
} |
|
332 |
||
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
333 |
public static JavaConstant getJavaMirror(HotSpotResolvedObjectType type) { |
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
334 |
return ((HotSpotResolvedJavaType) type).getJavaMirror(); |
43972 | 335 |
} |
50858 | 336 |
|
337 |
public static HotSpotResolvedObjectType fromObjectClass(Class<?> theClass) { |
|
54669
ad45b3802d4e
8220623: [JVMCI] Update JVMCI to support JVMCI based Compiler compiled into shared library
kvn
parents:
50858
diff
changeset
|
338 |
return (HotSpotResolvedObjectType) metaAccess.lookupJavaType(theClass); |
50858 | 339 |
} |
43972 | 340 |
} |