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

Side by Side Diff: pkg/compiler/lib/src/dart_backend/backend.dart

Issue 1376863004: Avoid eager enqueueing from resolution (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update minimal_resolution_test. Created 5 years, 2 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
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 dart_backend; 5 part of dart_backend;
6 6
7 // TODO(ahe): This class is simply wrong. This backend should use 7 // TODO(ahe): This class is simply wrong. This backend should use
8 // elements when it can, not AST nodes. Perhaps a [Map<Element, 8 // elements when it can, not AST nodes. Perhaps a [Map<Element,
9 // TreeElements>] is what is needed. 9 // TreeElements>] is what is needed.
10 class ElementAst { 10 class ElementAst {
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 element, 173 element,
174 elementAst, 174 elementAst,
175 newTypedefElementCallback, 175 newTypedefElementCallback,
176 newClassElementCallback); 176 newClassElementCallback);
177 collector.collect(); 177 collector.collect();
178 } 178 }
179 179
180 int totalSize = outputter.assembleProgram( 180 int totalSize = outputter.assembleProgram(
181 libraries: compiler.libraryLoader.libraries, 181 libraries: compiler.libraryLoader.libraries,
182 instantiatedClasses: compiler.resolverWorld.directlyInstantiatedClasses, 182 instantiatedClasses: compiler.resolverWorld.directlyInstantiatedClasses,
183 resolvedElements: compiler.enqueuer.resolution.resolvedElements, 183 resolvedElements: compiler.enqueuer.resolution.processedElements,
184 usedTypeLiterals: usedTypeLiterals, 184 usedTypeLiterals: usedTypeLiterals,
185 postProcessElementAst: postProcessElementAst, 185 postProcessElementAst: postProcessElementAst,
186 computeElementAst: computeElementAst, 186 computeElementAst: computeElementAst,
187 shouldOutput: shouldOutput, 187 shouldOutput: shouldOutput,
188 isSafeToRemoveTypeDeclarations: isSafeToRemoveTypeDeclarations, 188 isSafeToRemoveTypeDeclarations: isSafeToRemoveTypeDeclarations,
189 sortElements: Elements.sortedByPosition, 189 sortElements: Elements.sortedByPosition,
190 mirrorRenamer: mirrorRenamer, 190 mirrorRenamer: mirrorRenamer,
191 mainFunction: compiler.mainFunction, 191 mainFunction: compiler.mainFunction,
192 outputUri: compiler.outputUri); 192 outputUri: compiler.outputUri);
193 193
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 node, MessageKind.DEFERRED_LIBRARY_DART_2_DART); 336 node, MessageKind.DEFERRED_LIBRARY_DART_2_DART);
337 return false; 337 return false;
338 } 338 }
339 } 339 }
340 340
341 class DartResolutionCallbacks extends ResolutionCallbacks { 341 class DartResolutionCallbacks extends ResolutionCallbacks {
342 final DartBackend backend; 342 final DartBackend backend;
343 343
344 DartResolutionCallbacks(this.backend); 344 DartResolutionCallbacks(this.backend);
345 345
346 @override
347 WorldImpact transformImpact(ResolutionWorldImpact worldImpact) {
348 TransformedWorldImpact transformed =
349 new TransformedWorldImpact(worldImpact);
350 for (DartType typeLiteral in worldImpact.typeLiterals) {
351 onTypeLiteral(typeLiteral, transformed);
352 }
353 for (InterfaceType instantiatedType in worldImpact.instantiatedTypes) {
354 // TODO(johnniwinther): Remove this when dependency tracking is done on
355 // the world impact itself.
356 transformed.registerInstantiation(instantiatedType);
357 backend.registerInstantiatedType(
358 instantiatedType, backend.compiler.enqueuer.resolution, transformed);
359 }
360 return transformed;
361 }
362
363 @override
346 void onTypeLiteral(DartType type, Registry registry) { 364 void onTypeLiteral(DartType type, Registry registry) {
347 if (type.isInterfaceType) { 365 if (type.isInterfaceType) {
348 backend.usedTypeLiterals.add(type.element); 366 backend.usedTypeLiterals.add(type.element);
349 } 367 }
350 } 368 }
351 } 369 }
352 370
353 class EmitterUnparser extends Unparser { 371 class EmitterUnparser extends Unparser {
354 final Map<Node, String> renames; 372 final Map<Node, String> renames;
355 373
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 } 542 }
525 543
526 // TODO(johnniwinther): Remove this when values are computed from the 544 // TODO(johnniwinther): Remove this when values are computed from the
527 // expressions. 545 // expressions.
528 @override 546 @override
529 void copyConstantValues(DartConstantTask task) { 547 void copyConstantValues(DartConstantTask task) {
530 constantCompiler.constantValueMap.addAll( 548 constantCompiler.constantValueMap.addAll(
531 task.constantCompiler.constantValueMap); 549 task.constantCompiler.constantValueMap);
532 } 550 }
533 } 551 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698