# HG changeset patch # User Doug Simon # Date 1412105736 -7200 # Node ID 5c55441b4c62d2060e11972f36d94d2a661e2507 # Parent 43655130d0ab9ae27e59a442115916df7ce6f0d8 fixed reported annotation parsing time in NodeClass diff -r 43655130d0ab -r 5c55441b4c62 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchContext.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchContext.java Tue Sep 30 19:00:46 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchContext.java Tue Sep 30 21:35:36 2014 +0200 @@ -126,8 +126,10 @@ */ public void setResult(ComplexMatchResult result) { ComplexMatchValue value = new ComplexMatchValue(result); - Debug.log("matched %s %s", rule.getName(), rule.getPattern()); - Debug.log("with nodes %s", rule.formatMatch(root)); + if (Debug.isLogEnabled()) { + Debug.log("matched %s %s", rule.getName(), rule.getPattern()); + Debug.log("with nodes %s", rule.formatMatch(root)); + } if (consumed != null) { for (ValueNode node : consumed) { // All the interior nodes should be skipped during the normal doRoot calls in diff -r 43655130d0ab -r 5c55441b4c62 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java Tue Sep 30 19:00:46 2014 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeClass.java Tue Sep 30 21:35:36 2014 +0200 @@ -65,7 +65,7 @@ private static final DebugTimer Init_AllowedUsages = Debug.timer("NodeClass.Init.AllowedUsages"); private static final DebugTimer Init_IterableIds = Debug.timer("NodeClass.Init.IterableIds"); - private static T getAnnotation(AnnotatedElement e, Class annotationClass) { + private static T getAnnotationTimed(AnnotatedElement e, Class annotationClass) { try (TimerCloseable s = Init_AnnotationParsing.start()) { return e.getAnnotation(annotationClass); } @@ -88,7 +88,7 @@ try (TimerCloseable t = Init.start()) { value = (NodeClass) allClasses.get(key); if (value == null) { - GeneratedNode gen = getAnnotation(c, GeneratedNode.class); + GeneratedNode gen = getAnnotationTimed(c, GeneratedNode.class); if (gen != null) { Class originalNodeClass = (Class) gen.value(); value = (NodeClass) allClasses.get(originalNodeClass); @@ -188,7 +188,7 @@ canGVN = Node.ValueNumberable.class.isAssignableFrom(clazz); startGVNNumber = clazz.hashCode(); - NodeInfo info = getAnnotation(clazz, NodeInfo.class); + NodeInfo info = getAnnotationTimed(clazz, NodeInfo.class); this.nameTemplate = info.nameTemplate(); try (TimerCloseable t1 = Init_AllowedUsages.start()) { @@ -270,12 +270,12 @@ * @param nodeClass a {@linkplain GeneratedNode non-generated} {@link Node} class */ public boolean is(Class nodeClass) { - assert getAnnotation(nodeClass, GeneratedNode.class) == null : "cannot test NodeClas against generated " + nodeClass; + assert nodeClass.getAnnotation(GeneratedNode.class) == null : "cannot test NodeClas against generated " + nodeClass; return nodeClass == getClazz(); } public String shortName() { - NodeInfo info = getAnnotation(getClazz(), NodeInfo.class); + NodeInfo info = getClazz().getAnnotation(NodeInfo.class); String shortName; if (!info.shortName().isEmpty()) { shortName = info.shortName(); @@ -389,9 +389,9 @@ @Override protected void scanField(Field field, long offset) { - Input inputAnnotation = getAnnotation(field, Node.Input.class); - OptionalInput optionalInputAnnotation = getAnnotation(field, Node.OptionalInput.class); - Successor successorAnnotation = getAnnotation(field, Successor.class); + Input inputAnnotation = getAnnotationTimed(field, Node.Input.class); + OptionalInput optionalInputAnnotation = getAnnotationTimed(field, Node.OptionalInput.class); + Successor successorAnnotation = getAnnotationTimed(field, Successor.class); try (TimerCloseable s = Init_FieldScanningInner.start()) { Class type = field.getType(); int modifiers = field.getModifiers();