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

Unified Diff: dart/frog/leg/compile_time_constants.dart

Issue 9453021: Start supporting fixed length and immutable lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Handle constant list expressions. Created 8 years, 10 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
« no previous file with comments | « no previous file | dart/frog/leg/emitter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/compile_time_constants.dart
diff --git a/dart/frog/leg/compile_time_constants.dart b/dart/frog/leg/compile_time_constants.dart
index c2050dac3fc4bf10c7e7f1e16f6bbf6325783c30..5f7e585cade41be122e05644461d22ab14219756 100644
--- a/dart/frog/leg/compile_time_constants.dart
+++ b/dart/frog/leg/compile_time_constants.dart
@@ -113,14 +113,18 @@ class CompileTimeConstantHandler extends CompilerTask {
compileListLiteral(Node node, List arguments) {
StringBuffer buffer = new StringBuffer();
+ buffer.add(compiler.namer.ISOLATE);
+ buffer.add(".prototype.makeConstantList");
+ buffer.add("([");
for (int i = 0; i < arguments.length; i++) {
if (i != 0) buffer.add(", ");
// TODO(floitsch): canonicalize if the constant is in the
// [compiledConstant] set.
writeJsCode(buffer, arguments[i]);
}
+ buffer.add("])");
// TODO(floitsch): do we have to register 'List' as instantiated class?
- String array = "[$buffer]";
+ String array = buffer.toString();
Constant constant = new Constant(array);
registerCompileTimeConstant(constant);
return constant;
« no previous file with comments | « no previous file | dart/frog/leg/emitter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698