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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.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: retry 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
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index ff9a0c4d174518e47e40e62ebf957ae16d6bee5c..ebda3742700f794a926dadff8542b7fa0f5a0d30 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -302,6 +302,7 @@ class JavaScriptBackend extends Backend {
Element jsStringToString;
Element jsStringOperatorAdd;
Element objectEquals;
+ Element cachedCheckConcurrentModificationError;
ClassElement typeLiteralClass;
ClassElement mapLiteralClass;
@@ -1662,6 +1663,18 @@ class JavaScriptBackend extends Backend {
return findHelper('throwAbstractClassInstantiationError');
}
+ Element getCheckConcurrentModificationError() {
+ if (cachedCheckConcurrentModificationError == null) {
+ cachedCheckConcurrentModificationError =
+ findHelper('checkConcurrentModificationError');
+ }
+ return cachedCheckConcurrentModificationError;
+ }
+
+ Element getThrowConcurrentModificationError() {
+ return findHelper('throwConcurrentModificationError');
+ }
+
Element getStringInterpolationHelper() {
return findHelper('S');
}
@@ -2750,6 +2763,13 @@ class JavaScriptResolutionCallbacks extends ResolutionCallbacks {
registerBackendStaticInvocation(backend.getTraceFromException(), registry);
}
+ void onSyncForIn(Registry registry) {
+ assert(registry.isForResolution);
+ // The SSA builder recognizes certain for-in loops and can generate calls to
+ // throwConcurrentModificationError.
+ registerBackendStaticInvocation(
+ backend.getCheckConcurrentModificationError(), registry);
+ }
void onTypeVariableExpression(Registry registry) {
assert(registry.isForResolution);
« no previous file with comments | « pkg/compiler/lib/src/compiler.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698