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

Side by Side Diff: pkg/analyzer/lib/src/task/dart.dart

Issue 2151373002: Share LibrarySpecificUnits when possible (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Clean-up Created 4 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library analyzer.src.task.dart; 5 library analyzer.src.task.dart;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 4064 matching lines...) Expand 10 before | Expand all | Expand 10 after
4075 List<Source> exportedSources = exportedSourceSet.toList(); 4075 List<Source> exportedSources = exportedSourceSet.toList();
4076 List<Source> importedSources = importedSourceSet.toList(); 4076 List<Source> importedSources = importedSourceSet.toList();
4077 List<Source> includedSources = includedSourceSet.toList(); 4077 List<Source> includedSources = includedSourceSet.toList();
4078 List<AnalysisError> parseErrors = getUniqueErrors(errorListener.errors); 4078 List<AnalysisError> parseErrors = getUniqueErrors(errorListener.errors);
4079 List<Source> unitSources = <Source>[source]..addAll(includedSourceSet); 4079 List<Source> unitSources = <Source>[source]..addAll(includedSourceSet);
4080 List<Source> referencedSources = (new Set<Source>() 4080 List<Source> referencedSources = (new Set<Source>()
4081 ..addAll(importedSources) 4081 ..addAll(importedSources)
4082 ..addAll(exportedSources) 4082 ..addAll(exportedSources)
4083 ..addAll(unitSources)) 4083 ..addAll(unitSources))
4084 .toList(); 4084 .toList();
4085 List<LibrarySpecificUnit> librarySpecificUnits = 4085 List<LibrarySpecificUnit> librarySpecificUnits = unitSources
4086 unitSources.map((s) => new LibrarySpecificUnit(source, s)).toList(); 4086 .map((s) => (context as InternalAnalysisContext)
4087 .getLibrarySpecificUnit(source, s))
4088 .toList();
4087 outputs[EXPLICITLY_IMPORTED_LIBRARIES] = explicitlyImportedSources; 4089 outputs[EXPLICITLY_IMPORTED_LIBRARIES] = explicitlyImportedSources;
4088 outputs[EXPORTED_LIBRARIES] = exportedSources; 4090 outputs[EXPORTED_LIBRARIES] = exportedSources;
4089 outputs[IMPORTED_LIBRARIES] = importedSources; 4091 outputs[IMPORTED_LIBRARIES] = importedSources;
4090 outputs[INCLUDED_PARTS] = includedSources; 4092 outputs[INCLUDED_PARTS] = includedSources;
4091 outputs[LIBRARY_SPECIFIC_UNITS] = librarySpecificUnits; 4093 outputs[LIBRARY_SPECIFIC_UNITS] = librarySpecificUnits;
4092 outputs[PARSE_ERRORS] = parseErrors; 4094 outputs[PARSE_ERRORS] = parseErrors;
4093 outputs[PARSED_UNIT] = unit; 4095 outputs[PARSED_UNIT] = unit;
4094 outputs[REFERENCED_NAMES] = referencedNames; 4096 outputs[REFERENCED_NAMES] = referencedNames;
4095 outputs[REFERENCED_SOURCES] = referencedSources; 4097 outputs[REFERENCED_SOURCES] = referencedSources;
4096 outputs[SOURCE_KIND] = sourceKind; 4098 outputs[SOURCE_KIND] = sourceKind;
(...skipping 2374 matching lines...) Expand 10 before | Expand all | Expand 10 after
6471 6473
6472 @override 6474 @override
6473 bool moveNext() { 6475 bool moveNext() {
6474 if (_newSources.isEmpty) { 6476 if (_newSources.isEmpty) {
6475 return false; 6477 return false;
6476 } 6478 }
6477 currentTarget = _newSources.removeLast(); 6479 currentTarget = _newSources.removeLast();
6478 return true; 6480 return true;
6479 } 6481 }
6480 } 6482 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/lib/src/task/dart_work_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698