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

Unified Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 1087973002: Rewrite for-in loop as indexing loop for JavaScript indexable arrays (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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: pkg/compiler/lib/src/ssa/codegen.dart
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index ea200c3cb337ce2af6834488c480f7351e302bed..90a3ae1273bb2d09ae99aa35f2dfd28752e9230f 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -1632,8 +1632,21 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
});
}
- push(backend.emitter.staticFunctionAccess(node.element));
- push(new js.Call(pop(), visitArguments(node.inputs, start: 0)), node);
+
+ List<js.Expression> arguments = visitArguments(node.inputs, start: 0);
+ Element target = node.element;
+ js.Expression test = null;
+ if (target == backend.getThrowConcurrentModificationError() &&
+ arguments.length == 2) {
+ push(js.js('# || (0, #)(#)',[
+ arguments[0],
+ backend.emitter.staticFunctionAccess(node.element),
+ arguments[1]]));
+ } else {
+ push(backend.emitter.staticFunctionAccess(node.element));
+ push(new js.Call(pop(), arguments), node);
+ }
+
}
visitInvokeSuper(HInvokeSuper node) {

Powered by Google App Engine
This is Rietveld 408576698