Version 2.10.0-34.0.dev
Merge commit '332aa7d0c5f1cb1fe4c16418cccfbbc229cd019c' into 'dev'
diff --git a/pkg/analyzer/lib/src/dart/analysis/file_state.dart b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
index d288490..1a6d0f1 100644
--- a/pkg/analyzer/lib/src/dart/analysis/file_state.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/file_state.dart
@@ -46,6 +46,7 @@
var counterFileStateRefresh = 0;
var counterUnlinkedLinkedBytes = 0;
+int fileObjectId = 0;
var timerFileStateRefresh = Stopwatch();
/// [FileContentOverlay] is used to temporary override content of files.
@@ -116,6 +117,9 @@
/// The language version for the package that contains this file.
final Version _packageLanguageVersion;
+ int id = fileObjectId++;
+ int refreshId;
+
bool _exists;
String _content;
String _contentHash;
@@ -351,6 +355,7 @@
/// Return `true` if the API signature changed since the last refresh.
bool refresh({bool allowCached = false}) {
counterFileStateRefresh++;
+ refreshId = fileObjectId++;
var timerWasRunning = timerFileStateRefresh.isRunning;
if (!timerWasRunning) {
@@ -492,7 +497,7 @@
if (path == null) {
return '<unresolved>';
} else {
- return '$uri = $path';
+ return '[id: $id][rid: $refreshId]$uri = $path';
}
}
diff --git a/pkg/analyzer/lib/src/dart/analysis/library_context.dart b/pkg/analyzer/lib/src/dart/analysis/library_context.dart
index 3f4b76a..f28f239 100644
--- a/pkg/analyzer/lib/src/dart/analysis/library_context.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/library_context.dart
@@ -38,6 +38,7 @@
class LibraryContext {
static const _maxLinkedDataInBytes = 64 * 1024 * 1024;
+ final int id = fileObjectId++;
final LibraryContextTestView testView;
final PerformanceLog logger;
final ByteStore byteStore;
@@ -109,12 +110,18 @@
var bytesGet = 0;
var bytesPut = 0;
- void loadBundle(LibraryCycle cycle) {
+ var thisLoadLogBuffer = StringBuffer();
+
+ void loadBundle(LibraryCycle cycle, String debugPrefix) {
if (!loadedBundles.add(cycle)) return;
+ thisLoadLogBuffer.writeln('$debugPrefix$cycle');
+
librariesTotal += cycle.libraries.length;
- cycle.directDependencies.forEach(loadBundle);
+ cycle.directDependencies.forEach(
+ (e) => loadBundle(e, '$debugPrefix '),
+ );
var key = cycle.transitiveSignature + '.linked_bundle';
var bytes = byteStore.get(key);
@@ -161,21 +168,34 @@
if (existingLibraryReference != null) {
var existingElement = existingLibraryReference.element;
if (existingElement != null) {
+ var buffer = StringBuffer();
+
+ buffer.writeln('[The library is already loaded]');
+ buffer.writeln();
+
var existingSource = existingElement?.source;
+ buffer.writeln('[oldUri: ${existingSource.uri}]');
+ buffer.writeln('[oldPath: ${existingSource.fullName}]');
+ buffer.writeln('[newUri: ${libraryFile.uriStr}]');
+ buffer.writeln('[newPath: ${libraryFile.path}]');
+ buffer.writeln('[cycle: $cycle]');
+ buffer.writeln();
+
+ buffer.writeln('[loadedBundles: ${loadedBundles.toList()}]');
+ buffer.writeln();
+
+ buffer.writeln('Bundles loaded in this load2() invocation:');
+ buffer.writeln(thisLoadLogBuffer);
+ buffer.writeln();
+
var libraryRefs = elementFactory.rootReference.children;
var libraryUriList = libraryRefs.map((e) => e.name).toList();
- var statusText = '[The library is already loaded]'
- '[oldUri: ${existingSource.uri}]'
- '[oldPath: ${existingSource.fullName}]'
- '[newUri: ${libraryFile.uriStr}]'
- '[newPath: ${libraryFile.path}]'
- '[cycle: $cycle]'
- '[loadedBundles: ${loadedBundles.toList()}]'
- '[elementFactory.libraries: $libraryUriList]';
+ buffer.writeln('[elementFactory.libraries: $libraryUriList]');
+
throw CaughtExceptionWithFiles(
'Cycle loading state error',
StackTrace.current,
- {'status': statusText},
+ {'status': buffer.toString()},
);
}
}
@@ -247,7 +267,7 @@
logger.run('Prepare linked bundles', () {
var libraryCycle = targetLibrary.libraryCycle;
- loadBundle(libraryCycle);
+ loadBundle(libraryCycle, '');
logger.writeln(
'[librariesTotal: $librariesTotal]'
'[librariesLoaded: $librariesLoaded]'
diff --git a/pkg/analyzer/lib/src/dart/analysis/library_graph.dart b/pkg/analyzer/lib/src/dart/analysis/library_graph.dart
index f8bc2dd..95e4972 100644
--- a/pkg/analyzer/lib/src/dart/analysis/library_graph.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/library_graph.dart
@@ -18,6 +18,8 @@
/// Information about libraries that reference each other, so form a cycle.
class LibraryCycle {
+ final int id = fileObjectId++;
+
/// The libraries that belong to this cycle.
final List<FileState> libraries = [];
@@ -65,7 +67,7 @@
@override
String toString() {
- return '[' + libraries.join(', ') + ']';
+ return '[[id: $id] ' + libraries.join(', ') + ']';
}
}
diff --git a/tools/VERSION b/tools/VERSION
index ce12337..7b5d868 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 10
PATCH 0
-PRERELEASE 33
+PRERELEASE 34
PRERELEASE_PATCH 0
\ No newline at end of file