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

Unified Diff: runtime/vm/parser.cc

Issue 882323004: VM: Share closure-call dispatchers. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 43291)
+++ runtime/vm/parser.cc (working copy)
@@ -1432,11 +1432,14 @@
ArgumentListNode* no_args = new ArgumentListNode(token_pos);
LoadLocalNode* receiver = new LoadLocalNode(token_pos, scope->VariableAt(0));
+ const Class& function_impl = Class::Handle(Type::Handle(
+ Isolate::Current()->object_store()->function_impl_type()).type_class());
+
const Class& owner = Class::Handle(Z, func.Owner());
ASSERT(!owner.IsNull());
const String& name = String::Handle(Z, func.name());
AstNode* function_object = NULL;
- if (owner.IsSignatureClass() && name.Equals(Symbols::Call())) {
+ if (owner.raw() == function_impl.raw() && name.Equals(Symbols::Call())) {
function_object = receiver;
} else {
const String& getter_name = String::ZoneHandle(Z,
@@ -1463,7 +1466,7 @@
args->set_names(names);
AstNode* result = NULL;
- if (owner.IsSignatureClass() && name.Equals(Symbols::Call())) {
+ if (owner.raw() == function_impl.raw() && name.Equals(Symbols::Call())) {
result = new ClosureCallNode(token_pos, function_object, args);
} else {
result = BuildClosureCall(token_pos, function_object, args);

Powered by Google App Engine
This is Rietveld 408576698