use of jdk.vm.ci.hotspot.HotSpotCompilationRequest in project graal by oracle.
the class HotSpotTruffleCompilerImpl method getCompilationIdentifier.
@Override
public CompilationRequestIdentifier getCompilationIdentifier(CompilableTruffleAST compilable) {
ResolvedJavaMethod rootMethod = partialEvaluator.rootForCallTarget(compilable);
HotSpotCompilationRequest request = new HotSpotCompilationRequest((HotSpotResolvedJavaMethod) rootMethod, JVMCICompiler.INVOCATION_ENTRY_BCI, 0L);
return new HotSpotTruffleCompilationIdentifier(request, compilable);
}
use of jdk.vm.ci.hotspot.HotSpotCompilationRequest in project graal by oracle.
the class HotSpotGraalMBean method dumpMethod.
public void dumpMethod(String className, String methodName, String filter, String host, int port) throws javax.management.MBeanException {
String jvmName = MetaUtil.toInternalName(className);
methodDumps.add(new Dump(host, port, jvmName, methodName, filter));
ClassNotFoundException last = null;
EconomicSet<Class<?>> found = EconomicSet.create();
Iterator<Reference<ClassLoader>> it = loaders.iterator();
while (it.hasNext()) {
Reference<ClassLoader> ref = it.next();
ClassLoader loader = ref.get();
if (loader == null) {
it.remove();
continue;
}
try {
Class<?> clazz = Class.forName(className, false, loader);
if (found.add(clazz)) {
ResolvedJavaType type = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess().lookupJavaType(clazz);
if (compiler != null) {
for (ResolvedJavaMethod method : type.getDeclaredMethods()) {
if (methodName.equals(method.getName()) && method instanceof HotSpotResolvedJavaMethod) {
HotSpotResolvedJavaMethod hotSpotMethod = (HotSpotResolvedJavaMethod) method;
compiler.compileMethod(new HotSpotCompilationRequest(hotSpotMethod, -1, 0L), false);
}
}
}
}
} catch (ClassNotFoundException ex) {
last = ex;
}
}
if (found.isEmpty()) {
throw new javax.management.MBeanException(last, "Cannot find class " + className + " to schedule recompilation");
}
}
use of jdk.vm.ci.hotspot.HotSpotCompilationRequest in project graal by oracle.
the class MemoryUsageBenchmark method allocSpyCompilation.
@SuppressWarnings("try")
private void allocSpyCompilation(String methodName) {
if (AllocSpy.isEnabled()) {
HotSpotResolvedJavaMethod method = (HotSpotResolvedJavaMethod) getResolvedJavaMethod(methodName);
// invalidate any existing compiled code
method.reprofile();
long jvmciEnv = 0L;
try (AllocSpy as = AllocSpy.open(methodName)) {
HotSpotJVMCIRuntimeProvider runtime = HotSpotJVMCIRuntime.runtime();
HotSpotCompilationRequest request = new HotSpotCompilationRequest(method, JVMCICompiler.INVOCATION_ENTRY_BCI, jvmciEnv);
HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) runtime.getCompiler();
OptionValues options = getInitialOptions();
CompilationTask task = new CompilationTask(runtime, compiler, request, true, false, options);
task.runCompilation();
}
}
}
Aggregations