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

Unified Diff: runtime/vm/parser.cc

Issue 8234016: Inline allocation of implicit closures. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 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
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 348)
+++ runtime/vm/parser.cc (working copy)
@@ -1074,7 +1074,7 @@
Function& implicit_closure_function =
Function::ZoneHandle(func.ImplicitClosureFunction());
ASSERT(!implicit_closure_function.IsNull());
- ASSERT(implicit_closure_function.is_static()); // TODO(regis): For now.
+ ASSERT(func.is_static() == implicit_closure_function.is_static());
AstNode* node;
if (receiver == NULL) {
ASSERT(func.is_static());
@@ -1420,7 +1420,8 @@
// The first parameter of a factory is the TypeArguments vector of the type
// of the instance to be allocated. We name this hidden parameter 'this'.
const bool has_receiver =
- !func.is_static() || func.IsConstructor() || func.IsFactory();
+ !func.IsClosureFunction() &&
siva 2011/10/11 21:00:46 Maybe we should append to the comment as to why fu
regis 2011/10/11 23:40:19 I added a comment. I prefer that is_static() refle
+ (!func.is_static() || func.IsConstructor() || func.IsFactory());
const bool are_implicitly_final = func.is_const() && func.IsConstructor();
const bool allow_explicit_default_values = true;
ASSERT(CurrentToken() == Token::kLPAREN);

Powered by Google App Engine
This is Rietveld 408576698