| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 // Test that the optimized algorithm for mixin applications matches the mixins | 5 // Test that the optimized algorithm for mixin applications matches the mixins |
| 6 // generated by fasta. | 6 // generated by fasta. |
| 7 library dart2js.kernel.mixins_test; | 7 library dart2js.kernel.mixins_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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 Uri entryPoint = await createTemp(Uri.parse('memory:main.dart'), SOURCE, | 109 Uri entryPoint = await createTemp(Uri.parse('memory:main.dart'), SOURCE, |
| 110 printSteps: true); | 110 printSteps: true); |
| 111 | 111 |
| 112 print( | 112 print( |
| 113 '---- compiler from ast -----------------------------------------------'
); | 113 '---- compiler from ast -----------------------------------------------'
); |
| 114 var result = | 114 var result = |
| 115 await runCompiler(entryPoint: entryPoint, options: [Flags.analyzeOnly]); | 115 await runCompiler(entryPoint: entryPoint, options: [Flags.analyzeOnly]); |
| 116 Compiler compiler1 = result.compiler; | 116 Compiler compiler1 = result.compiler; |
| 117 | 117 |
| 118 Compiler compiler2 = await compileWithDill( | 118 Compiler compiler2 = await compileWithDill( |
| 119 entryPoint, {}, [Flags.analyzeOnly], | 119 entryPoint: entryPoint, |
| 120 memorySourceFiles: {}, |
| 121 options: [Flags.analyzeOnly], |
| 120 printSteps: true); | 122 printSteps: true); |
| 121 | 123 |
| 122 ElementEnvironment env1 = compiler1.frontendStrategy.elementEnvironment; | 124 ElementEnvironment env1 = compiler1.frontendStrategy.elementEnvironment; |
| 123 DartTypes types1 = compiler1.frontendStrategy.dartTypes; | 125 DartTypes types1 = compiler1.frontendStrategy.dartTypes; |
| 124 ClosedWorld closedWorld1 = compiler1.resolutionWorldBuilder.closeWorld(); | 126 ClosedWorld closedWorld1 = compiler1.resolutionWorldBuilder.closeWorld(); |
| 125 | 127 |
| 126 KernelFrontEndStrategy frontendStrategy = compiler2.frontendStrategy; | 128 KernelFrontEndStrategy frontendStrategy = compiler2.frontendStrategy; |
| 127 ElementEnvironment env2 = frontendStrategy.elementEnvironment; | 129 ElementEnvironment env2 = frontendStrategy.elementEnvironment; |
| 128 DartTypes types2 = frontendStrategy.dartTypes; | 130 DartTypes types2 = frontendStrategy.dartTypes; |
| 129 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld(); | 131 ClosedWorld closedWorld2 = compiler2.resolutionWorldBuilder.closeWorld(); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 '${cls1.name} direct subclasses', | 194 '${cls1.name} direct subclasses', |
| 193 (a, b) => equivalence.entityEquivalence(a.cls, b.cls)); | 195 (a, b) => equivalence.entityEquivalence(a.cls, b.cls)); |
| 194 } | 196 } |
| 195 | 197 |
| 196 env1.forEachClass(env1.mainLibrary, (ClassEntity cls1) { | 198 env1.forEachClass(env1.mainLibrary, (ClassEntity cls1) { |
| 197 ClassEntity cls2 = env2.lookupClass(env2.mainLibrary, cls1.name); | 199 ClassEntity cls2 = env2.lookupClass(env2.mainLibrary, cls1.name); |
| 198 checkClasses(cls1, cls2); | 200 checkClasses(cls1, cls2); |
| 199 }); | 201 }); |
| 200 }); | 202 }); |
| 201 } | 203 } |
| OLD | NEW |