| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 dart2js.test.memory_compiler; | 5 library dart2js.test.memory_compiler; |
| 6 | 6 |
| 7 import 'memory_source_file_helper.dart'; | 7 import 'memory_source_file_helper.dart'; |
| 8 | 8 |
| 9 import 'package:compiler/implementation/dart2jslib.dart' | 9 import 'package:compiler/implementation/dart2jslib.dart' |
| 10 show NullSink; | 10 show NullSink; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 options, | 164 options, |
| 165 {}); | 165 {}); |
| 166 if (cachedCompiler != null) { | 166 if (cachedCompiler != null) { |
| 167 compiler.coreLibrary = cachedCompiler.libraries['dart:core']; | 167 compiler.coreLibrary = cachedCompiler.libraries['dart:core']; |
| 168 compiler.types = cachedCompiler.types.copy(compiler); | 168 compiler.types = cachedCompiler.types.copy(compiler); |
| 169 Map copiedLibraries = {}; | 169 Map copiedLibraries = {}; |
| 170 cachedCompiler.libraries.forEach((String uri, library) { | 170 cachedCompiler.libraries.forEach((String uri, library) { |
| 171 if (library.isPlatformLibrary) { | 171 if (library.isPlatformLibrary) { |
| 172 compiler.onLibraryCreated(library); | 172 compiler.onLibraryCreated(library); |
| 173 compiler.libraries[uri] = library; | 173 compiler.libraries[uri] = library; |
| 174 compiler.onLibraryScanned(library); | 174 // TODO(johnniwinther): Assert that no libraries are created lazily from |
| 175 // this call. |
| 176 compiler.onLibraryScanned(library, null); |
| 177 if (library.isPatched) { |
| 178 var patchLibrary = library.patch; |
| 179 compiler.onLibraryCreated(patchLibrary); |
| 180 // TODO(johnniwinther): Assert that no libraries are created lazily |
| 181 // from this call. |
| 182 compiler.onLibraryScanned(patchLibrary, null); |
| 183 } |
| 175 copiedLibraries[library.canonicalUri] = library; | 184 copiedLibraries[library.canonicalUri] = library; |
| 176 } | 185 } |
| 177 }); | 186 }); |
| 178 // TODO(johnniwinther): Assert that no libraries are loaded lazily from | 187 // TODO(johnniwinther): Assert that no libraries are loaded lazily from |
| 179 // this call. | 188 // this call. |
| 180 compiler.onLibrariesLoaded(copiedLibraries); | 189 compiler.onLibrariesLoaded(copiedLibraries); |
| 181 | 190 |
| 182 compiler.symbolConstructor = cachedCompiler.symbolConstructor; | 191 compiler.symbolConstructor = cachedCompiler.symbolConstructor; |
| 183 compiler.mirrorSystemClass = cachedCompiler.mirrorSystemClass; | 192 compiler.mirrorSystemClass = cachedCompiler.mirrorSystemClass; |
| 184 compiler.mirrorsUsedClass = cachedCompiler.mirrorsUsedClass; | 193 compiler.mirrorsUsedClass = cachedCompiler.mirrorsUsedClass; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics); | 248 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics); |
| 240 | 249 |
| 241 List<Uri> libraries = <Uri>[]; | 250 List<Uri> libraries = <Uri>[]; |
| 242 memorySourceFiles.forEach((String path, _) { | 251 memorySourceFiles.forEach((String path, _) { |
| 243 libraries.add(new Uri(scheme: 'memory', path: path)); | 252 libraries.add(new Uri(scheme: 'memory', path: path)); |
| 244 }); | 253 }); |
| 245 | 254 |
| 246 return analyze(libraries, libraryRoot, packageRoot, | 255 return analyze(libraries, libraryRoot, packageRoot, |
| 247 provider, handler, options); | 256 provider, handler, options); |
| 248 } | 257 } |
| OLD | NEW |