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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 await compiler.run(entryPoint); | 82 await compiler.run(entryPoint); |
83 compiler.openWorld.closeWorld(compiler.reporter); | 83 compiler.openWorld.closeWorld(compiler.reporter); |
84 | 84 |
85 JavaScriptBackend backend = compiler.backend; | 85 JavaScriptBackend backend = compiler.backend; |
86 // Create a new resolution enqueuer and feed it with the [WorldImpact]s | 86 // Create a new resolution enqueuer and feed it with the [WorldImpact]s |
87 // computed from kernel through the [build] in `kernel_impact.dart`. | 87 // computed from kernel through the [build] in `kernel_impact.dart`. |
88 ResolutionEnqueuer enqueuer = new ResolutionEnqueuer( | 88 ResolutionEnqueuer enqueuer = new ResolutionEnqueuer( |
89 compiler.enqueuer, | 89 compiler.enqueuer, |
90 compiler.options, | 90 compiler.options, |
91 compiler.resolution, | 91 compiler.resolution, |
92 compiler.enqueuerFilter, | |
93 const TreeShakingEnqueuerStrategy(), | 92 const TreeShakingEnqueuerStrategy(), |
94 compiler.globalDependencies, | 93 compiler.globalDependencies, |
95 backend, | 94 backend, |
96 compiler.commonElements, | 95 compiler.commonElements, |
97 compiler.cacheStrategy, | 96 compiler.cacheStrategy, |
98 'enqueuer from kernel'); | 97 'enqueuer from kernel'); |
99 // TODO(johnniwinther): Store backend info separately. This replacement is | 98 // TODO(johnniwinther): Store backend info separately. This replacement is |
100 // made to reset a field in [TypeVariableHandler] that prevents it from | 99 // made to reset a field in [TypeVariableHandler] that prevents it from |
101 // enqueuing twice. | 100 // enqueuing twice. |
102 backend.typeVariableHandler = new TypeVariableHandler(compiler); | 101 backend.typeVariableHandler = new TypeVariableHandler(compiler); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } | 135 } |
137 // The class cannot itself be instantiated. | 136 // The class cannot itself be instantiated. |
138 return false; | 137 return false; |
139 } | 138 } |
140 return true; | 139 return true; |
141 }, verbose: arguments.verbose); | 140 }, verbose: arguments.verbose); |
142 checkClosedWorlds(compiler.closedWorld, closedWorld, | 141 checkClosedWorlds(compiler.closedWorld, closedWorld, |
143 verbose: arguments.verbose); | 142 verbose: arguments.verbose); |
144 }); | 143 }); |
145 } | 144 } |
OLD | NEW |