8163476: java/lang/StackWalker/VerifyStackTrace.java fails after JDK-8163369

Reviewed-by: igerasim, chegar
This commit is contained in:
Claes Redestad 2016-08-09 15:02:27 +02:00
parent cdef6ef876
commit 0ae20fdfaa
4 changed files with 12 additions and 8 deletions
jdk
src
java.base/share/classes/java/lang/invoke
jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins
test/java/lang/StackWalker

@ -191,12 +191,12 @@ class DirectMethodHandle extends MethodHandle {
boolean doesAlloc = (which == LF_NEWINVSPECIAL);
String linkerName, lambdaName;
switch (which) {
case LF_INVVIRTUAL: linkerName = "linkToVirtual"; lambdaName = "invokeVirtual"; break;
case LF_INVSTATIC: linkerName = "linkToStatic"; lambdaName = "invokeStatic"; break;
case LF_INVSTATIC_INIT:linkerName = "linkToStatic"; lambdaName = "invokeStaticInit"; break;
case LF_INVSPECIAL: linkerName = "linkToSpecial"; lambdaName = "invokeSpecial"; break;
case LF_INVINTERFACE: linkerName = "linkToInterface"; lambdaName = "invokeInterface"; break;
case LF_NEWINVSPECIAL: linkerName = "linkToSpecial"; lambdaName = "newInvokeSpecial"; break;
case LF_INVVIRTUAL: linkerName = "linkToVirtual"; lambdaName = "DMH.invokeVirtual"; break;
case LF_INVSTATIC: linkerName = "linkToStatic"; lambdaName = "DMH.invokeStatic"; break;
case LF_INVSTATIC_INIT:linkerName = "linkToStatic"; lambdaName = "DMH.invokeStaticInit"; break;
case LF_INVSPECIAL: linkerName = "linkToSpecial"; lambdaName = "DMH.invokeSpecial"; break;
case LF_INVINTERFACE: linkerName = "linkToInterface"; lambdaName = "DMH.invokeInterface"; break;
case LF_NEWINVSPECIAL: linkerName = "linkToSpecial"; lambdaName = "DMH.newInvokeSpecial"; break;
default: throw new InternalError("which="+which);
}

@ -783,7 +783,9 @@ class LambdaForm {
}
MethodType invokerType = methodType();
assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType));
MemberName member = new MemberName(lookupClass, debugName, invokerType, REF_invokeStatic);
int dot = debugName.indexOf('.');
String methodName = (dot > 0) ? debugName.substring(dot + 1) : debugName;
MemberName member = new MemberName(lookupClass, methodName, invokerType, REF_invokeStatic);
MemberName resolvedMember = MemberName.getFactory().resolveOrNull(REF_invokeStatic, member, lookupClass);
if (resolvedMember != null) {
vmentry = resolvedMember;

@ -117,7 +117,7 @@ public final class GenerateJLIClassesPlugin implements Plugin {
*/
public static Map<String, List<String>> defaultDMHMethods() {
return Map.of(
DMH_INVOKE_VIRTUAL, List.of("_L", "L_L", "LI_I"),
DMH_INVOKE_VIRTUAL, List.of("_L", "L_L", "LI_I", "LL_V"),
DMH_INVOKE_SPECIAL, List.of("L_I", "L_L", "LF_L", "LD_L", "LL_L",
"L3_L", "L4_L", "L5_L", "L6_L", "L7_L", "LI_I", "LI_L", "LIL_I",
"LII_I", "LII_L", "LLI_L", "LLI_I", "LILI_I", "LIIL_L",

@ -205,6 +205,8 @@ public class VerifyStackTrace {
.replaceAll("java.base@(\\d+\\.){0,3}(\\d+)/", "java.base/")
.replaceAll("/[0-9]+\\.run", "/xxxxxxxx.run")
.replaceAll("/[0-9]+\\.invoke", "/xxxxxxxx.invoke")
.replaceAll("DirectMethodHandle\\$Holder", "LambdaForm\\$DMH")
.replaceAll("DMH\\.invoke", "DMH/xxxxxxxx.invoke")
.replaceAll("\\$[0-9]+", "\\$??");
} else {
return produced;