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 '../class_hierarchy.dart'; |
7 import '../core_types.dart'; | 8 import '../core_types.dart'; |
8 import '../transformations/treeshaker.dart' show ProgramRoot; | 9 import '../transformations/treeshaker.dart' show ProgramRoot; |
9 import 'flutter.dart'; | 10 import 'flutter.dart'; |
10 import 'vm.dart'; | 11 import 'vm.dart'; |
11 import 'vmcc.dart'; | 12 import 'vmcc.dart'; |
12 import 'vmreify.dart'; | 13 import 'vmreify.dart'; |
13 | 14 |
14 final List<String> targetNames = targets.keys.toList(); | 15 final List<String> targetNames = targets.keys.toList(); |
15 | 16 |
16 class TargetFlags { | 17 class TargetFlags { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 65 |
65 bool get strongMode; | 66 bool get strongMode; |
66 | 67 |
67 /// If true, the SDK should be loaded in strong mode. | 68 /// If true, the SDK should be loaded in strong mode. |
68 bool get strongModeSdk => strongMode; | 69 bool get strongModeSdk => strongMode; |
69 | 70 |
70 /// Perform target-specific modular transformations. | 71 /// Perform target-specific modular transformations. |
71 /// | 72 /// |
72 /// These transformations should not be whole-program transformations. They | 73 /// These transformations should not be whole-program transformations. They |
73 /// should expect that the program will contain external libraries. | 74 /// should expect that the program will contain external libraries. |
74 void performModularTransformations(CoreTypes coreTypes, Program program); | 75 void performModularTransformations( |
| 76 CoreTypes coreTypes, ClassHierarchy hierarchy, Program program); |
75 | 77 |
76 /// Perform target-specific whole-program transformations. | 78 /// Perform target-specific whole-program transformations. |
77 /// | 79 /// |
78 /// These transformations should be optimizations and not required for | 80 /// These transformations should be optimizations and not required for |
79 /// correctness. Everything should work if a simple and fast linker chooses | 81 /// correctness. Everything should work if a simple and fast linker chooses |
80 /// not to apply these transformations. | 82 /// not to apply these transformations. |
81 void performGlobalTransformations(CoreTypes coreTypes, Program program); | 83 void performGlobalTransformations(CoreTypes coreTypes, Program program); |
82 | 84 |
83 /// Builds an expression that instantiates an [Invocation] that can be passed | 85 /// Builds an expression that instantiates an [Invocation] that can be passed |
84 /// to [noSuchMethod]. | 86 /// to [noSuchMethod]. |
85 Expression instantiateInvocation(Member target, Expression receiver, | 87 Expression instantiateInvocation(Member target, Expression receiver, |
86 String name, Arguments arguments, int offset, bool isSuper); | 88 String name, Arguments arguments, int offset, bool isSuper); |
87 | 89 |
88 String toString() => 'Target($name)'; | 90 String toString() => 'Target($name)'; |
89 } | 91 } |
90 | 92 |
91 class NoneTarget extends Target { | 93 class NoneTarget extends Target { |
92 final TargetFlags flags; | 94 final TargetFlags flags; |
93 | 95 |
94 NoneTarget(this.flags); | 96 NoneTarget(this.flags); |
95 | 97 |
96 bool get strongMode => flags.strongMode; | 98 bool get strongMode => flags.strongMode; |
97 String get name => 'none'; | 99 String get name => 'none'; |
98 List<String> get extraRequiredLibraries => <String>[]; | 100 List<String> get extraRequiredLibraries => <String>[]; |
99 void performModularTransformations(CoreTypes coreTypes, Program program) {} | 101 void performModularTransformations( |
| 102 CoreTypes coreTypes, ClassHierarchy hierarchy, Program program) {} |
100 void performGlobalTransformations(CoreTypes coreTypes, Program program) {} | 103 void performGlobalTransformations(CoreTypes coreTypes, Program program) {} |
101 | 104 |
102 @override | 105 @override |
103 Expression instantiateInvocation(Member target, Expression receiver, | 106 Expression instantiateInvocation(Member target, Expression receiver, |
104 String name, Arguments arguments, int offset, bool isSuper) { | 107 String name, Arguments arguments, int offset, bool isSuper) { |
105 return new InvalidExpression(); | 108 return new InvalidExpression(); |
106 } | 109 } |
107 } | 110 } |
OLD | NEW |