8255068: [JVMCI] errors during compiler creation can be hidden
Reviewed-by: kvn
This commit is contained in:
parent
8d9e6d01fb
commit
6020991530
@ -46,6 +46,7 @@ import java.util.ServiceLoader;
|
|||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
import jdk.vm.ci.code.Architecture;
|
import jdk.vm.ci.code.Architecture;
|
||||||
|
import jdk.vm.ci.code.CompilationRequest;
|
||||||
import jdk.vm.ci.code.CompilationRequestResult;
|
import jdk.vm.ci.code.CompilationRequestResult;
|
||||||
import jdk.vm.ci.code.CompiledCode;
|
import jdk.vm.ci.code.CompiledCode;
|
||||||
import jdk.vm.ci.code.InstalledCode;
|
import jdk.vm.ci.code.InstalledCode;
|
||||||
@ -698,6 +699,19 @@ public final class HotSpotJVMCIRuntime implements JVMCIRuntime {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static class ErrorCreatingCompiler implements JVMCICompiler {
|
||||||
|
private final RuntimeException t;
|
||||||
|
|
||||||
|
ErrorCreatingCompiler(RuntimeException t) {
|
||||||
|
this.t = t;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompilationRequestResult compileMethod(CompilationRequest request) {
|
||||||
|
throw t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JVMCICompiler getCompiler() {
|
public JVMCICompiler getCompiler() {
|
||||||
if (compiler == null) {
|
if (compiler == null) {
|
||||||
@ -705,11 +719,19 @@ public final class HotSpotJVMCIRuntime implements JVMCIRuntime {
|
|||||||
if (compiler == null) {
|
if (compiler == null) {
|
||||||
assert !creatingCompiler : "recursive compiler creation";
|
assert !creatingCompiler : "recursive compiler creation";
|
||||||
creatingCompiler = true;
|
creatingCompiler = true;
|
||||||
compiler = compilerFactory.createCompiler(this);
|
try {
|
||||||
creatingCompiler = false;
|
compiler = compilerFactory.createCompiler(this);
|
||||||
|
} catch (RuntimeException t) {
|
||||||
|
compiler = new ErrorCreatingCompiler(t);
|
||||||
|
} finally {
|
||||||
|
creatingCompiler = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (compiler instanceof ErrorCreatingCompiler) {
|
||||||
|
throw ((ErrorCreatingCompiler) compiler).t;
|
||||||
|
}
|
||||||
return compiler;
|
return compiler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user