OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 library kernel.target.vmreify; |
| 5 |
| 6 import '../ast.dart' show Program; |
| 7 import '../transformations/generic_types_reification.dart' as reify |
| 8 show transformProgram; |
| 9 |
| 10 import 'targets.dart' show TargetFlags; |
| 11 import 'vmcc.dart' as vmcc_target; |
| 12 |
| 13 /// Specializes the kernel IR to the Dart VM with reified generic types. |
| 14 class VmGenericTypesReifiedTarget extends vmcc_target.VmClosureConvertedTarget { |
| 15 VmGenericTypesReifiedTarget(TargetFlags flags) : super(flags); |
| 16 |
| 17 @override |
| 18 String get name => "vmreify"; |
| 19 |
| 20 // This is the order that bootstrap libraries are loaded according to |
| 21 // `runtime/vm/object_store.h`. |
| 22 List<String> get extraRequiredLibraries { |
| 23 return new List<String>.from(super.extraRequiredLibraries) |
| 24 ..add("${flags.kernelRuntime.resolve('reify/types.dart')}") |
| 25 ..add("${flags.kernelRuntime.resolve('reify/declarations.dart')}") |
| 26 ..add("${flags.kernelRuntime.resolve('reify/interceptors.dart')}"); |
| 27 } |
| 28 |
| 29 @override |
| 30 void performGlobalTransformations(Program program) { |
| 31 super.performGlobalTransformations(program); |
| 32 // TODO(dmitryas) this transformation should be made modular |
| 33 reify.transformProgram(program); |
| 34 } |
| 35 |
| 36 // Disable tree shaking for Generic Types Reification. There are some runtime |
| 37 // libraries that are required for the transformation and are shaken off, |
| 38 // because they aren't invoked from the program being transformed prior to |
| 39 // the transformation. |
| 40 // TODO(dmitryas): remove this when the libraries are in dart:_internal |
| 41 @override |
| 42 void performTreeShaking(Program program) {} |
| 43 } |
OLD | NEW |