Skip to content

Commit

Permalink
Remove parsed units caching for now.
Browse files Browse the repository at this point in the history
I see that we leak them when using DAS.
So, lets remove them for now until we can do this safely.

R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Iaf349225c6e338eacb40e82deb5f84dfaa82e48d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105326
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
  • Loading branch information
scheglov authored and commit-bot@chromium.org committed Jun 6, 2019
1 parent 7e9a4b7 commit 5878064
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions pkg/analyzer/lib/src/dart/analysis/file_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ class FileState {
List<int> _apiSignature;

UnlinkedUnit2 _unlinked2;
CompilationUnit _unitForLinking;

List<FileState> _importedFiles;
List<FileState> _exportedFiles;
Expand Down Expand Up @@ -535,18 +534,6 @@ class FileState {
return apiSignatureChanged;
}

/// If the file has a parsed unit from computing unlinked data, return it.
/// Otherwise, parse it afresh now.
CompilationUnit takeUnitForLinking() {
if (_unitForLinking != null) {
var result = _unitForLinking;
_unitForLinking = null;
return result;
} else {
return parse();
}
}

@override
String toString() => path ?? '<unresolved>';

Expand Down Expand Up @@ -658,7 +645,6 @@ class FileState {
bytes = _fsState._byteStore.get(_unlinkedKey);
if (bytes == null || bytes.isEmpty) {
CompilationUnit unit = parse();
_unitForLinking = unit;
_fsState._logger.run('Create unlinked for $path', () {
var unlinkedUnit = serializeAstUnlinked2(unit);
var definedNames = computeDefinedNames(unit);
Expand Down
2 changes: 1 addition & 1 deletion pkg/analyzer/lib/src/dart/analysis/library_context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class LibraryContext {
var inputUnits = <link2.LinkInputUnit>[];
for (var file in libraryFile.libraryFiles) {
var isSynthetic = !file.exists;
var unit = file.takeUnitForLinking();
var unit = file.parse();
inputUnits.add(
link2.LinkInputUnit(file.source, isSynthetic, unit),
);
Expand Down

0 comments on commit 5878064

Please sign in to comment.