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

Unified Diff: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart

Issue 11365170: Start new design for interceptors and implement String.charCodeAt with it. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/compiler.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/compile_time_constants.dart (revision 14840)
+++ sdk/lib/_internal/compiler/implementation/compile_time_constants.dart (working copy)
@@ -339,7 +339,7 @@
classElement.ensureResolved(compiler);
// TODO(floitsch): copy over the generic type.
DartType type = new InterfaceType(classElement);
- compiler.enqueuer.codegen.registerInstantiatedClass(classElement);
+ registerInstantiatedClass(classElement);
Constant constant = new MapConstant(type, keysList, values, protoValue);
compiler.constantHandler.registerCompileTimeConstant(constant);
return constant;
@@ -349,7 +349,16 @@
return constantSystem.createNull();
}
+ void registerInstantiatedClass(ClassElement element) {
+ compiler.enqueuer.codegen.registerInstantiatedClass(element);
+ }
+
+ void registerStringInstance() {
+ registerInstantiatedClass(compiler.stringClass);
+ }
+
Constant visitLiteralString(LiteralString node) {
+ registerStringInstance();
return constantSystem.createString(node.dartString, node);
}
@@ -357,6 +366,7 @@
StringConstant left = evaluate(node.first);
StringConstant right = evaluate(node.second);
if (left == null || right == null) return null;
+ registerStringInstance();
return constantSystem.createString(
new DartString.concat(left.value, right.value), node);
}
@@ -384,6 +394,7 @@
if (partString == null) return null;
accumulator = new DartString.concat(accumulator, partString.value);
};
+ registerStringInstance();
return constantSystem.createString(accumulator, node);
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698