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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 1400193003: Don't assume at least one closure function is encountered before tree-shaking. Allow… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index da2caaadb36901bf66eba322f7d04cc64e55e28e..e514c2e6d08618d1d32039179cfd6e49ffa810bf 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -2531,13 +2531,11 @@ static void CollectClosureFunction(const Function& function) {
if (function.HasCode()) return;
Isolate* isolate = Isolate::Current();
- if (isolate->collected_closures() == GrowableObjectArray::null()) {
- isolate->set_collected_closures(
- GrowableObjectArray::Handle(GrowableObjectArray::New()));
+ if (isolate->collected_closures() != GrowableObjectArray::null()) {
srdjan 2015/10/13 21:30:12 Please add a comment why the check is necessary, e
rmacnak 2015/10/13 21:55:01 Done.
+ const GrowableObjectArray& functions =
+ GrowableObjectArray::Handle(isolate, isolate->collected_closures());
+ functions.Add(function);
}
- const GrowableObjectArray& functions =
- GrowableObjectArray::Handle(isolate, isolate->collected_closures());
- functions.Add(function);
}
« no previous file with comments | « no previous file | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698