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

Side by Side Diff: lib/compiler/implementation/enqueue.dart

Issue 10081004: Remove frog dependencies from lib/compiler. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 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 class EnqueueTask extends CompilerTask { 5 class EnqueueTask extends CompilerTask {
6 final Map<String, Link<Element>> instanceMembersByName; 6 final Map<String, Link<Element>> instanceMembersByName;
7 final Set<ClassElement> seenClasses; 7 final Set<ClassElement> seenClasses;
8 8
9 String get name() => 'Enqueue'; 9 String get name() => 'Enqueue';
10 10
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 if (invokedSelectors !== null && !invokedSelectors.isEmpty()) { 104 if (invokedSelectors !== null && !invokedSelectors.isEmpty()) {
105 return compiler.addToWorkList(member); 105 return compiler.addToWorkList(member);
106 } 106 }
107 } else if (member.kind === ElementKind.SETTER) { 107 } else if (member.kind === ElementKind.SETTER) {
108 if (compiler.universe.invokedSetters.contains(member.name)) { 108 if (compiler.universe.invokedSetters.contains(member.name)) {
109 return compiler.addToWorkList(member); 109 return compiler.addToWorkList(member);
110 } 110 }
111 } 111 }
112 } 112 }
113 113
114 void onRegisterInstantiatedClass(ClassElement cls) => measure(() { 114 void onRegisterInstantiatedClass(ClassElement cls) {
ahe 2012/04/13 11:50:55 I guess you don't like this style?
kasperl 2012/04/13 11:59:53 The analyzer doesn't like the style. I'll file a b
115 while (cls !== null) { 115 measure(() {
116 if (seenClasses.contains(cls)) return; 116 while (cls !== null) {
117 seenClasses.add(cls); 117 if (seenClasses.contains(cls)) return;
118 // TODO(ahe): Don't call resolveType, instead, call this method 118 seenClasses.add(cls);
119 // when resolveType is called. 119 // TODO(ahe): Don't call resolveType, instead, call this method
120 compiler.resolveType(cls); 120 // when resolveType is called.
121 cls.members.forEach(processInstantiatedClassMember); 121 compiler.resolveType(cls);
122 cls = cls.superclass; 122 cls.members.forEach(processInstantiatedClassMember);
123 } 123 cls = cls.superclass;
124 }); 124 }
125 });
126 }
125 127
126 void registerInvocation(SourceString methodName, Selector selector) { 128 void registerInvocation(SourceString methodName, Selector selector) {
127 measure(() { 129 measure(() {
128 Map<SourceString, Set<Selector>> invokedNames = 130 Map<SourceString, Set<Selector>> invokedNames =
129 compiler.universe.invokedNames; 131 compiler.universe.invokedNames;
130 Set<Selector> selectors = 132 Set<Selector> selectors =
131 invokedNames.putIfAbsent(methodName, () => new Set<Selector>()); 133 invokedNames.putIfAbsent(methodName, () => new Set<Selector>());
132 if (!selectors.contains(selector)) { 134 if (!selectors.contains(selector)) {
133 selectors.add(selector); 135 selectors.add(selector);
134 handleUnseenInvocation(methodName, selector); 136 handleUnseenInvocation(methodName, selector);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 processInstanceMembers(methodName, (Element member) { 201 processInstanceMembers(methodName, (Element member) {
200 if (member.isSetter()) { 202 if (member.isSetter()) {
201 compiler.addToWorkList(member); 203 compiler.addToWorkList(member);
202 return true; 204 return true;
203 } else { 205 } else {
204 return false; 206 return false;
205 } 207 }
206 }); 208 });
207 } 209 }
208 } 210 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698