From: fschneider@chromium.org Date: Mon, 29 Aug 2011 10:50:47 +0000 (+0000) Subject: Introduce support for local function declarations in Hydrogen. X-Git-Tag: upstream/4.7.83~18630 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ab5b50f1b18a1af6a107611e58d62ed4aea17d3;p=platform%2Fupstream%2Fv8.git Introduce support for local function declarations in Hydrogen. Review URL: http://codereview.chromium.org/7782001 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9047 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/hydrogen.cc b/src/hydrogen.cc index dd3a591d6..012e8b8aa 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -5804,13 +5804,17 @@ void HGraphBuilder::VisitThisFunction(ThisFunction* expr) { 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); } }