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.flutter; | 4 library kernel.target.flutter; |
5 | 5 |
6 import '../ast.dart'; | 6 import '../ast.dart'; |
7 import '../class_hierarchy.dart'; | 7 import '../class_hierarchy.dart'; |
8 import '../core_types.dart'; | 8 import '../core_types.dart'; |
9 import '../transformations/continuation.dart' as cont; | 9 import '../transformations/continuation.dart' as cont; |
10 import '../transformations/erasure.dart'; | 10 import '../transformations/erasure.dart'; |
11 import '../transformations/mixin_full_resolution.dart' as mix; | 11 import '../transformations/mixin_full_resolution.dart' as mix; |
12 import '../transformations/sanitize_for_vm.dart'; | 12 import '../transformations/sanitize_for_vm.dart'; |
13 import '../transformations/setup_builtin_library.dart' as setup_builtin_library; | |
14 import 'targets.dart'; | 13 import 'targets.dart'; |
15 | 14 |
16 class FlutterTarget extends Target { | 15 class FlutterTarget extends Target { |
17 final TargetFlags flags; | 16 final TargetFlags flags; |
18 | 17 |
19 FlutterTarget(this.flags); | 18 FlutterTarget(this.flags); |
20 | 19 |
21 bool get strongMode => flags.strongMode; | 20 bool get strongMode => flags.strongMode; |
22 | 21 |
23 bool get strongModeSdk => false; | 22 bool get strongModeSdk => false; |
(...skipping 10 matching lines...) Expand all Loading... |
34 'dart:_internal', | 33 'dart:_internal', |
35 'dart:isolate', | 34 'dart:isolate', |
36 'dart:math', | 35 'dart:math', |
37 | 36 |
38 // The library dart:mirrors may be ignored by the VM, e.g. when built in | 37 // The library dart:mirrors may be ignored by the VM, e.g. when built in |
39 // PRODUCT mode. | 38 // PRODUCT mode. |
40 'dart:mirrors', | 39 'dart:mirrors', |
41 | 40 |
42 'dart:profiler', | 41 'dart:profiler', |
43 'dart:typed_data', | 42 'dart:typed_data', |
44 'dart:_vmservice', | |
45 'dart:_builtin', | |
46 'dart:nativewrappers', | 43 'dart:nativewrappers', |
47 'dart:io', | 44 'dart:io', |
48 | 45 |
49 // Required for flutter. | 46 // Required for flutter. |
50 'dart:ui', | 47 'dart:ui', |
51 'dart:vmservice_sky', | |
52 ]; | 48 ]; |
53 | 49 |
54 void performModularTransformationsOnLibraries( | 50 void performModularTransformationsOnLibraries( |
55 CoreTypes coreTypes, ClassHierarchy hierarchy, List<Library> libraries, | 51 CoreTypes coreTypes, ClassHierarchy hierarchy, List<Library> libraries, |
56 {void logger(String msg)}) { | 52 {void logger(String msg)}) { |
57 mix.transformLibraries(this, coreTypes, hierarchy, libraries); | 53 mix.transformLibraries(this, coreTypes, hierarchy, libraries); |
58 } | 54 } |
59 | 55 |
60 void performGlobalTransformations(CoreTypes coreTypes, Program program, | 56 void performGlobalTransformations(CoreTypes coreTypes, Program program, |
61 {void logger(String msg)}) { | 57 {void logger(String msg)}) { |
62 cont.transformProgram(coreTypes, program); | 58 cont.transformProgram(coreTypes, program); |
63 | 59 |
64 // Repair `_getMainClosure()` function in dart:{_builtin,ui} libraries. | |
65 setup_builtin_library.transformProgram(program); | |
66 setup_builtin_library.transformProgram(program, libraryUri: 'dart:ui'); | |
67 | |
68 if (strongMode) { | 60 if (strongMode) { |
69 new Erasure().transform(program); | 61 new Erasure().transform(program); |
70 } | 62 } |
71 | 63 |
72 new SanitizeForVM().transform(program); | 64 new SanitizeForVM().transform(program); |
73 } | 65 } |
74 | 66 |
75 @override | 67 @override |
76 Expression instantiateInvocation(CoreTypes coreTypes, Expression receiver, | 68 Expression instantiateInvocation(CoreTypes coreTypes, Expression receiver, |
77 String name, Arguments arguments, int offset, bool isSuper) { | 69 String name, Arguments arguments, int offset, bool isSuper) { |
(...skipping 11 matching lines...) Expand all Loading... |
89 bool isLocalVariable: false, | 81 bool isLocalVariable: false, |
90 bool isDynamic: false, | 82 bool isDynamic: false, |
91 bool isSuper: false, | 83 bool isSuper: false, |
92 bool isStatic: false, | 84 bool isStatic: false, |
93 bool isConstructor: false, | 85 bool isConstructor: false, |
94 bool isTopLevel: false}) { | 86 bool isTopLevel: false}) { |
95 // TODO(ahe): This should probably return the same as VmTarget does. | 87 // TODO(ahe): This should probably return the same as VmTarget does. |
96 return new InvalidExpression(); | 88 return new InvalidExpression(); |
97 } | 89 } |
98 } | 90 } |
OLD | NEW |