Revision: 9047
Author: [email protected]
Date: Mon Aug 29 03:50:47 2011
Log: Introduce support for local function declarations in Hydrogen.
Review URL: http://codereview.chromium.org/7782001
http://code.google.com/p/v8/source/detail?r=9047
Modified:
/branches/bleeding_edge/src/hydrogen.cc
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Mon Aug 29 00:07:39 2011
+++ /branches/bleeding_edge/src/hydrogen.cc Mon Aug 29 03:50:47 2011
@@ -5804,13 +5804,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);
}
}
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev