| 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 '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' | 9 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' |
| 10 show NullSink; | 10 show NullSink; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 compiler.symbolImplementationClass = | 181 compiler.symbolImplementationClass = |
| 182 cachedCompiler.symbolImplementationClass; | 182 cachedCompiler.symbolImplementationClass; |
| 183 compiler.symbolValidatedConstructor = | 183 compiler.symbolValidatedConstructor = |
| 184 cachedCompiler.symbolValidatedConstructor; | 184 cachedCompiler.symbolValidatedConstructor; |
| 185 compiler.mirrorsUsedConstructor = cachedCompiler.mirrorsUsedConstructor; | 185 compiler.mirrorsUsedConstructor = cachedCompiler.mirrorsUsedConstructor; |
| 186 compiler.deferredLibraryClass = cachedCompiler.deferredLibraryClass; | 186 compiler.deferredLibraryClass = cachedCompiler.deferredLibraryClass; |
| 187 | 187 |
| 188 Map cachedTreeElements = | 188 Map cachedTreeElements = |
| 189 cachedCompiler.enqueuer.resolution.resolvedElements; | 189 cachedCompiler.enqueuer.resolution.resolvedElements; |
| 190 cachedTreeElements.forEach((element, treeElements) { | 190 cachedTreeElements.forEach((element, treeElements) { |
| 191 if (element.getLibrary().isPlatformLibrary) { | 191 if (element.library.isPlatformLibrary) { |
| 192 compiler.enqueuer.resolution.resolvedElements[element] = | 192 compiler.enqueuer.resolution.resolvedElements[element] = |
| 193 treeElements; | 193 treeElements; |
| 194 } | 194 } |
| 195 }); | 195 }); |
| 196 | 196 |
| 197 // One potential problem that can occur when reusing elements is that there | 197 // One potential problem that can occur when reusing elements is that there |
| 198 // is a stale reference to an old compiler object. By nulling out the old | 198 // is a stale reference to an old compiler object. By nulling out the old |
| 199 // compiler's fields, such stale references are easier to identify. | 199 // compiler's fields, such stale references are easier to identify. |
| 200 cachedCompiler.scanner = null; | 200 cachedCompiler.scanner = null; |
| 201 cachedCompiler.dietParser = null; | 201 cachedCompiler.dietParser = null; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 232 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics); | 232 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics); |
| 233 | 233 |
| 234 List<Uri> libraries = <Uri>[]; | 234 List<Uri> libraries = <Uri>[]; |
| 235 memorySourceFiles.forEach((String path, _) { | 235 memorySourceFiles.forEach((String path, _) { |
| 236 libraries.add(new Uri(scheme: 'memory', path: path)); | 236 libraries.add(new Uri(scheme: 'memory', path: path)); |
| 237 }); | 237 }); |
| 238 | 238 |
| 239 return analyze(libraries, libraryRoot, packageRoot, | 239 return analyze(libraries, libraryRoot, packageRoot, |
| 240 provider, handler, options); | 240 provider, handler, options); |
| 241 } | 241 } |
| OLD | NEW |