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

Unified Diff: src/ast/ast-numbering.cc

Issue 2618553004: [compiler] Collect eager inner functions for compilation during renumbering. (Closed)
Patch Set: Remove unused variable Created 3 years, 11 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
Index: src/ast/ast-numbering.cc
diff --git a/src/ast/ast-numbering.cc b/src/ast/ast-numbering.cc
index 07d60cf84ab6fd5085b861834a4eb48c6ff149ed..ab375b4ffee83662723dfcad352954850b2774bf 100644
--- a/src/ast/ast-numbering.cc
+++ b/src/ast/ast-numbering.cc
@@ -6,15 +6,18 @@
#include "src/ast/ast.h"
#include "src/ast/scopes.h"
+#include "src/zone/zone-containers.h"
namespace v8 {
namespace internal {
class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
public:
- AstNumberingVisitor(Isolate* isolate, Zone* zone)
+ AstNumberingVisitor(Isolate* isolate, Zone* zone,
+ ZoneVector<FunctionLiteral*>* eager_inner_functions)
: isolate_(isolate),
zone_(zone),
+ eager_inner_functions_(eager_inner_functions),
next_id_(BailoutId::FirstUsable().ToInt()),
yield_count_(0),
properties_(zone),
@@ -71,6 +74,7 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
Isolate* isolate_;
Zone* zone_;
+ ZoneVector<FunctionLiteral*>* eager_inner_functions_;
int next_id_;
int yield_count_;
AstProperties properties_;
@@ -593,6 +597,7 @@ void AstNumberingVisitor::VisitArguments(ZoneList<Expression*>* arguments) {
void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) {
IncrementNodeCount();
node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids()));
+ if (node->ShouldEagerCompile()) eager_inner_functions_->push_back(node);
// We don't recurse into the declarations or body of the function literal:
// you have to separately Renumber() each FunctionLiteral that you compile.
}
@@ -648,10 +653,10 @@ bool AstNumberingVisitor::Renumber(FunctionLiteral* node) {
return !HasStackOverflow();
}
-
-bool AstNumbering::Renumber(Isolate* isolate, Zone* zone,
- FunctionLiteral* function) {
- AstNumberingVisitor visitor(isolate, zone);
+bool AstNumbering::Renumber(
+ Isolate* isolate, Zone* zone, FunctionLiteral* function,
+ ZoneVector<FunctionLiteral*>* eager_inner_functions) {
+ AstNumberingVisitor visitor(isolate, zone, eager_inner_functions);
return visitor.Renumber(function);
}
} // namespace internal

Powered by Google App Engine
This is Rietveld 408576698