Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 1211453002: Reland "Keep a canonical list of shared function infos." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix alwaysopt Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 1147f85a6377c5978b39a5701438d789779b1aab..4de9a6434d1e6f5adaa983ca663c9fd4c098ef19 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::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());
@@ -1519,14 +1519,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;
« no previous file with comments | « src/compiler.cc ('k') | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698