changeset 14099:34efe38ee8d8

Merge with 13072c084e6f8f4a402827c0a541c54938537041
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Thu, 06 Mar 2014 15:56:05 -0800
parents e7f611868ffb (current diff) 13072c084e6f (diff)
children 8c376c174030
files
diffstat 12 files changed, 242 insertions(+), 94 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Wed Mar 05 19:54:38 2014 -0800
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Thu Mar 06 15:56:05 2014 -0800
@@ -104,6 +104,13 @@
             }
         }
 
+        public long getTaskCount() {
+            try (CompilationTask.BeginEnqueue beginEnqueue = new CompilationTask.BeginEnqueue()) {
+                // Don't allow new enqueues while reading the state of queue.
+                return executor.getTaskCount();
+            }
+        }
+
         public void execute(CompilationTask task) {
             // The caller is expected to have set the within enqueue state.
             assert CompilationTask.isWithinEnqueue();
@@ -118,6 +125,11 @@
                 executor.awaitTermination(2, TimeUnit.SECONDS);
             }
         }
+
+        @Override
+        public String toString() {
+            return executor.toString();
+        }
     }
 
     private volatile boolean bootstrapRunning;
@@ -282,7 +294,7 @@
             // Compile until the queue is empty.
             int z = 0;
             while (true) {
-                if (compileQueue.getCompletedTaskCount() >= Math.max(3, compileQueue.getCompletedTaskCount())) {
+                if (compileQueue.getCompletedTaskCount() >= Math.max(3, compileQueue.getTaskCount())) {
                     break;
                 }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java	Wed Mar 05 19:54:38 2014 -0800
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java	Thu Mar 06 15:56:05 2014 -0800
@@ -141,7 +141,7 @@
     }
 
     @Override
-    public ResolvedJavaType getDeclaringClass() {
+    public HotSpotResolvedObjectType getDeclaringClass() {
         return holder;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java	Wed Mar 05 19:54:38 2014 -0800
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java	Thu Mar 06 15:56:05 2014 -0800
@@ -112,15 +112,15 @@
     }
 
     /**
-     * Gets the address of the C++ Klass object for this type.
+     * Gets the metaspace Klass for this type.
      */
-    private long metaspaceKlass() {
+    public long metaspaceKlass() {
         return HotSpotGraalRuntime.unsafeReadWord(javaClass, runtime().getConfig().klassOffset);
     }
 
     @Override
     public int getModifiers() {
-        return javaClass.getModifiers();
+        return mirror().getModifiers();
     }
 
     public int getAccessFlags() {
@@ -131,14 +131,14 @@
     @Override
     public ResolvedJavaType getArrayClass() {
         if (arrayOfType == null) {
-            arrayOfType = fromClass(Array.newInstance(javaClass, 0).getClass());
+            arrayOfType = fromClass(Array.newInstance(mirror(), 0).getClass());
         }
         return arrayOfType;
     }
 
     @Override
     public ResolvedJavaType getComponentType() {
-        Class javaComponentType = javaClass.getComponentType();
+        Class javaComponentType = mirror().getComponentType();
         return javaComponentType == null ? null : fromClass(javaComponentType);
     }
 
@@ -204,14 +204,14 @@
 
     @Override
     public HotSpotResolvedObjectType getSuperclass() {
-        Class javaSuperclass = javaClass.getSuperclass();
+        Class javaSuperclass = mirror().getSuperclass();
         return javaSuperclass == null ? null : (HotSpotResolvedObjectType) fromClass(javaSuperclass);
     }
 
     @Override
     public ResolvedJavaType[] getInterfaces() {
         if (interfaces == null) {
-            Class[] javaInterfaces = javaClass.getInterfaces();
+            Class[] javaInterfaces = mirror().getInterfaces();
             ResolvedJavaType[] result = new ResolvedJavaType[javaInterfaces.length];
             for (int i = 0; i < javaInterfaces.length; i++) {
                 result[i] = fromClass(javaInterfaces[i]);
@@ -224,7 +224,7 @@
     public HotSpotResolvedObjectType getSupertype() {
         if (isArray()) {
             ResolvedJavaType componentType = getComponentType();
-            if (javaClass == Object[].class || componentType.isPrimitive()) {
+            if (mirror() == Object[].class || componentType.isPrimitive()) {
                 return (HotSpotResolvedObjectType) fromClass(Object.class);
             }
             return (HotSpotResolvedObjectType) ((HotSpotResolvedObjectType) componentType).getSupertype().getArrayClass();
@@ -267,7 +267,7 @@
     public Constant getEncoding(Representation r) {
         switch (r) {
             case JavaClass:
-                return Constant.forObject(javaClass);
+                return Constant.forObject(mirror());
             case ObjectHub:
                 return klass();
             default:
@@ -294,7 +294,7 @@
 
     @Override
     public boolean isArray() {
-        return javaClass.isArray();
+        return mirror().isArray();
     }
 
     @Override
@@ -322,7 +322,7 @@
     @Override
     public void initialize() {
         if (!isInitialized()) {
-            unsafe.ensureClassInitialized(javaClass);
+            unsafe.ensureClassInitialized(mirror());
             assert isInitialized();
         }
     }
@@ -330,7 +330,7 @@
     @Override
     public boolean isInstance(Constant obj) {
         if (obj.getKind() == Kind.Object && !obj.isNull()) {
-            return javaClass.isInstance(obj.asObject());
+            return mirror().isInstance(obj.asObject());
         }
         return false;
     }
@@ -342,7 +342,7 @@
 
     @Override
     public boolean isInterface() {
-        return javaClass.isInterface();
+        return mirror().isInterface();
     }
 
     @Override
@@ -350,7 +350,7 @@
         assert other != null;
         if (other instanceof HotSpotResolvedObjectType) {
             HotSpotResolvedObjectType otherType = (HotSpotResolvedObjectType) other;
-            return javaClass.isAssignableFrom(otherType.javaClass);
+            return mirror().isAssignableFrom(otherType.mirror());
         }
         return false;
     }
@@ -532,46 +532,7 @@
 
         public JavaType getType() {
             String signature = getSignature();
-            Kind kind = Kind.fromTypeString(signature);
-
-            JavaType type;
-            if (kind.isPrimitive()) {
-                type = HotSpotResolvedPrimitiveType.fromKind(kind);
-            } else {
-                String signatureClass = getNameForClassForName(signature);
-                Class<?> c = null;
-                try {
-                    // This class is the accessing class so we use its classloader.
-                    c = Class.forName(signatureClass, false, mirror().getClassLoader());
-                } catch (ClassNotFoundException e) {
-                    throw new GraalInternalError(e);
-                }
-                if (c == null) {
-                    type = HotSpotUnresolvedJavaType.create(signature);
-                } else {
-                    type = HotSpotResolvedObjectType.fromClass(c);
-                }
-            }
-            return type;
-        }
-
-        /**
-         * Returns a name that is suitable to be passed to {@link Class#forName}.
-         */
-        private String getNameForClassForName(String name) {
-            // If this is an array type just return it.
-            if (name.charAt(0) == '[') {
-                return name.replace('/', '.');
-            }
-
-            // Decode name if necessary.
-            if (name.charAt(name.length() - 1) == ';') {
-                assert name.charAt(0) == 'L';
-                return name.substring(1, name.length() - 1).replace('/', '.');
-            }
-
-            // Primitive type name.
-            return name;
+            return runtime().lookupType(signature, HotSpotResolvedObjectType.this, false);
         }
 
         private boolean isInternal() {
@@ -618,7 +579,7 @@
 
                 HotSpotResolvedJavaField[] myFields = fieldsArray.toArray(new HotSpotResolvedJavaField[0]);
 
-                if (javaClass != Object.class) {
+                if (mirror() != Object.class) {
                     HotSpotResolvedJavaField[] superFields = (HotSpotResolvedJavaField[]) getSuperclass().getInstanceFields(true);
                     HotSpotResolvedJavaField[] fields = Arrays.copyOf(superFields, superFields.length + myFields.length);
                     System.arraycopy(myFields, 0, fields, superFields.length, myFields.length);
@@ -686,7 +647,7 @@
 
     @Override
     public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        return javaClass.getAnnotation(annotationClass);
+        return mirror().getAnnotation(annotationClass);
     }
 
     @Override
@@ -695,7 +656,7 @@
     }
 
     /**
-     * Gets the address of the C++ Klass object for this type.
+     * Gets the metaspace Klass boxed in a {@link Constant}.
      */
     public Constant klass() {
         return Constant.forIntegerKind(runtime().getTarget().wordKind, metaspaceKlass(), this);
@@ -754,7 +715,7 @@
 
     @Override
     public ResolvedJavaMethod[] getDeclaredConstructors() {
-        Constructor[] constructors = javaClass.getDeclaredConstructors();
+        Constructor[] constructors = mirror().getDeclaredConstructors();
         ResolvedJavaMethod[] result = new ResolvedJavaMethod[constructors.length];
         for (int i = 0; i < constructors.length; i++) {
             result[i] = runtime().getHostProviders().getMetaAccess().lookupJavaConstructor(constructors[i]);
@@ -765,7 +726,7 @@
 
     @Override
     public ResolvedJavaMethod[] getDeclaredMethods() {
-        Method[] methods = javaClass.getDeclaredMethods();
+        Method[] methods = mirror().getDeclaredMethods();
         ResolvedJavaMethod[] result = new ResolvedJavaMethod[methods.length];
         for (int i = 0; i < methods.length; i++) {
             result[i] = runtime().getHostProviders().getMetaAccess().lookupJavaMethod(methods[i]);
@@ -784,7 +745,7 @@
 
     @Override
     public Constant newArray(int length) {
-        return Constant.forObject(Array.newInstance(javaClass, length));
+        return Constant.forObject(Array.newInstance(mirror(), length));
     }
 
     /**
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedPrimitiveType.java	Wed Mar 05 19:54:38 2014 -0800
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedPrimitiveType.java	Thu Mar 06 15:56:05 2014 -0800
@@ -36,8 +36,6 @@
 
     private static final long serialVersionUID = -6208552348908071473L;
     private final Kind kind;
-    private final Class<?> javaMirror;
-    private final Class javaArrayMirror;
 
     /**
      * Gets the Graal mirror for a {@link Kind}.
@@ -62,9 +60,7 @@
     public HotSpotResolvedPrimitiveType(Kind kind) {
         super(String.valueOf(Character.toUpperCase(kind.getTypeChar())));
         this.kind = kind;
-        this.javaMirror = kind.toJavaClass();
-        this.javaArrayMirror = kind == Kind.Void ? null : Array.newInstance(javaMirror, 0).getClass();
-        assert javaMirror.isPrimitive() : javaMirror + " not a primitive type";
+        assert mirror().isPrimitive() : mirror() + " not a primitive type";
     }
 
     @Override
@@ -74,6 +70,7 @@
 
     @Override
     public ResolvedJavaType getArrayClass() {
+        Class javaArrayMirror = kind == Kind.Void ? null : Array.newInstance(mirror(), 0).getClass();
         return HotSpotResolvedObjectType.fromClass(javaArrayMirror);
     }
 
@@ -89,7 +86,6 @@
 
     @Override
     public ResolvedJavaType getSuperclass() {
-        assert javaMirror.getSuperclass() == null;
         return null;
     }
 
@@ -190,7 +186,7 @@
 
     @Override
     public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        return javaMirror.getAnnotation(annotationClass);
+        return null;
     }
 
     @Override
@@ -214,7 +210,7 @@
 
     @Override
     public Class<?> mirror() {
-        return javaMirror;
+        return kind.toJavaClass();
     }
 
     @Override
@@ -254,6 +250,6 @@
 
     @Override
     public Constant newArray(int length) {
-        return Constant.forObject(Array.newInstance(javaMirror, length));
+        return Constant.forObject(Array.newInstance(mirror(), length));
     }
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ReflectionGetCallerClassNode.java	Wed Mar 05 19:54:38 2014 -0800
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ReflectionGetCallerClassNode.java	Thu Mar 06 15:56:05 2014 -0800
@@ -92,7 +92,7 @@
                 default:
                     if (!method.ignoredBySecurityStackWalk()) {
                         // We have reached the desired frame; return the holder class.
-                        HotSpotResolvedObjectType callerClass = (HotSpotResolvedObjectType) method.getDeclaringClass();
+                        HotSpotResolvedObjectType callerClass = method.getDeclaringClass();
                         return ConstantNode.forObject(callerClass.mirror(), metaAccess, graph());
                     }
                     break;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java	Wed Mar 05 19:54:38 2014 -0800
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java	Thu Mar 06 15:56:05 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -58,7 +58,11 @@
     public void virtualize(VirtualizerTool tool) {
         State state = tool.getObjectState(value);
         if (state != null && state.getState() == EscapeState.Virtual) {
-            tool.replaceWithValue(state.getEntry(0));
+            ResolvedJavaType objectType = state.getVirtualObject().type();
+            ResolvedJavaType expectedType = tool.getMetaAccessProvider().lookupJavaType(boxingKind.toBoxedJavaClass());
+            if (objectType == expectedType) {
+                tool.replaceWithValue(state.getEntry(0));
+            }
         }
     }
 
@@ -90,7 +94,10 @@
                 }
             }
         } else if (value instanceof BoxNode) {
-            return ((BoxNode) value).getValue();
+            BoxNode box = (BoxNode) value;
+            if (boxingKind == box.getBoxingKind()) {
+                return box.getValue();
+            }
         }
         if (usages().isEmpty()) {
             return null;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.replacements.verifier/src/com/oracle/graal/replacements/verifier/NodeIntrinsicVerifier.java	Thu Mar 06 15:56:05 2014 -0800
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.replacements.verifier;
+
+import java.lang.annotation.*;
+import java.util.*;
+
+import javax.annotation.processing.*;
+import javax.lang.model.element.*;
+import javax.lang.model.type.*;
+import javax.lang.model.util.*;
+import javax.tools.Diagnostic.Kind;
+
+import com.oracle.graal.graph.Node.ConstantNodeParameter;
+import com.oracle.graal.graph.Node.InjectedNodeParameter;
+import com.oracle.graal.graph.Node.NodeIntrinsic;
+
+public final class NodeIntrinsicVerifier extends AbstractVerifier {
+
+    private static final String NODE_CLASS_NAME = "value";
+
+    private TypeMirror nodeType() {
+        return env.getElementUtils().getTypeElement("com.oracle.graal.graph.Node").asType();
+    }
+
+    private TypeMirror valueNodeType() {
+        return env.getElementUtils().getTypeElement("com.oracle.graal.nodes.ValueNode").asType();
+    }
+
+    private TypeMirror classType() {
+        return env.getElementUtils().getTypeElement("java.lang.Class").asType();
+    }
+
+    private TypeMirror resolvedJavaTypeType() {
+        return env.getElementUtils().getTypeElement("com.oracle.graal.api.meta.ResolvedJavaType").asType();
+    }
+
+    public NodeIntrinsicVerifier(ProcessingEnvironment env) {
+        super(env);
+    }
+
+    @Override
+    public Class<? extends Annotation> getAnnotationClass() {
+        return NodeIntrinsic.class;
+    }
+
+    @Override
+    public void verify(Element element, AnnotationMirror annotation) {
+        if (element.getKind() != ElementKind.METHOD) {
+            assert false : "Element is guaranteed to be a method.";
+            return;
+        }
+
+        ExecutableElement intrinsicMethod = (ExecutableElement) element;
+        if (!intrinsicMethod.getModifiers().contains(Modifier.STATIC)) {
+            env.getMessager().printMessage(Kind.ERROR, String.format("A @%s method must be static.", NodeIntrinsic.class.getSimpleName()), element, annotation);
+        }
+
+        TypeMirror nodeClassMirror = resolveAnnotationValue(TypeMirror.class, findAnnotationValue(annotation, NODE_CLASS_NAME));
+        TypeElement nodeClass = (TypeElement) env.getTypeUtils().asElement(nodeClassMirror);
+        if (nodeClass.getSimpleName().contentEquals(NodeIntrinsic.class.getSimpleName())) {
+            // default value
+            Element enclosingElement = intrinsicMethod.getEnclosingElement();
+            while (enclosingElement != null && enclosingElement.getKind() != ElementKind.CLASS) {
+                enclosingElement = enclosingElement.getEnclosingElement();
+            }
+            if (enclosingElement != null) {
+                nodeClass = (TypeElement) enclosingElement;
+            }
+        }
+
+        if (isNodeType(nodeClass)) {
+            TypeMirror[] constructorSignature = constructorSignature(intrinsicMethod);
+            findConstructor(nodeClass, constructorSignature, intrinsicMethod, annotation);
+        } else {
+            env.getMessager().printMessage(Kind.ERROR, String.format("The class %s is not a Node subclass.", nodeClass.getSimpleName()), element, annotation);
+        }
+    }
+
+    private boolean isNodeType(TypeElement nodeClass) {
+        return env.getTypeUtils().isSubtype(nodeClass.asType(), nodeType());
+    }
+
+    private TypeMirror[] constructorSignature(ExecutableElement method) {
+        TypeMirror[] parameters = new TypeMirror[method.getParameters().size()];
+        for (int i = 0; i < method.getParameters().size(); i++) {
+            VariableElement parameter = method.getParameters().get(i);
+            if (parameter.getAnnotation(ConstantNodeParameter.class) == null) {
+                parameters[i] = valueNodeType();
+            } else {
+                TypeMirror type = parameter.asType();
+                if (isTypeCompatible(type, classType())) {
+                    type = resolvedJavaTypeType();
+                }
+                parameters[i] = type;
+            }
+        }
+        return parameters;
+    }
+
+    private void findConstructor(TypeElement nodeClass, TypeMirror[] signature, ExecutableElement intrinsicMethod, AnnotationMirror intrinsicAnnotation) {
+        List<ExecutableElement> constructors = ElementFilter.constructorsIn(nodeClass.getEnclosedElements());
+
+        nextConstructor: for (ExecutableElement constructor : constructors) {
+            int sIdx = 0;
+            int cIdx = 0;
+            while (cIdx < constructor.getParameters().size()) {
+                VariableElement parameter = constructor.getParameters().get(cIdx++);
+                if (parameter.getAnnotation(InjectedNodeParameter.class) != null) {
+                    // skip injected parameters
+                    continue;
+                }
+
+                TypeMirror paramType = parameter.asType();
+                if (cIdx == constructor.getParameters().size() && paramType.getKind() == TypeKind.ARRAY) {
+                    // last argument of constructor is varargs, match remaining intrinsic arguments
+                    TypeMirror varargsType = ((ArrayType) paramType).getComponentType();
+                    while (sIdx < signature.length) {
+                        if (!isTypeCompatible(varargsType, signature[sIdx++])) {
+                            continue nextConstructor;
+                        }
+                    }
+                } else if (sIdx >= signature.length) {
+                    // too many arguments in intrinsic method
+                    continue nextConstructor;
+                } else if (!isTypeCompatible(paramType, signature[sIdx++])) {
+                    continue nextConstructor;
+                }
+            }
+
+            if (sIdx == signature.length) {
+                // found
+                return;
+            }
+
+            // too many arguments in constructor
+        }
+
+        // not found
+        env.getMessager().printMessage(Kind.ERROR, "Could not find matching constructor for node intrinsic.", intrinsicMethod, intrinsicAnnotation);
+    }
+
+    private boolean isTypeCompatible(TypeMirror originalType, TypeMirror substitutionType) {
+        TypeMirror original = originalType;
+        TypeMirror substitution = substitutionType;
+        if (needsErasure(original)) {
+            original = env.getTypeUtils().erasure(original);
+        }
+        if (needsErasure(substitution)) {
+            substitution = env.getTypeUtils().erasure(substitution);
+        }
+        return env.getTypeUtils().isSameType(original, substitution);
+    }
+
+    private static boolean needsErasure(TypeMirror typeMirror) {
+        return typeMirror.getKind() != TypeKind.NONE && typeMirror.getKind() != TypeKind.VOID && !typeMirror.getKind().isPrimitive() && typeMirror.getKind() != TypeKind.OTHER &&
+                        typeMirror.getKind() != TypeKind.NULL;
+    }
+}
--- a/graal/com.oracle.graal.replacements.verifier/src/com/oracle/graal/replacements/verifier/VerifierAnnotationProcessor.java	Wed Mar 05 19:54:38 2014 -0800
+++ b/graal/com.oracle.graal.replacements.verifier/src/com/oracle/graal/replacements/verifier/VerifierAnnotationProcessor.java	Thu Mar 06 15:56:05 2014 -0800
@@ -72,6 +72,7 @@
             verifiers = new ArrayList<>();
             verifiers.add(new ClassSubstitutionVerifier(this.processingEnv));
             verifiers.add(new MethodSubstitutionVerifier(this.processingEnv));
+            verifiers.add(new NodeIntrinsicVerifier(this.processingEnv));
         }
         return verifiers;
     }
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java	Wed Mar 05 19:54:38 2014 -0800
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java	Thu Mar 06 15:56:05 2014 -0800
@@ -467,20 +467,18 @@
         properties.put("ASTSize", value);
     }
 
-    static synchronized void log(int indent, String msg, String details, Map<String, Object> properties) {
-        OUT.printf("[truffle] %-16s ", msg);
-        for (int i = 0; i < indent; i++) {
-            OUT.print(" ");
-        }
-        OUT.printf("%-" + (60 - indent) + "s", details);
+    static void log(int indent, String msg, String details, Map<String, Object> properties) {
+        StringBuilder sb = new StringBuilder();
+        sb.append(String.format("[truffle] %-16s ", msg));
+        sb.append(String.format("%" + indent + "s" + "%-" + (60 - indent) + "s", "", details));
         if (properties != null) {
             for (String property : properties.keySet()) {
                 Object value = properties.get(property);
                 if (value == null) {
                     continue;
                 }
-                OUT.print("|");
-                OUT.print(property);
+                sb.append('|');
+                sb.append(property);
 
                 StringBuilder propertyBuilder = new StringBuilder();
                 if (value instanceof Integer) {
@@ -492,10 +490,10 @@
                 }
 
                 int length = Math.max(1, 20 - property.length());
-                OUT.printf(" %" + length + "s ", propertyBuilder.toString());
+                sb.append(String.format(" %" + length + "s ", propertyBuilder.toString()));
             }
         }
-        OUT.println();
+        OUT.println(sb.toString());
     }
 
     private static void printProfiling() {
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java	Wed Mar 05 19:54:38 2014 -0800
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/RootNode.java	Thu Mar 06 15:56:05 2014 -0800
@@ -128,13 +128,7 @@
 
     /* Internal API. Do not use. */
     void addCachedCallNode(CallNode callSite) {
-        if (cachedCallNodes.add(callSite)) {
-            for (CallNode callNode : cachedCallNodes) {
-                if (callSite != callNode) {
-                    callNode.notifyCallNodeAdded();
-                }
-            }
-        }
+        this.cachedCallNodes.add(callSite);
     }
 
     /* Internal API. Do not use. */
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/UnexpectedResultException.java	Wed Mar 05 19:54:38 2014 -0800
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/UnexpectedResultException.java	Thu Mar 06 15:56:05 2014 -0800
@@ -41,7 +41,6 @@
      * @param result the alternative result
      */
     public UnexpectedResultException(Object result) {
-        assert !(result instanceof Throwable);
         this.result = result;
     }
 
--- a/mx/projects	Wed Mar 05 19:54:38 2014 -0800
+++ b/mx/projects	Thu Mar 06 15:56:05 2014 -0800
@@ -338,7 +338,7 @@
 # graal.replacements.verifier
 project@com.oracle.graal.replacements.verifier@subDir=graal
 project@com.oracle.graal.replacements.verifier@sourceDirs=src
-project@com.oracle.graal.replacements.verifier@dependencies=com.oracle.graal.api.replacements
+project@com.oracle.graal.replacements.verifier@dependencies=com.oracle.graal.api.replacements,com.oracle.graal.graph
 project@com.oracle.graal.replacements.verifier@checkstyle=com.oracle.graal.graph
 project@com.oracle.graal.replacements.verifier@javaCompliance=1.7
 project@com.oracle.graal.replacements.verifier@workingSets=Graal,Replacements
@@ -349,6 +349,7 @@
 project@com.oracle.graal.nodes@dependencies=com.oracle.graal.graph,com.oracle.graal.api.replacements
 project@com.oracle.graal.nodes@checkstyle=com.oracle.graal.graph
 project@com.oracle.graal.nodes@javaCompliance=1.7
+project@com.oracle.graal.nodes@annotationProcessors=com.oracle.graal.replacements.verifier
 project@com.oracle.graal.nodes@workingSets=Graal,Graph
 
 # graal.nodes.test