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

Unified Diff: src/ast-numbering.cc

Issue 775693003: Move more don't-crankshaft computation to numbering pass (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast-numbering.cc
diff --git a/src/ast-numbering.cc b/src/ast-numbering.cc
index e9b9050ae7d0caec6cb018e0e11b54e94fbd1b1b..c2dd70e1bbe75086a0de3e9097aac6d2b3dc49c1 100644
--- a/src/ast-numbering.cc
+++ b/src/ast-numbering.cc
@@ -23,7 +23,7 @@ class AstNumberingVisitor FINAL : public AstVisitor {
InitializeAstVisitor(zone);
}
- void Renumber(FunctionLiteral* node);
+ bool Renumber(FunctionLiteral* node);
private:
// AST node visitor interface.
@@ -31,6 +31,8 @@ class AstNumberingVisitor FINAL : public AstVisitor {
AST_NODE_LIST(DEFINE_VISIT)
#undef DEFINE_VISIT
+ bool Finish(FunctionLiteral* node);
+
void VisitStatements(ZoneList<Statement*>* statements) OVERRIDE;
void VisitDeclarations(ZoneList<Declaration*>* declarations) OVERRIDE;
void VisitArguments(ZoneList<Expression*>* arguments);
@@ -537,14 +539,26 @@ void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) {
}
-void AstNumberingVisitor::Renumber(FunctionLiteral* node) {
- if (node->scope()->HasIllegalRedeclaration()) {
- node->scope()->VisitIllegalRedeclaration(this);
- node->set_ast_properties(&properties_);
- return;
- }
+bool AstNumberingVisitor::Finish(FunctionLiteral* node) {
+ node->set_ast_properties(&properties_);
+ node->set_dont_optimize_reason(dont_optimize_reason());
+ return !HasStackOverflow();
+}
+
+bool AstNumberingVisitor::Renumber(FunctionLiteral* node) {
Scope* scope = node->scope();
+
+ if (scope->HasIllegalRedeclaration()) {
+ scope->VisitIllegalRedeclaration(this);
+ DisableCrankshaft(kFunctionWithIllegalRedeclaration);
+ return Finish(node);
+ }
+ if (scope->calls_eval()) DisableCrankshaft(kFunctionCallsEval);
+ if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) {
+ DisableCrankshaft(kContextAllocatedArguments);
+ }
+
VisitDeclarations(scope->declarations());
if (scope->is_function_scope() && scope->function() != NULL) {
// Visit the name of the named function expression.
@@ -552,15 +566,13 @@ void AstNumberingVisitor::Renumber(FunctionLiteral* node) {
}
VisitStatements(node->body());
- node->set_ast_properties(&properties_);
- node->set_dont_optimize_reason(dont_optimize_reason());
+ return Finish(node);
}
bool AstNumbering::Renumber(FunctionLiteral* function, Zone* zone) {
AstNumberingVisitor visitor(zone);
- visitor.Renumber(function);
- return !visitor.HasStackOverflow();
+ return visitor.Renumber(function);
}
}
} // namespace v8::internal
« no previous file with comments | « no previous file | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698