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

Unified Diff: runtime/vm/precompiler.cc

Issue 2203843003: Tree-shaker: Use insertion in the work queue instead of "was compiled" as the criterion to retain a… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: . Created 4 years, 4 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/precompiler.cc
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc
index 6502f6570746f4c95267ceb68e50973fe83518dc..c9894285d7aa978a173fa767b965439d00babd2a 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -618,6 +618,7 @@ void Precompiler::ProcessFunction(const Function& function) {
ASSERT(function.HasCode());
AddCalleesOf(function);
+ AddTypesOf(function);
}
@@ -1383,7 +1384,7 @@ void Precompiler::TraceForRetainedFunctions() {
functions = cls.functions();
for (intptr_t j = 0; j < functions.Length(); j++) {
function ^= functions.At(j);
- bool retain = function.HasCode();
+ bool retain = functions_to_retain_.Lookup(&function) != NULL;
if (!retain && function.HasImplicitClosureFunction()) {
// It can happen that all uses of an implicit closure inline their
// target function, leaving the target function uncompiled. Keep
@@ -1394,7 +1395,6 @@ void Precompiler::TraceForRetainedFunctions() {
}
if (retain) {
function.DropUncompiledImplicitClosureFunction();
- AddTypesOf(function);
}
}
}
@@ -1403,10 +1403,8 @@ void Precompiler::TraceForRetainedFunctions() {
closures = isolate()->object_store()->closure_functions();
for (intptr_t j = 0; j < closures.Length(); j++) {
function ^= closures.At(j);
- bool retain = function.HasCode();
+ bool retain = functions_to_retain_.Lookup(&function) != NULL;
if (retain) {
- AddTypesOf(function);
-
cls = function.Owner();
AddTypesOf(cls);
« 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