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

Unified Diff: dart/frog/leg/ssa/codegen.dart

Issue 9453021: Start supporting fixed length and immutable lists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update co19-leg.status 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
Index: dart/frog/leg/ssa/codegen.dart
diff --git a/dart/frog/leg/ssa/codegen.dart b/dart/frog/leg/ssa/codegen.dart
index 851f500e80022ab9c7ef949960e8f47f4f520206..5bba9c469cc8682cf548591edb9eaf02d34739c1 100644
--- a/dart/frog/leg/ssa/codegen.dart
+++ b/dart/frog/leg/ssa/codegen.dart
@@ -798,6 +798,22 @@ class SsaCodeGenerator implements HVisitor {
}
void visitLiteralList(HLiteralList node) {
+ if (node.isConst) {
floitsch 2012/02/24 10:15:09 You can keep this code (as otherwise you can't tes
ahe 2012/02/27 11:51:12 Done.
+ SourceString name = new SourceString('makeLiteralListConst');
+ Element helper = compiler.findHelper(name);
+ compiler.registerStaticUse(helper);
+ beginExpression(JSPrecedence.CALL_PRECEDENCE);
+ buffer.add(compiler.namer.isolateAccess(helper));
+ buffer.add('(');
+ generateArrayLiteral(node);
+ buffer.add(')');
+ endExpression(JSPrecedence.CALL_PRECEDENCE);
+ } else {
+ generateArrayLiteral(node);
+ }
+ }
+
+ void generateArrayLiteral(HLiteralList node) {
buffer.add('[');
int len = node.inputs.length;
for (int i = 0; i < len; i++) {

Powered by Google App Engine
This is Rietveld 408576698