| Index: src/ast/ast.h
|
| diff --git a/src/ast/ast.h b/src/ast/ast.h
|
| index eaacf4b3cfade077490acfa553c92e708ad392b8..5c200c4da6c8e9317c404d8fa2ad183e18bd5aba 100644
|
| --- a/src/ast/ast.h
|
| +++ b/src/ast/ast.h
|
| @@ -924,6 +924,11 @@ class ForOfStatement final : public ForEachStatement {
|
| return assign_each_;
|
| }
|
|
|
| + void set_assign_iterator(Expression* e) { assign_iterator_ = e; }
|
| + void set_next_result(Expression* e) { next_result_ = e; }
|
| + void set_result_done(Expression* e) { result_done_ = e; }
|
| + void set_assign_each(Expression* e) { assign_each_ = e; }
|
| +
|
| BailoutId ContinueId() const override { return EntryId(); }
|
| BailoutId StackCheckId() const override { return BackEdgeId(); }
|
|
|
| @@ -1682,6 +1687,19 @@ class ArrayLiteral final : public MaterializedLiteral {
|
| return flags;
|
| }
|
|
|
| + // Provide a mechanism for iterating through values to rewrite spreads.
|
| + ZoneList<Expression*>::iterator FirstSpread() const {
|
| + return (first_spread_index_ >= 0) ? values_->begin() + first_spread_index_
|
| + : values_->end();
|
| + }
|
| + ZoneList<Expression*>::iterator EndValue() const { return values_->end(); }
|
| +
|
| + // Rewind an array literal omitting everything from the first spread on.
|
| + void RewindSpreads() {
|
| + values_->Rewind(first_spread_index_);
|
| + first_spread_index_ = -1;
|
| + }
|
| +
|
| enum Flags {
|
| kNoFlags = 0,
|
| kShallowElements = 1,
|
| @@ -3385,8 +3403,9 @@ class AstVisitor BASE_EMBEDDED {
|
| public: \
|
| AstNode* Rewrite(AstNode* node) { \
|
| DCHECK_NULL(replacement_); \
|
| + DCHECK_NOT_NULL(node); \
|
| Visit(node); \
|
| - if (HasStackOverflow()) return nullptr; \
|
| + if (HasStackOverflow()) return node; \
|
| if (replacement_ == nullptr) return node; \
|
| AstNode* result = replacement_; \
|
| replacement_ = nullptr; \
|
|
|