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

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

Issue 11602016: Emit classes using ASTs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 dart2js; 5 part of dart2js;
6 6
7 class EnqueueTask extends CompilerTask { 7 class EnqueueTask extends CompilerTask {
8 final Enqueuer codegen; 8 final Enqueuer codegen;
9 final Enqueuer resolution; 9 final Enqueuer resolution;
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 Element owner = element.getOutermostEnclosingMemberOrTopLevel(); 66 Element owner = element.getOutermostEnclosingMemberOrTopLevel();
67 return compiler.enqueuer.resolution.resolvedElements[owner.declaration]; 67 return compiler.enqueuer.resolution.resolvedElements[owner.declaration];
68 } 68 }
69 69
70 /** 70 /**
71 * Documentation wanted -- johnniwinther 71 * Documentation wanted -- johnniwinther
72 * 72 *
73 * Invariant: [element] must be a declaration element. 73 * Invariant: [element] must be a declaration element.
74 */ 74 */
75 String lookupCode(Element element) {
76 assert(invariant(element, element.isDeclaration));
77 return universe.generatedCode[element].toString();
78 }
79
80 /**
81 * Documentation wanted -- johnniwinther
82 *
83 * Invariant: [element] must be a declaration element.
84 */
85 void addToWorkList(Element element, [TreeElements elements]) { 75 void addToWorkList(Element element, [TreeElements elements]) {
86 assert(invariant(element, element.isDeclaration)); 76 assert(invariant(element, element.isDeclaration));
87 if (element.isForeign(compiler)) return; 77 if (element.isForeign(compiler)) return;
88 if (queueIsClosed) { 78 if (queueIsClosed) {
89 if (isResolutionQueue && getCachedElements(element) != null) return; 79 if (isResolutionQueue && getCachedElements(element) != null) return;
90 compiler.internalErrorOnElement(element, "Work list is closed."); 80 compiler.internalErrorOnElement(element, "Work list is closed.");
91 } 81 }
92 if (elements == null) { 82 if (elements == null) {
93 elements = getCachedElements(element); 83 elements = getCachedElements(element);
94 } 84 }
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 407
418 String toString() => 'Enqueuer($name)'; 408 String toString() => 'Enqueuer($name)';
419 409
420 void logSummary(log(message)) { 410 void logSummary(log(message)) {
421 log(isResolutionQueue 411 log(isResolutionQueue
422 ? 'Resolved ${resolvedElements.length} elements.' 412 ? 'Resolved ${resolvedElements.length} elements.'
423 : 'Compiled ${universe.generatedCode.length} methods.'); 413 : 'Compiled ${universe.generatedCode.length} methods.');
424 nativeEnqueuer.logSummary(log); 414 nativeEnqueuer.logSummary(log);
425 } 415 }
426 } 416 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698