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

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

Issue 2618553004: [compiler] Collect eager inner functions for compilation during renumbering. (Closed)
Patch Set: Address comments and remove field from ParseInfo 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
« no previous file with comments | « src/ast/ast-numbering.h ('k') | src/bit-vector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast-numbering.cc
diff --git a/src/ast/ast-numbering.cc b/src/ast/ast-numbering.cc
index 64e280a7bdf14033d3e5985fd5d474203b477774..4fb26d5f7fc3270b96bdd0dcb3618212fa5c0c9e 100644
--- a/src/ast/ast-numbering.cc
+++ b/src/ast/ast-numbering.cc
@@ -6,6 +6,7 @@
#include "src/ast/ast.h"
#include "src/ast/scopes.h"
+#include "src/compiler.h"
#include "src/objects-inl.h"
namespace v8 {
@@ -13,9 +14,11 @@ namespace internal {
class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
public:
- AstNumberingVisitor(Isolate* isolate, Zone* zone)
+ AstNumberingVisitor(Isolate* isolate, Zone* zone,
+ Compiler::EagerInnerFunctionLiterals* eager_literals)
: isolate_(isolate),
zone_(zone),
+ eager_literals_(eager_literals),
next_id_(BailoutId::FirstUsable().ToInt()),
yield_count_(0),
properties_(zone),
@@ -70,8 +73,11 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
BailoutReason dont_optimize_reason() const { return dont_optimize_reason_; }
+ Zone* zone() const { return zone_; }
+
Isolate* isolate_;
Zone* zone_;
+ Compiler::EagerInnerFunctionLiterals* eager_literals_;
int next_id_;
int yield_count_;
AstProperties properties_;
@@ -595,6 +601,10 @@ void AstNumberingVisitor::VisitArguments(ZoneList<Expression*>* arguments) {
void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) {
IncrementNodeCount();
node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids()));
+ if (eager_literals_ && node->ShouldEagerCompile()) {
+ eager_literals_->Add(new (zone())
+ ThreadedListZoneEntry<FunctionLiteral*>(node));
+ }
// We don't recurse into the declarations or body of the function literal:
// you have to separately Renumber() each FunctionLiteral that you compile.
ReserveFeedbackSlots(node);
@@ -651,10 +661,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,
+ Compiler::EagerInnerFunctionLiterals* eager_literals) {
+ AstNumberingVisitor visitor(isolate, zone, eager_literals);
return visitor.Renumber(function);
}
} // namespace internal
« no previous file with comments | « src/ast/ast-numbering.h ('k') | src/bit-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698