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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/universe/selector_map.dart

Issue 12087101: Turn getters and setters that we know are not intercepted into regular getter and setter calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of universe; 5 part of universe;
6 6
7 class SelectorMap<T> extends PartialTypeTree { 7 class SelectorMap<T> extends PartialTypeTree {
8 8
9 SelectorMap(Compiler compiler) : super(compiler); 9 SelectorMap(Compiler compiler) : super(compiler);
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 void visitAllMatching(Element member, bool visit(selector, value)) { 84 void visitAllMatching(Element member, bool visit(selector, value)) {
85 root.visitRecursively((SelectorMapNode<T> node) { 85 root.visitRecursively((SelectorMapNode<T> node) {
86 Link<SelectorValue<T>> selectors = node.selectorsByName[member.name]; 86 Link<SelectorValue<T>> selectors = node.selectorsByName[member.name];
87 if (selectors == null) return true; 87 if (selectors == null) return true;
88 for (Link link = selectors; !link.isEmpty; link = link.tail) { 88 for (Link link = selectors; !link.isEmpty; link = link.tail) {
89 SelectorValue<T> existing = link.head; 89 SelectorValue<T> existing = link.head;
90 Selector selector = existing.selector; 90 Selector selector = existing.selector;
91 // Since we're running through the entire tree we have to use 91 // Since we're running through the entire tree we have to use
92 // the applies method that takes types into account. 92 // the applies method that takes types into account.
93 if (selector.applies(member, compiler)) { 93 if (selector.appliesUnnamed(member, compiler)) {
94 if (!visit(selector, existing.value)) return false; 94 if (!visit(selector, existing.value)) return false;
95 } 95 }
96 } 96 }
97 return true; 97 return true;
98 }); 98 });
99 } 99 }
100 100
101 void visitHierarchyMatching(Element member, bool visit(selector, value)) { 101 void visitHierarchyMatching(Element member, bool visit(selector, value)) {
102 visitHierarchy(member.getEnclosingClass(), (SelectorMapNode<T> node) { 102 visitHierarchy(member.getEnclosingClass(), (SelectorMapNode<T> node) {
103 Link<SelectorValue<T>> selectors = node.selectorsByName[member.name]; 103 Link<SelectorValue<T>> selectors = node.selectorsByName[member.name];
(...skipping 19 matching lines...) Expand all
123 selectorsByName = new Map<SourceString, Link<SelectorValue<T>>>(); 123 selectorsByName = new Map<SourceString, Link<SelectorValue<T>>>();
124 124
125 } 125 }
126 126
127 class SelectorValue<T> { 127 class SelectorValue<T> {
128 final Selector selector; 128 final Selector selector;
129 T value; 129 T value;
130 SelectorValue(this.selector, this.value); 130 SelectorValue(this.selector, this.value);
131 toString() => "$selector -> $value"; 131 toString() => "$selector -> $value";
132 } 132 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698