|
85 | 85 | import static java.lang.System.lineSeparator;
|
86 | 86 | import static java.util.stream.Collectors.joining;
|
87 | 87 |
|
88 |
| -import java.io.PrintStream; |
89 | 88 | import java.lang.reflect.Method;
|
90 | 89 | import java.lang.reflect.Modifier;
|
91 | 90 | import java.net.URI;
|
|
130 | 129 | */
|
131 | 130 | final class TruffleFromLibGraalEntryPoints {
|
132 | 131 |
|
133 |
| - static { |
134 |
| - assert checkHotSpotCalls(); |
135 |
| - } |
136 |
| - |
137 | 132 | @TruffleFromLibGraal(Id.OnIsolateShutdown)
|
138 | 133 | static void onIsolateShutdown(long isolateId) {
|
139 | 134 | LibGraalIsolate.unregister(isolateId);
|
@@ -491,7 +486,7 @@ static Object getHostMethodInfo(Object truffleRuntime, long methodHandle) {
|
491 | 486 | * </ol>
|
492 | 487 | * </p>
|
493 | 488 | */
|
494 |
| - private static boolean checkHotSpotCalls() { |
| 489 | + static boolean checkHotSpotCalls() { |
495 | 490 | Set<Id> unimplemented = EnumSet.allOf(Id.class);
|
496 | 491 | Map<String, Id> entryPointMethodNames = unimplemented.stream().collect(Collectors.toMap(Id::getMethodName, (id) -> id));
|
497 | 492 | Map<Id, List<Method>> idToMethod = new LinkedHashMap<>();
|
@@ -549,13 +544,8 @@ private static String missingImpl(Id id) {
|
549 | 544 | private static void check(Id id, boolean condition, String format, Object... args) {
|
550 | 545 | if (!condition) {
|
551 | 546 | String msg = format(format, args);
|
552 |
| - PrintStream err = System.err; |
553 |
| - if (id != null) { |
554 |
| - err.printf("ERROR: %s.%s: %s%n", TruffleFromLibGraalEntryPoints.class.getName(), id, msg); |
555 |
| - } else { |
556 |
| - err.printf("ERROR: %s: %s%n", TruffleFromLibGraalEntryPoints.class.getName(), msg); |
557 |
| - } |
558 |
| - System.exit(99); |
| 547 | + String target = id != null ? format("%s.%s", TruffleFromLibGraalEntryPoints.class.getName(), id) : TruffleFromLibGraalEntryPoints.class.getName(); |
| 548 | + throw new AssertionError(format("Incompatible Truffle runtime change: %s: %s", target, msg)); |
559 | 549 | }
|
560 | 550 | }
|
561 | 551 | }
|
0 commit comments