Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8255068: [JVMCI] errors during compiler creation can be hidden #2230

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -42,6 +42,7 @@
import jdk.internal.misc.VM;
import jdk.internal.misc.Unsafe;
import jdk.vm.ci.code.Architecture;
import jdk.vm.ci.code.CompilationRequest;
import jdk.vm.ci.code.CompilationRequestResult;
import jdk.vm.ci.code.CompiledCode;
import jdk.vm.ci.code.InstalledCode;
Expand Down Expand Up @@ -417,15 +418,35 @@ public Class<?> getMirror(ResolvedJavaType type) {
return ((HotSpotResolvedJavaType) type).mirror();
}

static class ErrorCreatingCompiler implements JVMCICompiler {
private final RuntimeException t;

ErrorCreatingCompiler(RuntimeException t) {
this.t = t;
}

@Override
public CompilationRequestResult compileMethod(CompilationRequest request) {
throw t;
}
}

@Override
public JVMCICompiler getCompiler() {
if (compiler == null) {
synchronized (this) {
if (compiler == null) {
compiler = compilerFactory.createCompiler(this);
try {
compiler = compilerFactory.createCompiler(this);
} catch (RuntimeException t) {
compiler = new ErrorCreatingCompiler(t);
}
}
}
}
if (compiler instanceof ErrorCreatingCompiler) {
throw ((ErrorCreatingCompiler) compiler).t;
}
return compiler;
}

Expand Down