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

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

Issue 10693123: Use better names for closures and static variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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
« no previous file with comments | « lib/compiler/implementation/emitter.dart ('k') | lib/compiler/implementation/namer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Enqueuer codegen; 6 final Enqueuer codegen;
7 final Enqueuer resolution; 7 final Enqueuer resolution;
8 8
9 String get name() => 'Enqueue'; 9 String get name() => 'Enqueue';
10 10
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 elements = getCachedElements(element); 86 elements = getCachedElements(element);
87 } 87 }
88 queue.add(new WorkItem(element, elements)); 88 queue.add(new WorkItem(element, elements));
89 } 89 }
90 90
91 bool canBeRecompiled(Element element) { 91 bool canBeRecompiled(Element element) {
92 // Only member functions can be recompiled. An exception to this is members 92 // Only member functions can be recompiled. An exception to this is members
93 // of closures. They are processed as part of the enclosing function and not 93 // of closures. They are processed as part of the enclosing function and not
94 // present as a separate element (the call to the closure will be a member 94 // present as a separate element (the call to the closure will be a member
95 // function). 95 // function).
96 var closure = const SourceString("Closure"); 96 return element.isMember() && !element.getEnclosingClass().isClosure();
97 return element.isMember() && element.getEnclosingClass().name != closure;
98 } 97 }
99 98
100 void registerRecompilationCandidate(Element element, 99 void registerRecompilationCandidate(Element element,
101 [TreeElements elements]) { 100 [TreeElements elements]) {
102 if (!canBeRecompiled(element)) return; 101 if (!canBeRecompiled(element)) return;
103 if (queueIsClosed) { 102 if (queueIsClosed) {
104 compiler.internalErrorOnElement(element, "Work list is closed."); 103 compiler.internalErrorOnElement(element, "Work list is closed.");
105 } 104 }
106 recompilationCandidates.add(element, elements); 105 recompilationCandidates.add(element, elements);
107 } 106 }
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 void registerIsCheck(Element element) { 314 void registerIsCheck(Element element) {
316 universe.isChecks.add(element); 315 universe.isChecks.add(element);
317 } 316 }
318 317
319 void forEach(f(WorkItem work)) { 318 void forEach(f(WorkItem work)) {
320 while (!queue.isEmpty()) { 319 while (!queue.isEmpty()) {
321 f(queue.removeLast()); 320 f(queue.removeLast());
322 } 321 }
323 } 322 }
324 } 323 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/emitter.dart ('k') | lib/compiler/implementation/namer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698