# HG changeset patch # User redestad # Date 1470747747 -7200 # Node ID 6863c0579ecf65a7eb5fea6d7c8c2cf1a8303661 # Parent 8b78c9b31244d747f63ee1aabdbb84fb94288f72 8163476: java/lang/StackWalker/VerifyStackTrace.java fails after JDK-8163369 Reviewed-by: igerasim, chegar diff -r 8b78c9b31244 -r 6863c0579ecf jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java --- a/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java Tue Aug 09 10:00:31 2016 +0200 +++ b/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java Tue Aug 09 15:02:27 2016 +0200 @@ -191,12 +191,12 @@ 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); } diff -r 8b78c9b31244 -r 6863c0579ecf jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java --- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java Tue Aug 09 10:00:31 2016 +0200 +++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java Tue Aug 09 15:02:27 2016 +0200 @@ -783,7 +783,9 @@ } 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; diff -r 8b78c9b31244 -r 6863c0579ecf jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java --- a/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java Tue Aug 09 10:00:31 2016 +0200 +++ b/jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java Tue Aug 09 15:02:27 2016 +0200 @@ -117,7 +117,7 @@ */ public static Map> 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", diff -r 8b78c9b31244 -r 6863c0579ecf jdk/test/java/lang/StackWalker/VerifyStackTrace.java --- a/jdk/test/java/lang/StackWalker/VerifyStackTrace.java Tue Aug 09 10:00:31 2016 +0200 +++ b/jdk/test/java/lang/StackWalker/VerifyStackTrace.java Tue Aug 09 15:02:27 2016 +0200 @@ -205,6 +205,8 @@ .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;