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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 1409523003: Trace through const objects instead of spying on flow graph construction to find closure functions.… (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/flow_graph_compiler.cc » ('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 ea31f9653e4c77fce2329fbcef353c204a2d29d2..70babe667efe369f130dcb8b3452834c4ccace07 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -38,8 +38,6 @@ DEFINE_FLAG(bool, print_scopes, false, "Print scopes of local variables.");
DEFINE_FLAG(bool, support_debugger, true, "Emit code needed for debugging");
DEFINE_FLAG(bool, trace_type_check_elimination, false,
"Trace type check elimination at compile time.");
-DEFINE_FLAG(bool, precompile_collect_closures, false,
- "Collect all closure functions referenced from compiled code.");
DECLARE_FLAG(int, optimization_counter_threshold);
DECLARE_FLAG(bool, profile_vm);
@@ -2525,37 +2523,15 @@ void EffectGraphVisitor::VisitStringInterpolateNode(
}
-// TODO(rmacnak): De-dup closures in inlined-finally and track down other
-// stragglers to use Class::closures instead.
-static void CollectClosureFunction(const Function& function) {
- if (function.HasCode()) return;
-
- // Although this is only called when precompiling, this can happen before
- // Dart_Precompile as part of loading code, so check for a non-null work
- // list.
- Thread* thread = Thread::Current();
- Isolate* isolate = thread->isolate();
- if (isolate->collected_closures() != GrowableObjectArray::null()) {
- const GrowableObjectArray& functions =
- GrowableObjectArray::Handle(thread->zone(),
- isolate->collected_closures());
- functions.Add(function);
- }
-}
-
-
void EffectGraphVisitor::VisitClosureNode(ClosureNode* node) {
const Function& function = node->function();
- if (FLAG_precompile_collect_closures) {
- CollectClosureFunction(function);
- }
-
if (function.IsImplicitStaticClosureFunction()) {
const Instance& closure =
Instance::ZoneHandle(Z, function.ImplicitStaticClosure());
ReturnDefinition(new(Z) ConstantInstr(closure));
return;
}
+
const bool is_implicit = function.IsImplicitInstanceClosureFunction();
ASSERT(is_implicit || function.IsNonImplicitClosureFunction());
// The context scope may have already been set by the non-optimizing
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698