# HG changeset patch # User Doug Simon # Date 1429605172 -7200 # Node ID 28117ede760607d38895196c79f1bac76e106cdc # Parent ae5710f2001136faa40f1bffe9ec7d51c0bd015c fixed ImmutableCode related regression diff -r ae5710f20011 -r 28117ede7606 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInvocationPlugins.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInvocationPlugins.java Tue Apr 21 09:51:03 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInvocationPlugins.java Tue Apr 21 10:32:52 2015 +0200 @@ -39,6 +39,7 @@ import com.oracle.graal.hotspot.replacements.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; +import com.oracle.graal.nodes.type.*; import com.oracle.graal.replacements.StandardGraphBuilderPlugins.BoxPlugin; import com.oracle.graal.replacements.nodes.*; @@ -149,12 +150,21 @@ for (Node node : newNodes) { if (node.hasUsages() && node instanceof ConstantNode) { ConstantNode c = (ConstantNode) node; - if (c.getKind() == Kind.Object && !AheadOfTimeVerificationPhase.isLegalObjectConstant(c)) { - throw new AssertionError("illegal constant node in AOT: " + node); + if (c.getKind() == Kind.Object && AheadOfTimeVerificationPhase.isIllegalObjectConstant(c)) { + if (isClass(c)) { + // This will be handled later by LoadJavaMirrorWithKlassPhase + } else { + throw new AssertionError("illegal constant node in AOT: " + node); + } } } } } super.checkNewNodes(b, plugin, newNodes); } + + private static boolean isClass(ConstantNode node) { + ResolvedJavaType typeOrNull = StampTool.typeOrNull(node); + return typeOrNull != null && "Ljava/lang/Class;".equals(typeOrNull.getName()); + } } diff -r ae5710f20011 -r 28117ede7606 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 Tue Apr 21 09:51:03 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java Tue Apr 21 10:32:52 2015 +0200 @@ -32,7 +32,7 @@ import com.oracle.graal.phases.tiers.*; /** - * Checks for {@link #isLegalObjectConstant(ConstantNode) illegal} object constants in a graph + * Checks for {@link #isIllegalObjectConstant(ConstantNode) illegal} object constants in a graph * processed for AOT compilation. * * @see LoadJavaMirrorWithKlassPhase @@ -42,14 +42,14 @@ @Override protected boolean verify(StructuredGraph graph, PhaseContext context) { for (ConstantNode node : getConstantNodes(graph)) { - if (isLegalObjectConstant(node)) { + if (isIllegalObjectConstant(node)) { throw new VerificationError("illegal object constant: " + node); } } return true; } - public static boolean isLegalObjectConstant(ConstantNode node) { + public static boolean isIllegalObjectConstant(ConstantNode node) { return isObject(node) && !isNullReference(node) && !isInternedString(node) && !isDirectMethodHandle(node) && !isBoundMethodHandle(node); }