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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/AbstractNodeElement.java

Issue 12571002: Intern AST and Model names to reduce char[]/String waste. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months 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 side-by-side diff with in-line comments
Download patch
Index: compiler/java/com/google/dart/compiler/resolver/AbstractNodeElement.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/AbstractNodeElement.java b/compiler/java/com/google/dart/compiler/resolver/AbstractNodeElement.java
index 50ec6a15c262d055529f1c802ff7bfe7b326ad63..2c5a703d15f6f252112a9dbf3514fbb892f4ab12 100644
--- a/compiler/java/com/google/dart/compiler/resolver/AbstractNodeElement.java
+++ b/compiler/java/com/google/dart/compiler/resolver/AbstractNodeElement.java
@@ -10,6 +10,7 @@ import com.google.dart.compiler.ast.Modifiers;
import com.google.dart.compiler.common.SourceInfo;
import com.google.dart.compiler.type.Type;
import com.google.dart.compiler.type.Types;
+import com.google.dart.compiler.util.StringInterner;
abstract class AbstractNodeElement implements Element, NodeElement {
private final DartNode node;
@@ -20,7 +21,7 @@ abstract class AbstractNodeElement implements Element, NodeElement {
// TODO(scheglov) in the future we will not use ASTNode and remove null check
this.sourceInfo = node != null ? node.getSourceInfo() : SourceInfo.UNKNOWN;
this.node = node;
- this.name = name;
+ this.name = StringInterner.intern(name);
}
@Override

Powered by Google App Engine
This is Rietveld 408576698