| Index: src/ast/ast.h
|
| diff --git a/src/ast/ast.h b/src/ast/ast.h
|
| index d5fffda23912a01696b4cbf9615375764686e370..0c2fb90895f96fdd6854f497061162aa6e7153cb 100644
|
| --- a/src/ast/ast.h
|
| +++ b/src/ast/ast.h
|
| @@ -2973,8 +2973,11 @@ class EmptyParentheses final : public Expression {
|
| // (defined at https://tc39.github.io/ecma262/#sec-getiterator). Ignition
|
| // desugars this into a LoadIC / JSLoadNamed, CallIC, and a type-check to
|
| // validate return value of the Symbol.iterator() call.
|
| +enum class IteratorType { kNormal, kAsync };
|
| class GetIterator final : public Expression {
|
| public:
|
| + IteratorType hint() const { return hint_; }
|
| +
|
| Expression* iterable() const { return iterable_; }
|
| void set_iterable(Expression* iterable) { iterable_ = iterable; }
|
|
|
| @@ -2986,6 +2989,14 @@ class GetIterator final : public Expression {
|
| spec->AddSlot(FeedbackVectorSlotKind::LOAD_IC);
|
| iterator_call_feedback_slot_ =
|
| spec->AddSlot(FeedbackVectorSlotKind::CALL_IC);
|
| +
|
| + if (hint() == IteratorType::kAsync) {
|
| + // Can we just re-use the other slots?
|
| + async_iterator_property_feedback_slot_ =
|
| + spec->AddSlot(FeedbackVectorSlotKind::LOAD_IC);
|
| + async_iterator_call_feedback_slot_ =
|
| + spec->AddSlot(FeedbackVectorSlotKind::CALL_IC);
|
| + }
|
| }
|
|
|
| FeedbackVectorSlot IteratorPropertyFeedbackSlot() const {
|
| @@ -2996,15 +3007,26 @@ class GetIterator final : public Expression {
|
| return iterator_call_feedback_slot_;
|
| }
|
|
|
| + FeedbackVectorSlot AsyncIteratorPropertyFeedbackSlot() const {
|
| + return async_iterator_property_feedback_slot_;
|
| + }
|
| +
|
| + FeedbackVectorSlot AsyncIteratorCallFeedbackSlot() const {
|
| + return async_iterator_call_feedback_slot_;
|
| + }
|
| +
|
| private:
|
| friend class AstNodeFactory;
|
|
|
| - explicit GetIterator(Expression* iterable, int pos)
|
| - : Expression(pos, kGetIterator), iterable_(iterable) {}
|
| + explicit GetIterator(Expression* iterable, IteratorType hint, int pos)
|
| + : Expression(pos, kGetIterator), hint_(hint), iterable_(iterable) {}
|
|
|
| + IteratorType hint_;
|
| Expression* iterable_;
|
| FeedbackVectorSlot iterator_property_feedback_slot_;
|
| FeedbackVectorSlot iterator_call_feedback_slot_;
|
| + FeedbackVectorSlot async_iterator_property_feedback_slot_;
|
| + FeedbackVectorSlot async_iterator_call_feedback_slot_;
|
| };
|
|
|
| // ----------------------------------------------------------------------------
|
| @@ -3584,8 +3606,9 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| return new (zone_) EmptyParentheses(pos);
|
| }
|
|
|
| - GetIterator* NewGetIterator(Expression* iterable, int pos) {
|
| - return new (zone_) GetIterator(iterable, pos);
|
| + GetIterator* NewGetIterator(Expression* iterable, IteratorType hint,
|
| + int pos) {
|
| + return new (zone_) GetIterator(iterable, hint, pos);
|
| }
|
|
|
| Zone* zone() const { return zone_; }
|
|
|