Index: src/compiler/ast-graph-builder.cc |
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc |
index 4de9a6434d1e6f5adaa983ca663c9fd4c098ef19..1147f85a6377c5978b39a5701438d789779b1aab 100644 |
--- a/src/compiler/ast-graph-builder.cc |
+++ b/src/compiler/ast-graph-builder.cc |
@@ -1095,8 +1095,8 @@ void AstGraphBuilder::VisitFunctionDeclaration(FunctionDeclaration* decl) { |
Variable* variable = decl->proxy()->var(); |
switch (variable->location()) { |
case Variable::UNALLOCATED: { |
- Handle<SharedFunctionInfo> function = Compiler::GetSharedFunctionInfo( |
- decl->fun(), info()->script(), info()); |
+ Handle<SharedFunctionInfo> function = |
+ Compiler::BuildFunctionInfo(decl->fun(), info()->script(), info()); |
// Check for stack-overflow exception. |
if (function.is_null()) return SetStackOverflow(); |
globals()->push_back(variable->name()); |
@@ -1519,10 +1519,14 @@ void AstGraphBuilder::VisitDebuggerStatement(DebuggerStatement* stmt) { |
void AstGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) { |
Node* context = current_context(); |
- // Find or build a shared function info. |
- Handle<SharedFunctionInfo> shared_info = |
- Compiler::GetSharedFunctionInfo(expr, info()->script(), info()); |
- CHECK(!shared_info.is_null()); // TODO(mstarzinger): Set stack overflow? |
+ // Build a new shared function info if we cannot find one in the baseline |
+ // code. We also have a stack overflow if the recursive compilation did. |
+ expr->InitializeSharedInfo(handle(info()->shared_info()->code())); |
+ Handle<SharedFunctionInfo> shared_info = expr->shared_info(); |
+ if (shared_info.is_null()) { |
+ shared_info = Compiler::BuildFunctionInfo(expr, info()->script(), info()); |
+ CHECK(!shared_info.is_null()); // TODO(mstarzinger): Set stack overflow? |
+ } |
// Create node to instantiate a new closure. |
PretenureFlag pretenure = expr->pretenure() ? TENURED : NOT_TENURED; |