Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(272)

Side by Side Diff: compiler/java/com/google/dart/compiler/ast/DartNode.java

Issue 11363039: Reverting a performance optimization - I'm not comfortable it's side-effect free. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 package com.google.dart.compiler.ast; 5 package com.google.dart.compiler.ast;
6 6
7 import com.google.dart.compiler.common.AbstractNode; 7 import com.google.dart.compiler.common.AbstractNode;
8 import com.google.dart.compiler.resolver.Element; 8 import com.google.dart.compiler.resolver.Element;
9 import com.google.dart.compiler.type.Type; 9 import com.google.dart.compiler.type.Type;
10 import com.google.dart.compiler.util.DefaultTextOutput; 10 import com.google.dart.compiler.util.DefaultTextOutput;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 return super.toString(); 110 return super.toString();
111 } 111 }
112 112
113 /** 113 /**
114 * If the given child is not <code>null</code>, use the given visitor to visit it. 114 * If the given child is not <code>null</code>, use the given visitor to visit it.
115 * 115 *
116 * @param child the child to be visited 116 * @param child the child to be visited
117 * @param visitor the visitor that will be used to visit the child 117 * @param visitor the visitor that will be used to visit the child
118 */ 118 */
119 protected void safelyVisitChild(DartNode child, ASTVisitor<?> visitor) { 119 protected void safelyVisitChild(DartNode child, ASTVisitor<?> visitor) {
120 // Inline the DartIdentifier path - it's by far the most common. 120 if (child != null) {
121 if (child instanceof DartIdentifier) {
122 visitor.visitIdentifier((DartIdentifier)child);
123 } else if (child != null) {
124 child.accept(visitor); 121 child.accept(visitor);
125 } 122 }
126 } 123 }
127 124
128 } 125 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698