| 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 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:compiler/compiler.dart' show | 9 import 'package:compiler/compiler.dart' show |
| 10 DiagnosticHandler; | 10 DiagnosticHandler; |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 compiler.mirrorSystemGetNameFunction = | 238 compiler.mirrorSystemGetNameFunction = |
| 239 cachedCompiler.mirrorSystemGetNameFunction; | 239 cachedCompiler.mirrorSystemGetNameFunction; |
| 240 compiler.symbolImplementationClass = | 240 compiler.symbolImplementationClass = |
| 241 cachedCompiler.symbolImplementationClass; | 241 cachedCompiler.symbolImplementationClass; |
| 242 compiler.symbolValidatedConstructor = | 242 compiler.symbolValidatedConstructor = |
| 243 cachedCompiler.symbolValidatedConstructor; | 243 cachedCompiler.symbolValidatedConstructor; |
| 244 compiler.mirrorsUsedConstructor = cachedCompiler.mirrorsUsedConstructor; | 244 compiler.mirrorsUsedConstructor = cachedCompiler.mirrorsUsedConstructor; |
| 245 compiler.deferredLibraryClass = cachedCompiler.deferredLibraryClass; | 245 compiler.deferredLibraryClass = cachedCompiler.deferredLibraryClass; |
| 246 | 246 |
| 247 Iterable cachedTreeElements = | 247 Iterable cachedTreeElements = |
| 248 cachedCompiler.enqueuer.resolution.processedElements; | 248 cachedCompiler.enqueuer.resolution.resolvedElements; |
| 249 cachedTreeElements.forEach((element) { | 249 cachedTreeElements.forEach((element) { |
| 250 if (element.library.isPlatformLibrary) { | 250 if (element.library.isPlatformLibrary) { |
| 251 compiler.enqueuer.resolution.registerProcessedElement(element); | 251 compiler.enqueuer.resolution.registerResolvedElement(element); |
| 252 } | 252 } |
| 253 }); | 253 }); |
| 254 | 254 |
| 255 // One potential problem that can occur when reusing elements is that there | 255 // One potential problem that can occur when reusing elements is that there |
| 256 // is a stale reference to an old compiler object. By nulling out the old | 256 // is a stale reference to an old compiler object. By nulling out the old |
| 257 // compiler's fields, such stale references are easier to identify. | 257 // compiler's fields, such stale references are easier to identify. |
| 258 cachedCompiler.scanner = null; | 258 cachedCompiler.scanner = null; |
| 259 cachedCompiler.dietParser = null; | 259 cachedCompiler.dietParser = null; |
| 260 cachedCompiler.parser = null; | 260 cachedCompiler.parser = null; |
| 261 cachedCompiler.patchParser = null; | 261 cachedCompiler.patchParser = null; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics); | 330 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics); |
| 331 | 331 |
| 332 List<Uri> libraries = <Uri>[]; | 332 List<Uri> libraries = <Uri>[]; |
| 333 memorySourceFiles.forEach((String path, _) { | 333 memorySourceFiles.forEach((String path, _) { |
| 334 libraries.add(new Uri(scheme: 'memory', path: path)); | 334 libraries.add(new Uri(scheme: 'memory', path: path)); |
| 335 }); | 335 }); |
| 336 | 336 |
| 337 return analyze(libraries, libraryRoot, packageRoot, | 337 return analyze(libraries, libraryRoot, packageRoot, |
| 338 provider, handler, options); | 338 provider, handler, options); |
| 339 } | 339 } |
| OLD | NEW |