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

Unified Diff: dart/tests/compiler/dart2js/memory_compiler.dart

Issue 21242002: Retain elements a finer granularity than library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Variable initialized too early. Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: dart/tests/compiler/dart2js/memory_compiler.dart
diff --git a/dart/tests/compiler/dart2js/memory_compiler.dart b/dart/tests/compiler/dart2js/memory_compiler.dart
index a45e1ca27695eae95ab54c4f5fb5c0a8d648b8c3..5418963d726074a823ec6aa4cf37c9be3453d8a1 100644
--- a/dart/tests/compiler/dart2js/memory_compiler.dart
+++ b/dart/tests/compiler/dart2js/memory_compiler.dart
@@ -20,7 +20,8 @@ import '../../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirro
Compiler compilerFor(Map<String,String> memorySourceFiles,
{DiagnosticHandler diagnosticHandler,
- List<String> options: const []}) {
+ List<String> options: const [],
+ Compiler cachedCompiler}) {
Uri script = currentDirectory.resolve(nativeToUriPath(Platform.script));
Uri libraryRoot = script.resolve('../../../sdk/');
Uri packageRoot = script.resolve('./packages/');
@@ -42,6 +43,37 @@ Compiler compilerFor(Map<String,String> memorySourceFiles,
libraryRoot,
packageRoot,
options);
+ if (cachedCompiler != null) {
+ compiler.coreLibrary = cachedCompiler.libraries['dart:core'];
+ compiler.types = cachedCompiler.types;
+ cachedCompiler.libraries.forEach((String uri, library) {
+ if (library.isPlatformLibrary) {
+ compiler.libraries[uri] = library;
+ compiler.onLibraryScanned(library, library.canonicalUri);
+ }
+ });
+
+ compiler.symbolConstructor = cachedCompiler.symbolConstructor;
+ compiler.mirrorSystemClass = cachedCompiler.mirrorSystemClass;
+ compiler.mirrorsUsedClass = cachedCompiler.mirrorsUsedClass;
+ compiler.mirrorSystemGetNameFunction =
+ cachedCompiler.mirrorSystemGetNameFunction;
+ compiler.symbolImplementationClass =
+ cachedCompiler.symbolImplementationClass;
+ compiler.symbolValidatedConstructor =
+ cachedCompiler.symbolValidatedConstructor;
+ compiler.mirrorsUsedConstructor = cachedCompiler.mirrorsUsedConstructor;
+ compiler.deferredLibraryClass = cachedCompiler.deferredLibraryClass;
+
+ Map cachedTreeElements =
+ cachedCompiler.enqueuer.resolution.resolvedElements;
+ cachedTreeElements.forEach((element, treeElements) {
+ if (element.getLibrary().isPlatformLibrary) {
+ compiler.enqueuer.resolution.resolvedElements[element] =
+ treeElements;
+ }
+ });
+ }
return compiler;
}

Powered by Google App Engine
This is Rietveld 408576698