| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 // Tests that the closed world computed from [WorldImpact]s derived from kernel | 5 // Tests that the closed world computed from [WorldImpact]s derived from kernel |
| 6 // is equivalent to the original computed from resolution. | 6 // is equivalent to the original computed from resolution. |
| 7 library dart2js.kernel.closed_world_test; | 7 library dart2js.kernel.closed_world_test; |
| 8 | 8 |
| 9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
| 10 import 'package:compiler/src/commandline_options.dart'; | 10 import 'package:compiler/src/commandline_options.dart'; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 JavaScriptBackend backend = compiler.backend; | 129 JavaScriptBackend backend = compiler.backend; |
| 130 | 130 |
| 131 // TODO(johnniwinther): Store backend info separately. This replacement is | 131 // TODO(johnniwinther): Store backend info separately. This replacement is |
| 132 // made to reset a field in [TypeVariableHandler] that prevents it from | 132 // made to reset a field in [TypeVariableHandler] that prevents it from |
| 133 // enqueuing twice. | 133 // enqueuing twice. |
| 134 backend.typeVariableHandler = new TypeVariableHandler(compiler); | 134 backend.typeVariableHandler = new TypeVariableHandler(compiler); |
| 135 | 135 |
| 136 if (compiler.deferredLoadTask.isProgramSplit) { | 136 if (compiler.deferredLoadTask.isProgramSplit) { |
| 137 enqueuer.applyImpact(backend.computeDeferredLoadingImpact()); | 137 enqueuer.applyImpact(backend.computeDeferredLoadingImpact()); |
| 138 } | 138 } |
| 139 enqueuer.applyImpact(backend.computeHelpersImpact()); | 139 enqueuer.open(const ImpactStrategy(), compiler.mainFunction, |
| 140 enqueuer.applyImpact(enqueuer.nativeEnqueuer | 140 compiler.libraryLoader.libraries); |
| 141 .processNativeClasses(compiler.libraryLoader.libraries)); | |
| 142 enqueuer.applyImpact( | |
| 143 backend.computeMainImpact(compiler.mainFunction, forResolution: true)); | |
| 144 enqueuer.forEach((work) { | 141 enqueuer.forEach((work) { |
| 145 AstElement element = work.element; | 142 AstElement element = work.element; |
| 146 ResolutionImpact resolutionImpact = build(compiler, element.resolvedAst); | 143 ResolutionImpact resolutionImpact = build(compiler, element.resolvedAst); |
| 147 WorldImpact worldImpact = compiler.backend.impactTransformer | 144 WorldImpact worldImpact = compiler.backend.impactTransformer |
| 148 .transformResolutionImpact(enqueuer, resolutionImpact); | 145 .transformResolutionImpact(enqueuer, resolutionImpact); |
| 149 enqueuer.applyImpact(worldImpact, impactSource: element); | 146 enqueuer.applyImpact(worldImpact, impactSource: element); |
| 150 }); | 147 }); |
| 151 return enqueuer.worldBuilder.closeWorld(compiler.reporter); | 148 return enqueuer.worldBuilder.closeWorld(compiler.reporter); |
| 152 } | 149 } |
| OLD | NEW |