use of org.graalvm.compiler.core.common.CompilationListenerProfiler in project graal by oracle.
the class HotSpotGraalRuntime method openDebugContext.
@Override
public DebugContext openDebugContext(OptionValues compilationOptions, CompilationIdentifier compilationId, Object compilable, Iterable<DebugHandlersFactory> factories, PrintStream logStream) {
if (management != null && management.poll(false) != null) {
if (compilable instanceof HotSpotResolvedJavaMethod) {
HotSpotResolvedObjectType type = ((HotSpotResolvedJavaMethod) compilable).getDeclaringClass();
if (type instanceof HotSpotResolvedJavaType) {
Class<?> clazz = runtime().getMirror(type);
if (clazz != null) {
try {
ClassLoader cl = clazz.getClassLoader();
if (cl != null) {
loaders.add(cl);
}
} catch (SecurityException e) {
// This loader can obviously not be used for resolving class names
}
}
}
}
}
Description description = new Description(compilable, compilationId.toString(CompilationIdentifier.Verbosity.ID));
Builder builder = //
new Builder(compilationOptions, factories).globalMetrics(//
metricValues).description(//
description).logStream(logStream);
if (compilerProfiler != null) {
int compileId = ((HotSpotCompilationIdentifier) compilationId).getRequest().getId();
builder.compilationListener(new CompilationListenerProfiler(compilerProfiler, compileId));
}
return builder.build();
}
Aggregations