# HG changeset patch # User Lukas Stadler # Date 1399032616 -7200 # Node ID 5c05f3666abf5b38d8b43c98384a73eae4418787 # Parent 43b3dbfa367d5713a2474c46982f9ca426e373ae allow BoundMethodHandles in AheadOfTime verification diff -r 43b3dbfa367d -r 5c05f3666abf graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java Fri May 02 12:02:27 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java Fri May 02 14:10:16 2014 +0200 @@ -46,7 +46,7 @@ protected boolean verify(StructuredGraph graph, PhaseContext context) { for (ConstantNode node : getConstantNodes(graph)) { if (node.recordsUsages() || !node.gatherUsages(graph).isEmpty()) { - if (isObject(node) && !isNullReference(node) && !isInternedString(node) && !isDirectMethodHandle(node)) { + if (isObject(node) && !isNullReference(node) && !isInternedString(node) && !isDirectMethodHandle(node) && !isBoundMethodHandle(node)) { throw new VerificationError("illegal object constant: " + node); } } @@ -69,6 +69,13 @@ return "Ljava/lang/invoke/DirectMethodHandle;".equals(StampTool.typeOrNull(node).getName()); } + private static boolean isBoundMethodHandle(ConstantNode node) { + if (!isObject(node)) { + return false; + } + return StampTool.typeOrNull(node).getName().startsWith("Ljava/lang/invoke/BoundMethodHandle"); + } + @SuppressFBWarnings(value = "ES_COMPARING_STRINGS_WITH_EQ", justification = "reference equality is what we want") private static boolean isInternedString(ConstantNode node) { if (!isObject(node)) {