Index: src/compiler/ast-graph-builder.cc |
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc |
index f967a9775a067a55a29b8862053095e14b2c2df8..0f302fc4cb20d28fb6d95897a909088e3fce32c7 100644 |
--- a/src/compiler/ast-graph-builder.cc |
+++ b/src/compiler/ast-graph-builder.cc |
@@ -1101,8 +1101,8 @@ void AstGraphBuilder::VisitFunctionDeclaration(FunctionDeclaration* decl) { |
Variable* variable = decl->proxy()->var(); |
switch (variable->location()) { |
case Variable::UNALLOCATED: { |
- Handle<SharedFunctionInfo> function = |
- Compiler::BuildFunctionInfo(decl->fun(), info()->script(), info()); |
+ Handle<SharedFunctionInfo> function = Compiler::GetSharedFunctionInfo( |
+ decl->fun(), info()->script(), info()); |
// Check for stack-overflow exception. |
if (function.is_null()) return SetStackOverflow(); |
globals()->push_back(variable->name()); |
@@ -1522,14 +1522,10 @@ void AstGraphBuilder::VisitDebuggerStatement(DebuggerStatement* stmt) { |
void AstGraphBuilder::VisitFunctionLiteral(FunctionLiteral* expr) { |
Node* context = current_context(); |
- // 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? |
- } |
+ // 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? |
// Create node to instantiate a new closure. |
PretenureFlag pretenure = expr->pretenure() ? TENURED : NOT_TENURED; |