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

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..6e5b80e6d313aff703df3de9aa2cb0a3be67c1b2 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -1624,16 +1624,28 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
Element element = node.element;
List<DartType> instantiatedTypes = node.instantiatedTypes;
- registry.registerStaticInvocation(element);
-
if (instantiatedTypes != null && !instantiatedTypes.isEmpty) {
instantiatedTypes.forEach((type) {
registry.registerInstantiatedType(type);
});
}
- 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);
+
+ if (element == backend.getCheckConcurrentModificationError() &&
floitsch 2015/04/17 12:40:34 Add comments: We inline the checkConcurrentModific
sra1 2015/04/17 18:16:56 Done.
+ arguments.length == 2) {
floitsch 2015/04/17 12:40:33 Is that check necessary? or should it be an assert
sra1 2015/04/17 18:16:56 Done.
+ Element throwFunction = backend.getThrowConcurrentModificationError();
+ registry.registerStaticInvocation(throwFunction);
+ push(js.js('# || (0, #)(#)',[
floitsch 2015/04/17 12:40:33 add comment for the "(0, #)".
sra1 2015/04/17 18:16:56 Done.
+ arguments[0],
+ backend.emitter.staticFunctionAccess(throwFunction),
+ arguments[1]]));
+ } else {
+ registry.registerStaticInvocation(element);
+ push(backend.emitter.staticFunctionAccess(element));
+ push(new js.Call(pop(), arguments), node);
+ }
+
}
visitInvokeSuper(HInvokeSuper node) {

Powered by Google App Engine
This is Rietveld 408576698