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

Unified Diff: runtime/vm/precompiler.cc

Issue 2829933002: Trace signature types in the tree shaker. (Closed)
Patch Set: . Created 3 years, 8 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 | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/precompiler.cc
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc
index f7b46ed0a6d64fc531b86d3f467ea78c10f60023..97166ee892ef96e6633765cb1dcc4622b00eaf3b 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -1006,9 +1006,10 @@ void Precompiler::AddTypesOf(const Class& cls) {
void Precompiler::AddTypesOf(const Function& function) {
if (function.IsNull()) return;
- // We don't expect to see a reference to a redicting factory.
- ASSERT(!function.IsRedirectingFactory());
if (functions_to_retain_.HasKey(&function)) return;
+ // We don't expect to see a reference to a redirecting factory. Only its
+ // target should remain.
+ ASSERT(!function.IsRedirectingFactory());
functions_to_retain_.Insert(&Function::ZoneHandle(Z, function.raw()));
AbstractType& type = AbstractType::Handle(Z);
@@ -1041,6 +1042,12 @@ void Precompiler::AddTypesOf(const Function& function) {
if (!parent.IsNull()) {
AddTypesOf(parent);
}
+ if (function.IsSignatureFunction() || function.IsClosureFunction()) {
+ type = function.ExistingSignatureType();
+ if (!type.IsNull()) {
+ AddType(type);
+ }
+ }
// A class may have all functions inlined except a local function.
const Class& owner = Class::Handle(Z, function.Owner());
AddTypesOf(owner);
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698