Chromium Code Reviews| Index: src/hydrogen.cc |
| =================================================================== |
| --- src/hydrogen.cc (revision 9062) |
| +++ src/hydrogen.cc (working copy) |
| @@ -2273,10 +2273,6 @@ |
| return NULL; |
| } |
| SetupScope(scope); |
| - VisitDeclarations(scope->declarations()); |
| - HValue* context = environment()->LookupContext(); |
| - AddInstruction( |
| - new(zone()) HStackCheck(context, HStackCheck::kFunctionEntry)); |
| // Add an edge to the body entry. This is warty: the graph's start |
| // environment will be used by the Lithium translation as the initial |
| @@ -2298,6 +2294,14 @@ |
| current_block()->Goto(body_entry); |
| body_entry->SetJoinId(AstNode::kFunctionEntryId); |
| set_current_block(body_entry); |
| + |
| + VisitDeclarations(scope->declarations()); |
|
Kevin Millikin (Chromium)
2011/08/31 11:44:27
There's an implicit declaration of the function na
fschneider
2011/08/31 12:09:40
Done.
|
| + AddSimulate(AstNode::kDeclarationsId); |
| + |
| + HValue* context = environment()->LookupContext(); |
| + AddInstruction( |
| + new(zone()) HStackCheck(context, HStackCheck::kFunctionEntry)); |
| + |
| VisitStatements(info()->function()->body()); |
| if (HasStackOverflow()) return NULL; |
| @@ -5804,13 +5808,17 @@ |
| void HGraphBuilder::VisitDeclaration(Declaration* decl) { |
| // We support only declarations that do not require code generation. |
| Variable* var = decl->proxy()->var(); |
| - if (!var->IsStackAllocated() || decl->fun() != NULL) { |
| + if (!var->IsStackAllocated()) { |
| return Bailout("unsupported declaration"); |
| } |
| if (decl->mode() == Variable::CONST) { |
| ASSERT(var->IsStackAllocated()); |
| environment()->Bind(var, graph()->GetConstantHole()); |
| + } else if (decl->fun() != NULL) { |
| + VisitForValue(decl->fun()); |
| + HValue* function = Pop(); |
| + environment()->Bind(var, function); |
| } |
| } |