Index: src/compiler/ast-graph-builder.cc |
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc |
index b1ad32f0dae9fcd7d27563a9e6636bf5afd1f1b3..b92457da1a7094ee247aa922f6c129920e989a77 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,11 @@ 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. |
+ // We also have a stack overflow if the recursive compilation did. |
Michael Starzinger
2015/06/19 11:17:08
nit: Unrelated to your change, but can we just dro
|
+ 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; |