| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'package:compiler/src/commandline_options.dart'; | 6 import 'package:compiler/src/commandline_options.dart'; |
| 7 import 'package:compiler/src/common.dart'; | 7 import 'package:compiler/src/common.dart'; |
| 8 import 'package:compiler/src/common_elements.dart'; | 8 import 'package:compiler/src/common_elements.dart'; |
| 9 import 'package:compiler/src/compiler.dart'; | 9 import 'package:compiler/src/compiler.dart'; |
| 10 import 'package:compiler/src/elements/elements.dart'; | 10 import 'package:compiler/src/elements/elements.dart'; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 memorySourceFiles: {'main.dart': code.sourceCode}, options: options); | 37 memorySourceFiles: {'main.dart': code.sourceCode}, options: options); |
| 38 compiler.stopAfterTypeInference = true; | 38 compiler.stopAfterTypeInference = true; |
| 39 await compiler.run(mainUri); | 39 await compiler.run(mainUri); |
| 40 return compiler; | 40 return compiler; |
| 41 } | 41 } |
| 42 | 42 |
| 43 /// Compile [code] from .dill sources. | 43 /// Compile [code] from .dill sources. |
| 44 Future<Compiler> compileFromDill( | 44 Future<Compiler> compileFromDill( |
| 45 AnnotatedCode code, Uri mainUri, List<String> options) async { | 45 AnnotatedCode code, Uri mainUri, List<String> options) async { |
| 46 Compiler compiler = await compileWithDill( | 46 Compiler compiler = await compileWithDill( |
| 47 mainUri, | 47 entryPoint: mainUri, |
| 48 {'main.dart': code.sourceCode}, | 48 memorySourceFiles: {'main.dart': code.sourceCode}, |
| 49 [Flags.disableTypeInference]..addAll(options), | 49 options: [Flags.disableTypeInference]..addAll(options), |
| 50 beforeRun: (Compiler compiler) { | 50 beforeRun: (Compiler compiler) { |
| 51 compiler.stopAfterTypeInference = true; | 51 compiler.stopAfterTypeInference = true; |
| 52 }); | 52 }); |
| 53 return compiler; | 53 return compiler; |
| 54 } | 54 } |
| 55 | 55 |
| 56 /// Compute expected and actual data for all members defined in [annotatedCode]. | 56 /// Compute expected and actual data for all members defined in [annotatedCode]. |
| 57 /// | 57 /// |
| 58 /// Actual data is computed using [computeMemberData] and [code] is compiled | 58 /// Actual data is computed using [computeMemberData] and [code] is compiled |
| 59 /// using [compileFunction]. | 59 /// using [compileFunction]. |
| 60 Future<IdData> computeData( | 60 Future<IdData> computeData( |
| 61 String annotatedCode, | 61 String annotatedCode, |
| 62 ComputeMemberDataFunction computeMemberData, | 62 ComputeMemberDataFunction computeMemberData, |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 visitVariableDeclaration(ir.VariableDeclaration node) { | 315 visitVariableDeclaration(ir.VariableDeclaration node) { |
| 316 computeForNode(node); | 316 computeForNode(node); |
| 317 super.visitVariableDeclaration(node); | 317 super.visitVariableDeclaration(node); |
| 318 } | 318 } |
| 319 | 319 |
| 320 visitFunctionDeclaration(ir.FunctionDeclaration node) { | 320 visitFunctionDeclaration(ir.FunctionDeclaration node) { |
| 321 computeForNode(node); | 321 computeForNode(node); |
| 322 super.visitFunctionDeclaration(node); | 322 super.visitFunctionDeclaration(node); |
| 323 } | 323 } |
| 324 } | 324 } |
| OLD | NEW |