use of jdk.vm.ci.code.CompilationRequestResult in project graal by oracle.
the class HotSpotGraalCompiler method compileMethod.
@SuppressWarnings("try")
CompilationRequestResult compileMethod(CompilationRequest request, boolean installAsDefault) {
if (graalRuntime.isShutdown()) {
return HotSpotCompilationRequestResult.failure(String.format("Shutdown entered"), false);
}
ResolvedJavaMethod method = request.getMethod();
OptionValues options = graalRuntime.getOptions(method);
if (graalRuntime.isBootstrapping()) {
if (DebugOptions.BootstrapInitializeOnly.getValue(options)) {
return HotSpotCompilationRequestResult.failure(String.format("Skip compilation because %s is enabled", DebugOptions.BootstrapInitializeOnly.getName()), true);
}
if (bootstrapWatchDog != null) {
if (bootstrapWatchDog.hitCriticalCompilationRateOrTimeout()) {
// Drain the compilation queue to expedite completion of the bootstrap
return HotSpotCompilationRequestResult.failure("hit critical bootstrap compilation rate or timeout", true);
}
}
}
HotSpotCompilationRequest hsRequest = (HotSpotCompilationRequest) request;
try (CompilationWatchDog w1 = CompilationWatchDog.watch(method, hsRequest.getId(), options);
BootstrapWatchDog.Watch w2 = bootstrapWatchDog == null ? null : bootstrapWatchDog.watch(request);
CompilationAlarm alarm = CompilationAlarm.trackCompilationPeriod(options)) {
if (compilationCounters != null) {
compilationCounters.countCompilation(method);
}
CompilationTask task = new CompilationTask(jvmciRuntime, this, hsRequest, true, installAsDefault, options);
CompilationRequestResult r = null;
try (DebugContext debug = graalRuntime.openDebugContext(options, task.getCompilationIdentifier(), method, getDebugHandlersFactories());
Activation a = debug.activate()) {
r = task.runCompilation(debug);
}
assert r != null;
return r;
}
}
Aggregations