Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Unified Diff: pkg/kernel/lib/target/vmreify.dart

Issue 2697873007: Merge the work on Generic Types Reification from 'dart-lang/reify' repo (Closed)
Patch Set: Get back parameter erroneously removed by previous commit Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/kernel/lib/target/vm.dart ('k') | pkg/kernel/lib/transformations/generic_types_reification.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/target/vmreify.dart
diff --git a/pkg/kernel/lib/target/vmreify.dart b/pkg/kernel/lib/target/vmreify.dart
new file mode 100644
index 0000000000000000000000000000000000000000..db2c63ea02e1bafc2c1e127b9049a02199a391e4
--- /dev/null
+++ b/pkg/kernel/lib/target/vmreify.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+library kernel.target.vmreify;
+
+import '../ast.dart' show Program;
+import '../transformations/generic_types_reification.dart' as reify
+ show transformProgram;
+
+import 'targets.dart' show TargetFlags;
+import 'vmcc.dart' as vmcc_target;
+
+/// Specializes the kernel IR to the Dart VM with reified generic types.
+class VmGenericTypesReifiedTarget extends vmcc_target.VmClosureConvertedTarget {
+ VmGenericTypesReifiedTarget(TargetFlags flags) : super(flags);
+
+ @override
+ String get name => "vmreify";
+
+ // This is the order that bootstrap libraries are loaded according to
+ // `runtime/vm/object_store.h`.
+ List<String> get extraRequiredLibraries {
+ return new List<String>.from(super.extraRequiredLibraries)
+ ..add("${flags.kernelRuntime.resolve('reify/types.dart')}")
+ ..add("${flags.kernelRuntime.resolve('reify/declarations.dart')}")
+ ..add("${flags.kernelRuntime.resolve('reify/interceptors.dart')}");
+ }
+
+ @override
+ void performGlobalTransformations(Program program) {
+ super.performGlobalTransformations(program);
+ // TODO(dmitryas) this transformation should be made modular
+ reify.transformProgram(program);
+ }
+
+ // Disable tree shaking for Generic Types Reification. There are some runtime
+ // libraries that are required for the transformation and are shaken off,
+ // because they aren't invoked from the program being transformed prior to
+ // the transformation.
+ // TODO(dmitryas): remove this when the libraries are in dart:_internal
+ @override
+ void performTreeShaking(Program program) {}
+}
« no previous file with comments | « pkg/kernel/lib/target/vm.dart ('k') | pkg/kernel/lib/transformations/generic_types_reification.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698