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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 11359151: Fix for issue 6623 - Canonicalize implicit static closure objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/intermediate_language.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
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 14794)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1483,6 +1483,18 @@
void EffectGraphVisitor::VisitClosureNode(ClosureNode* node) {
const Function& function = node->function();
+ if (function.IsImplicitStaticClosureFunction()) {
+ Instance& closure = Instance::ZoneHandle();
+ closure ^= function.implicit_static_closure();
+ if (closure.IsNull()) {
+ ObjectStore* object_store = Isolate::Current()->object_store();
+ const Context& context = Context::Handle(object_store->empty_context());
+ closure ^= Closure::New(function, context, Heap::kOld);
+ function.set_implicit_static_closure(closure);
+ }
+ ReturnDefinition(new ConstantInstr(closure));
+ return;
+ }
Value* receiver = NULL;
if (function.IsNonImplicitClosureFunction()) {
// The context scope may have already been set by the non-optimizing
@@ -1496,13 +1508,12 @@
function.set_context_scope(context_scope);
}
receiver = BuildNullValue();
- } else if (function.IsImplicitInstanceClosureFunction()) {
+ } else {
+ ASSERT(function.IsImplicitInstanceClosureFunction());
ValueGraphVisitor for_receiver(owner(), temp_index(), loop_depth());
node->receiver()->Visit(&for_receiver);
Append(for_receiver);
receiver = for_receiver.value();
- } else {
- receiver = BuildNullValue();
}
PushArgumentInstr* push_receiver = PushArgument(receiver);
ZoneGrowableArray<PushArgumentInstr*>* arguments =
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698