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

Unified Diff: compiler/java/com/google/dart/compiler/ast/DartIdentifier.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/ast/DartIdentifier.java
diff --git a/compiler/java/com/google/dart/compiler/ast/DartIdentifier.java b/compiler/java/com/google/dart/compiler/ast/DartIdentifier.java
index 09eadc20b0468097c2945788a6a68ca32f8ae697..d9190e8d044676a8b75ae91bb96c734edf27bd76 100644
--- a/compiler/java/com/google/dart/compiler/ast/DartIdentifier.java
+++ b/compiler/java/com/google/dart/compiler/ast/DartIdentifier.java
@@ -6,6 +6,7 @@ package com.google.dart.compiler.ast;
import com.google.dart.compiler.resolver.Element;
import com.google.dart.compiler.resolver.NodeElement;
+import com.google.dart.compiler.util.StringInterner;
/**
* Represents a Dart identifier expression.
@@ -18,11 +19,11 @@ public class DartIdentifier extends DartExpression {
public DartIdentifier(String name) {
assert name != null;
- this.name = name;
+ this.name = StringInterner.intern(name);
}
public DartIdentifier(DartIdentifier original) {
- this.name = original.name;
+ this.name = StringInterner.intern(original.name);
}
@Override

Powered by Google App Engine
This is Rietveld 408576698