| 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 library kernel.target.targets; | 4 library kernel.target.targets; |
| 5 | 5 |
| 6 import '../ast.dart'; | 6 import '../ast.dart'; |
| 7 import '../core_types.dart'; | 7 import '../core_types.dart'; |
| 8 import '../transformations/treeshaker.dart' show ProgramRoot; | 8 import '../transformations/treeshaker.dart' show ProgramRoot; |
| 9 import 'flutter.dart'; | 9 import 'flutter.dart'; |
| 10 import 'vm.dart'; | 10 import 'vm.dart'; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 /// should expect that the program will contain external libraries. | 73 /// should expect that the program will contain external libraries. |
| 74 void performModularTransformations(Program program); | 74 void performModularTransformations(Program program); |
| 75 | 75 |
| 76 /// Perform target-specific whole-program transformations. | 76 /// Perform target-specific whole-program transformations. |
| 77 /// | 77 /// |
| 78 /// These transformations should be optimizations and not required for | 78 /// These transformations should be optimizations and not required for |
| 79 /// correctness. Everything should work if a simple and fast linker chooses | 79 /// correctness. Everything should work if a simple and fast linker chooses |
| 80 /// not to apply these transformations. | 80 /// not to apply these transformations. |
| 81 void performGlobalTransformations(Program program); | 81 void performGlobalTransformations(Program program); |
| 82 | 82 |
| 83 /// Builds an expression that instantiates an [Invocation] that can be passed |
| 84 /// to [noSuchMethod]. |
| 85 Expression instantiateInvocation(Member target, Expression receiver, |
| 86 String name, Arguments arguments, int offset, bool isSuper); |
| 87 |
| 83 String toString() => 'Target($name)'; | 88 String toString() => 'Target($name)'; |
| 84 } | 89 } |
| 85 | 90 |
| 86 class NoneTarget extends Target { | 91 class NoneTarget extends Target { |
| 87 final TargetFlags flags; | 92 final TargetFlags flags; |
| 88 | 93 |
| 89 NoneTarget(this.flags); | 94 NoneTarget(this.flags); |
| 90 | 95 |
| 91 bool get strongMode => flags.strongMode; | 96 bool get strongMode => flags.strongMode; |
| 92 String get name => 'none'; | 97 String get name => 'none'; |
| 93 List<String> get extraRequiredLibraries => <String>[]; | 98 List<String> get extraRequiredLibraries => <String>[]; |
| 94 void performModularTransformations(Program program) {} | 99 void performModularTransformations(Program program) {} |
| 95 void performGlobalTransformations(Program program) {} | 100 void performGlobalTransformations(Program program) {} |
| 101 |
| 102 @override |
| 103 Expression instantiateInvocation(Member target, Expression receiver, |
| 104 String name, Arguments arguments, int offset, bool isSuper) { |
| 105 return new InvalidExpression(); |
| 106 } |
| 96 } | 107 } |
| OLD | NEW |