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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10448079: Address review comments in commited cl (issue 10460002). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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/code_generator_ia32.cc ('k') | runtime/vm/il_printer.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 8143)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1308,6 +1308,7 @@
void EffectGraphVisitor::VisitClosureNode(ClosureNode* node) {
const Function& function = node->function();
+ Value* receiver = NULL;
if (function.IsNonImplicitClosureFunction()) {
// The context scope may have already been set by the non-optimizing
// compiler. If it was not, set it here.
@@ -1318,15 +1319,19 @@
ASSERT(function.context_scope() == ContextScope::null());
function.set_context_scope(context_scope);
}
+ receiver = BuildNullValue();
} else if (function.IsImplicitInstanceClosureFunction()) {
ValueGraphVisitor for_receiver(owner(), temp_index());
node->receiver()->Visit(&for_receiver);
Append(for_receiver);
+ receiver = for_receiver.value();
+ } else {
+ receiver = BuildNullValue();
}
ASSERT(function.context_scope() != ContextScope::null());
// The function type of a closure may have type arguments. In that case, pass
- // the type arguments of the instantiator.
+ // the type arguments of the instantiator. Otherwise, pass null object.
const Class& cls = Class::Handle(function.signature_class());
ASSERT(!cls.IsNull());
const bool requires_type_arguments = cls.HasTypeArguments();
@@ -1334,10 +1339,12 @@
if (requires_type_arguments) {
ASSERT(!function.IsImplicitStaticClosureFunction());
type_arguments = BuildInstantiatorTypeArguments(node->token_index(), NULL);
+ } else {
+ type_arguments = BuildNullValue();
}
- CreateClosureComp* create =
- new CreateClosureComp(node, owner()->try_index(), type_arguments);
+ CreateClosureComp* create = new CreateClosureComp(
+ node, owner()->try_index(), type_arguments, receiver);
ReturnComputation(create);
}
« no previous file with comments | « runtime/vm/code_generator_ia32.cc ('k') | runtime/vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698