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

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

Issue 1183733006: Keep a canonical list of shared function infos. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: serializer tweak 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') | src/objects.h » ('J')
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 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;
« no previous file with comments | « src/compiler.cc ('k') | src/debug.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698