mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-03 20:50:19 +00:00
8163553: java.lang.LinkageError from test java/lang/ThreadGroup/Stop.java
Reviewed-by: redestad
This commit is contained in:
parent
f22ecd235a
commit
ff33d165a6
@ -80,7 +80,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
default : throw newInternalError("unexpected xtype: " + xtype);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
throw newInternalError(t);
|
||||
throw uncaughtException(t);
|
||||
}
|
||||
}
|
||||
|
||||
@ -188,7 +188,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
case D_TYPE: return (double) speciesData().getters[i].invokeBasic(this);
|
||||
}
|
||||
} catch (Throwable ex) {
|
||||
throw newInternalError(ex);
|
||||
throw uncaughtException(ex);
|
||||
}
|
||||
throw new InternalError("unexpected type: " + speciesData().typeChars+"."+i);
|
||||
}
|
||||
@ -408,18 +408,14 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
|
||||
*/
|
||||
static boolean speciesDataCachePopulated() {
|
||||
Class<BoundMethodHandle> rootCls = BoundMethodHandle.class;
|
||||
try {
|
||||
for (Class<?> c : rootCls.getDeclaredClasses()) {
|
||||
if (rootCls.isAssignableFrom(c)) {
|
||||
final Class<? extends BoundMethodHandle> cbmh = c.asSubclass(BoundMethodHandle.class);
|
||||
SpeciesData d = Factory.getSpeciesDataFromConcreteBMHClass(cbmh);
|
||||
assert(d != null) : cbmh.getName();
|
||||
assert(d.clazz == cbmh);
|
||||
assert(CACHE.get(d.typeChars) == d);
|
||||
}
|
||||
for (Class<?> c : rootCls.getDeclaredClasses()) {
|
||||
if (rootCls.isAssignableFrom(c)) {
|
||||
final Class<? extends BoundMethodHandle> cbmh = c.asSubclass(BoundMethodHandle.class);
|
||||
SpeciesData d = Factory.getSpeciesDataFromConcreteBMHClass(cbmh);
|
||||
assert(d != null) : cbmh.getName();
|
||||
assert(d.clazz == cbmh);
|
||||
assert(CACHE.get(d.typeChars) == d);
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
throw newInternalError(e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1021,7 +1021,7 @@ class InvokerBytecodeGenerator {
|
||||
try {
|
||||
emptyArray = name.function.resolvedHandle().invoke();
|
||||
} catch (Throwable ex) {
|
||||
throw newInternalError(ex);
|
||||
throw uncaughtException(ex);
|
||||
}
|
||||
assert(java.lang.reflect.Array.getLength(emptyArray) == 0);
|
||||
assert(emptyArray.getClass() == rtype); // exact typing
|
||||
|
||||
@ -855,7 +855,11 @@ class LambdaForm {
|
||||
System.out.println("LambdaForm compilation failed: " + this);
|
||||
bge.printStackTrace(System.out);
|
||||
}
|
||||
} catch (Error | Exception e) {
|
||||
} catch (Error e) {
|
||||
// Pass through any error
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
// Wrap any exception
|
||||
throw newInternalError(this.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -957,7 +957,7 @@ assertEquals("[A, B, C]", (String) caToString2.invokeExact('A', "BC".toCharArray
|
||||
if (!fail) return needType;
|
||||
// elicit an error:
|
||||
this.asType(needType);
|
||||
throw newInternalError("should not return", null);
|
||||
throw newInternalError("should not return");
|
||||
}
|
||||
|
||||
private void spreadArrayChecks(Class<?> arrayType, int arrayLength) {
|
||||
|
||||
@ -379,11 +379,13 @@ class MethodHandleNatives {
|
||||
name, fixMethodType(callerClass, type), appendixResult);
|
||||
}
|
||||
}
|
||||
} catch (Error e) {
|
||||
// Pass through an Error, including say StackOverflowError or
|
||||
// OutOfMemoryError
|
||||
throw e;
|
||||
} catch (Throwable ex) {
|
||||
if (ex instanceof LinkageError)
|
||||
throw (LinkageError) ex;
|
||||
else
|
||||
throw new LinkageError(ex.getMessage(), ex);
|
||||
// Wrap anything else in LinkageError
|
||||
throw new LinkageError(ex.getMessage(), ex);
|
||||
}
|
||||
throw new LinkageError("no such method "+defc.getName()+"."+name+type);
|
||||
}
|
||||
|
||||
@ -107,10 +107,10 @@ import java.util.Properties;
|
||||
/*non-public*/ static InternalError newInternalError(String message) {
|
||||
return new InternalError(message);
|
||||
}
|
||||
/*non-public*/ static InternalError newInternalError(String message, Throwable cause) {
|
||||
/*non-public*/ static InternalError newInternalError(String message, Exception cause) {
|
||||
return new InternalError(message, cause);
|
||||
}
|
||||
/*non-public*/ static InternalError newInternalError(Throwable cause) {
|
||||
/*non-public*/ static InternalError newInternalError(Exception cause) {
|
||||
return new InternalError(cause);
|
||||
}
|
||||
/*non-public*/ static RuntimeException newIllegalStateException(String message) {
|
||||
@ -132,7 +132,7 @@ import java.util.Properties;
|
||||
/*non-public*/ static Error uncaughtException(Throwable ex) {
|
||||
if (ex instanceof Error) throw (Error) ex;
|
||||
if (ex instanceof RuntimeException) throw (RuntimeException) ex;
|
||||
throw newInternalError("uncaught exception", ex);
|
||||
throw new InternalError("uncaught exception", ex);
|
||||
}
|
||||
private static String message(String message, Object obj) {
|
||||
if (obj != null) message = message + ": " + obj;
|
||||
|
||||
@ -723,6 +723,9 @@ public final class StringConcatFactory {
|
||||
default:
|
||||
throw new StringConcatException("Concatenation strategy " + STRATEGY + " is not implemented");
|
||||
}
|
||||
} catch (Error | StringConcatException e) {
|
||||
// Pass through any error or existing StringConcatException
|
||||
throw e;
|
||||
} catch (Throwable t) {
|
||||
throw new StringConcatException("Generator failed", t);
|
||||
}
|
||||
@ -1092,9 +1095,9 @@ public final class StringConcatFactory {
|
||||
UNSAFE.ensureClassInitialized(innerClass);
|
||||
dumpIfEnabled(innerClass.getName(), classBytes);
|
||||
return Lookup.IMPL_LOOKUP.findStatic(innerClass, METHOD_NAME, args);
|
||||
} catch (Throwable e) {
|
||||
} catch (Exception e) {
|
||||
dumpIfEnabled(className + "$$FAILED", classBytes);
|
||||
throw new StringConcatException("Error while spinning the class", e);
|
||||
throw new StringConcatException("Exception while spinning the class", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user