Chromium Code Reviews| 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); | |
|
karlklose
2017/02/17 12:35:19
Please add a TODO here that we should make this a
Dmitry Stefantsov
2017/02/17 13:10:34
Done.
| |
| 32 reify.transformProgram(program); | |
| 33 } | |
| 34 | |
| 35 // Disable tree shaking for Generic Types Reification. There are some runtime | |
| 36 // libraries that are required for the transformation and are shaken off, | |
| 37 // because they aren't invoked from the program being transformed prior to | |
| 38 // the transformation. | |
| 39 // TODO(dmitryas): remove this when the libraries are in dart:_internal | |
| 40 @override | |
| 41 void performTreeShaking(Program program) {} | |
| 42 } | |
| OLD | NEW |