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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/universe/function_set.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 // TODO(kasperl): This actually holds getters and setters just fine 7 // TODO(kasperl): This actually holds getters and setters just fine
8 // too and stricly they aren't functions. Maybe this needs a better 8 // too and stricly they aren't functions. Maybe this needs a better
9 // name -- something like ElementSet seems a bit too generic. 9 // name -- something like ElementSet seems a bit too generic.
10 class FunctionSet extends PartialTypeTree { 10 class FunctionSet extends PartialTypeTree {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 : hasAnyInHierarchy(selector); 60 : hasAnyInHierarchy(selector);
61 } 61 }
62 62
63 Set<Element> filterAllBySelector(Selector selector) { 63 Set<Element> filterAllBySelector(Selector selector) {
64 Set<Element> result = new Set<Element>(); 64 Set<Element> result = new Set<Element>();
65 if (root == null) return result; 65 if (root == null) return result;
66 root.visitRecursively((FunctionSetNode node) { 66 root.visitRecursively((FunctionSetNode node) {
67 Element member = node.membersByName[selector.name]; 67 Element member = node.membersByName[selector.name];
68 // Since we're running through the entire tree we have to use 68 // Since we're running through the entire tree we have to use
69 // the applies method that takes types into account. 69 // the applies method that takes types into account.
70 if (member != null && selector.applies(member, compiler)) { 70 if (member != null && selector.appliesUnnamed(member, compiler)) {
71 result.add(member); 71 result.add(member);
72 } 72 }
73 return true; 73 return true;
74 }); 74 });
75 return result; 75 return result;
76 } 76 }
77 77
78 Set<Element> filterHierarchyBySelector(Selector selector) { 78 Set<Element> filterHierarchyBySelector(Selector selector) {
79 Set<Element> result = new Set<Element>(); 79 Set<Element> result = new Set<Element>();
80 if (root == null) return result; 80 if (root == null) return result;
81 visitHierarchy(selectorType(selector), (FunctionSetNode node) { 81 visitHierarchy(selectorType(selector), (FunctionSetNode node) {
82 Element member = node.membersByName[selector.name]; 82 Element member = node.membersByName[selector.name];
83 if (member != null && selector.appliesUntyped(member, compiler)) { 83 if (member != null && selector.appliesUntyped(member, compiler)) {
84 result.add(member); 84 result.add(member);
85 } 85 }
86 return true; 86 return true;
87 }); 87 });
88 return result; 88 return result;
89 } 89 }
90 90
91 bool hasAnyInAll(Selector selector) { 91 bool hasAnyInAll(Selector selector) {
92 bool result = false; 92 bool result = false;
93 if (root == null) return result; 93 if (root == null) return result;
94 root.visitRecursively((FunctionSetNode node) { 94 root.visitRecursively((FunctionSetNode node) {
95 Element member = node.membersByName[selector.name]; 95 Element member = node.membersByName[selector.name];
96 // Since we're running through the entire tree we have to use 96 // Since we're running through the entire tree we have to use
97 // the applies method that takes types into account. 97 // the applies method that takes types into account.
98 if (member != null && selector.applies(member, compiler)) { 98 if (member != null && selector.appliesUnnamed(member, compiler)) {
99 result = true; 99 result = true;
100 // End the traversal. 100 // End the traversal.
101 return false; 101 return false;
102 } 102 }
103 return true; 103 return true;
104 }); 104 });
105 return result; 105 return result;
106 } 106 }
107 107
108 bool hasAnyInHierarchy(Selector selector) { 108 bool hasAnyInHierarchy(Selector selector) {
(...skipping 22 matching lines...) Expand all
131 } 131 }
132 132
133 class FunctionSetNode extends PartialTypeTreeNode { 133 class FunctionSetNode extends PartialTypeTreeNode {
134 134
135 final Map<SourceString, Element> membersByName; 135 final Map<SourceString, Element> membersByName;
136 136
137 FunctionSetNode(ClassElement type) : super(type), 137 FunctionSetNode(ClassElement type) : super(type),
138 membersByName = new Map<SourceString, Element>(); 138 membersByName = new Map<SourceString, Element>();
139 139
140 } 140 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698