File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed
src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change 46
46
import java .util .function .Predicate ;
47
47
48
48
import jdk .vm .ci .code .Architecture ;
49
+ import jdk .vm .ci .code .CompilationRequest ;
49
50
import jdk .vm .ci .code .CompilationRequestResult ;
50
51
import jdk .vm .ci .code .CompiledCode ;
51
52
import jdk .vm .ci .code .InstalledCode ;
@@ -698,18 +699,39 @@ public Class<?> getMirror(ResolvedJavaType type) {
698
699
return null ;
699
700
}
700
701
702
+ static class ErrorCreatingCompiler implements JVMCICompiler {
703
+ private final RuntimeException t ;
704
+
705
+ ErrorCreatingCompiler (RuntimeException t ) {
706
+ this .t = t ;
707
+ }
708
+
709
+ @ Override
710
+ public CompilationRequestResult compileMethod (CompilationRequest request ) {
711
+ throw t ;
712
+ }
713
+ }
714
+
701
715
@ Override
702
716
public JVMCICompiler getCompiler () {
703
717
if (compiler == null ) {
704
718
synchronized (this ) {
705
719
if (compiler == null ) {
706
720
assert !creatingCompiler : "recursive compiler creation" ;
707
721
creatingCompiler = true ;
708
- compiler = compilerFactory .createCompiler (this );
709
- creatingCompiler = false ;
722
+ try {
723
+ compiler = compilerFactory .createCompiler (this );
724
+ } catch (RuntimeException t ) {
725
+ compiler = new ErrorCreatingCompiler (t );
726
+ } finally {
727
+ creatingCompiler = false ;
728
+ }
710
729
}
711
730
}
712
731
}
732
+ if (compiler instanceof ErrorCreatingCompiler ) {
733
+ throw ((ErrorCreatingCompiler ) compiler ).t ;
734
+ }
713
735
return compiler ;
714
736
}
715
737
You can’t perform that action at this time.
0 commit comments