Index: runtime/vm/precompiler.cc |
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc |
index fa650c4027686b2d821132965e1e3fd391263353..6c27c195592b824db7671d8cbd3db2a929d33954 100644 |
--- a/runtime/vm/precompiler.cc |
+++ b/runtime/vm/precompiler.cc |
@@ -964,6 +964,8 @@ void Precompiler::AddCalleesOf(const Function& function) { |
instance ^= entry.raw(); |
if (entry.IsAbstractType()) { |
AddType(AbstractType::Cast(entry)); |
+ } else if (entry.IsTypeArguments()) { |
+ AddTypeArguments(TypeArguments::Cast(entry)); |
} else { |
AddConstObject(instance); |
} |
@@ -977,8 +979,6 @@ void Precompiler::AddCalleesOf(const Function& function) { |
cls ^= target_code.owner(); |
AddInstantiatedClass(cls); |
} |
- } else if (entry.IsTypeArguments()) { |
- AddTypeArguments(TypeArguments::Cast(entry)); |
} |
} |
} |
@@ -1157,7 +1157,7 @@ void Precompiler::AddConstObject(const Instance& instance) { |
virtual void VisitPointers(RawObject** first, RawObject** last) { |
for (RawObject** current = first; current <= last; current++) { |
subinstance_ = *current; |
- if (subinstance_.IsInstance()) { |
+ if (subinstance_.IsInstance() && !subinstance_.IsTypeArguments()) { |
precompiler_->AddConstObject(Instance::Cast(subinstance_)); |
} |
} |