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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 15818003: - Inline iterator calls made for a "for in". (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 | sdk/lib/_internal/compiler/implementation/resolution/secret_tree_element.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/resolution/members.dart (revision 23246)
+++ sdk/lib/_internal/compiler/implementation/resolution/members.dart (working copy)
@@ -20,6 +20,9 @@
void setSelector(Node node, Selector selector);
void setGetterSelectorInComplexSendSet(SendSet node, Selector selector);
void setOperatorSelectorInComplexSendSet(SendSet node, Selector selector);
+ Selector getIteratorSelector(ForIn node);
+ Selector getMoveNextSelector(ForIn node);
+ Selector getCurrentSelector(ForIn node);
/// Register additional dependencies required by [currentElement].
/// For example, elements that are used by a backend.
@@ -100,6 +103,34 @@
return selectors[node.assignmentOperator];
}
+ // The following methods set selectors on the "for in" node. Since
+ // we're using three selectors, we need to use children of the node,
+ // and we arbitrarily choose which ones.
+
+ Selector setIteratorSelector(ForIn node, Selector selector) {
+ selectors[node] = selector;
+ }
+
+ Selector getIteratorSelector(ForIn node) {
+ return selectors[node];
+ }
+
+ Selector setMoveNextSelector(ForIn node, Selector selector) {
+ selectors[node.forToken] = selector;
+ }
+
+ Selector getMoveNextSelector(ForIn node) {
+ return selectors[node.forToken];
+ }
+
+ Selector setCurrentSelector(ForIn node, Selector selector) {
+ selectors[node.inToken] = selector;
+ }
+
+ Selector getCurrentSelector(ForIn node) {
+ return selectors[node.inToken];
+ }
+
bool isParameterChecked(Element element) {
return checkedParameters.contains(element);
}
@@ -2755,10 +2786,13 @@
visitForIn(ForIn node) {
LibraryElement library = enclosingElement.getLibrary();
+ mapping.setIteratorSelector(node, compiler.iteratorSelector);
world.registerDynamicGetter(compiler.iteratorSelector.name,
compiler.iteratorSelector);
+ mapping.setCurrentSelector(node, compiler.currentSelector);
world.registerDynamicGetter(compiler.currentSelector.name,
compiler.currentSelector);
+ mapping.setMoveNextSelector(node, compiler.moveNextSelector);
world.registerDynamicInvocation(compiler.moveNextSelector.name,
compiler.moveNextSelector);
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/resolution/secret_tree_element.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698