Index: runtime/vm/precompiler.cc |
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc |
index a02c459a26c59e353434ec30b8d9c4899b02ded9..2f876e09dffec936f0220d4f43b4cd304f284ffc 100644 |
--- a/runtime/vm/precompiler.cc |
+++ b/runtime/vm/precompiler.cc |
@@ -590,6 +590,15 @@ void Precompiler::AddTypesOf(const Function& function) { |
} |
} |
} |
+ // A function can always be inlined and have only a nested local function |
+ // remain. |
+ const Function& parent = Function::Handle(Z, function.parent_function()); |
+ if (!parent.IsNull()) { |
+ AddTypesOf(parent); |
+ } |
+ // A class may have all functions inlined except a local function. |
+ const Class& owner = Class::Handle(Z, function.Owner()); |
+ AddTypesOf(owner); |
} |
@@ -623,6 +632,13 @@ void Precompiler::AddType(const AbstractType& abstype) { |
AbstractType& type = AbstractType::Handle(Z); |
type = TypeRef::Cast(abstype).type(); |
AddType(type); |
+ } else if (abstype.IsTypeParameter()) { |
+ const AbstractType& type = |
+ AbstractType::Handle(Z, TypeParameter::Cast(abstype).bound()); |
+ AddType(type); |
+ const Class& cls = |
+ Class::Handle(Z, TypeParameter::Cast(abstype).parameterized_class()); |
+ AddTypesOf(cls); |
} |
} |