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

Unified Diff: runtime/vm/class_finalizer.cc

Issue 1517153004: Introduce experimental flag --reify in the vm. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: update after source fingerprints are made insensitive to types Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_finalizer.cc
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 10c5db2cfc250eb76b98fd2617c83d20dd4b8dc6..d1e9f5b993a330ec176962debe51e4a246c4fd55 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -16,6 +16,7 @@
namespace dart {
DEFINE_FLAG(bool, print_classes, false, "Prints details about loaded classes.");
+DEFINE_FLAG(bool, reify, true, "Reify type arguments of generic types.");
DEFINE_FLAG(bool, trace_class_finalization, false, "Trace class finalization.");
DEFINE_FLAG(bool, trace_type_finalization, false, "Trace type finalization.");
@@ -670,6 +671,11 @@ intptr_t ClassFinalizer::ExpandAndFinalizeTypeArguments(
// The class has num_type_parameters type parameters.
const intptr_t num_type_parameters = type_class.NumTypeParameters();
+ // If we are not reifying types, drop type arguments.
+ if (!FLAG_reify) {
+ type.set_arguments(TypeArguments::Handle(Z, TypeArguments::null()));
+ }
+
// Initialize the type argument vector.
// Check the number of parsed type arguments, if any.
// Specifying no type arguments indicates a raw type, which is not an error.
@@ -699,7 +705,7 @@ intptr_t ClassFinalizer::ExpandAndFinalizeTypeArguments(
// super types of type_class, which are initialized from the parsed
// type arguments, followed by the parsed type arguments.
TypeArguments& full_arguments = TypeArguments::Handle(Z);
- if (num_type_arguments > 0) {
+ if (FLAG_reify && (num_type_arguments > 0)) {
// If no type arguments were parsed and if the super types do not prepend
// type arguments to the vector, we can leave the vector as null.
if (!arguments.IsNull() || (num_type_arguments > num_type_parameters)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698