Mercurial > hg > graal-compiler
diff graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInvocationPlugins.java @ 21064:28117ede7606
fixed ImmutableCode related regression
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 Apr 2015 10:32:52 +0200 |
parents | fb96fbd5acbd |
children | f9024b74dd9e |
line wrap: on
line diff
--- 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()); + } }