changeset 12408:a9837a03127e

Fix wrong modification of ReplacementsImpl macro node method handling.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 15 Oct 2013 00:31:43 +0200
parents 53297646b011
children edacadae40a0
files graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/CompilerDirectivesSubstitutions.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java
diffstat 4 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java	Mon Oct 14 23:30:05 2013 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java	Tue Oct 15 00:31:43 2013 +0200
@@ -185,7 +185,7 @@
 
     @Override
     public void setDeoptimizationState(FrameState f) {
-        throw new IllegalStateException();
+        throw new IllegalStateException("Cannot set deoptimization state " + f + " for invoke " + this);
     }
 
     @Override
--- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java	Mon Oct 14 23:30:05 2013 +0200
+++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java	Tue Oct 15 00:31:43 2013 +0200
@@ -402,7 +402,6 @@
                         } else {
                             StructuredGraph intrinsicGraph = InliningUtil.getIntrinsicGraph(ReplacementsImpl.this, callee);
                             if ((callTarget.invokeKind() == InvokeKind.Static || callTarget.invokeKind() == InvokeKind.Special) &&
-                                            InliningUtil.getMacroNodeClass(ReplacementsImpl.this, callee) == null &&
                                             (policy.shouldInline(callee, methodToParse) || (intrinsicGraph != null && policy.shouldUseReplacement(callee, methodToParse)))) {
                                 StructuredGraph targetGraph;
                                 if (intrinsicGraph != null && policy.shouldUseReplacement(callee, methodToParse)) {
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/CompilerDirectivesSubstitutions.java	Mon Oct 14 23:30:05 2013 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/CompilerDirectivesSubstitutions.java	Tue Oct 15 00:31:43 2013 +0200
@@ -69,8 +69,8 @@
     public static native Object unsafeCast(Object value, Class clazz, boolean condition);
 
     @MethodSubstitution
-    public static MaterializedFrame unsafeFrameCast(MaterializedFrame value) {
-        return CompilerDirectives.unsafeCast(value, FrameWithoutBoxing.class, true);
+    private static Class<? extends MaterializedFrame> getUnsafeFrameType() {
+        return FrameWithoutBoxing.class;
     }
 
     @MacroSubstitution(macro = CustomizedUnsafeLoadMacroNode.class, isStatic = true)
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java	Mon Oct 14 23:30:05 2013 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java	Tue Oct 15 00:31:43 2013 +0200
@@ -173,7 +173,11 @@
      * @return the value to be casted to the new type
      */
     public static MaterializedFrame unsafeFrameCast(MaterializedFrame value) {
-        return value;
+        return unsafeCast(value, getUnsafeFrameType(), true);
+    }
+
+    private static Class<? extends MaterializedFrame> getUnsafeFrameType() {
+        return MaterializedFrame.class;
     }
 
     /**