| Index: src/ast.h
|
| diff --git a/src/ast.h b/src/ast.h
|
| index c2a3b0023040d358a25e090bdc93c78302f6f0f0..4ef0282c07c1e1aa98a41fb4eb8132dd21ac392b 100644
|
| --- a/src/ast.h
|
| +++ b/src/ast.h
|
| @@ -87,7 +87,8 @@ namespace internal {
|
| V(CompareOperation) \
|
| V(Spread) \
|
| V(ThisFunction) \
|
| - V(SuperReference) \
|
| + V(SuperPropertyReference) \
|
| + V(SuperCallReference) \
|
| V(CaseClause)
|
|
|
| #define AST_NODE_LIST(V) \
|
| @@ -1760,9 +1761,7 @@ class Property final : public Expression {
|
| }
|
| bool is_for_call() const { return IsForCallField::decode(bit_field_); }
|
|
|
| - bool IsSuperAccess() {
|
| - return obj()->IsSuperReference();
|
| - }
|
| + bool IsSuperAccess() { return obj()->IsSuperPropertyReference(); }
|
|
|
| virtual FeedbackVectorRequirements ComputeFeedbackRequirements(
|
| Isolate* isolate, const ICSlotCache* cache) override {
|
| @@ -2791,16 +2790,16 @@ class ThisFunction final : public Expression {
|
| };
|
|
|
|
|
| -class SuperReference final : public Expression {
|
| +class SuperPropertyReference final : public Expression {
|
| public:
|
| - DECLARE_NODE_TYPE(SuperReference)
|
| + DECLARE_NODE_TYPE(SuperPropertyReference)
|
|
|
| VariableProxy* this_var() const { return this_var_; }
|
| VariableProxy* home_object_var() const { return home_object_var_; }
|
|
|
| protected:
|
| - SuperReference(Zone* zone, VariableProxy* this_var,
|
| - VariableProxy* home_object_var, int pos)
|
| + SuperPropertyReference(Zone* zone, VariableProxy* this_var,
|
| + VariableProxy* home_object_var, int pos)
|
| : Expression(zone, pos),
|
| this_var_(this_var),
|
| home_object_var_(home_object_var) {
|
| @@ -2814,6 +2813,34 @@ class SuperReference final : public Expression {
|
| };
|
|
|
|
|
| +class SuperCallReference final : public Expression {
|
| + public:
|
| + DECLARE_NODE_TYPE(SuperCallReference)
|
| +
|
| + VariableProxy* this_var() const { return this_var_; }
|
| + VariableProxy* new_target_var() const { return new_target_var_; }
|
| + VariableProxy* this_function_var() const { return this_function_var_; }
|
| +
|
| + protected:
|
| + SuperCallReference(Zone* zone, VariableProxy* this_var,
|
| + VariableProxy* new_target_var,
|
| + VariableProxy* this_function_var, int pos)
|
| + : Expression(zone, pos),
|
| + this_var_(this_var),
|
| + new_target_var_(new_target_var),
|
| + this_function_var_(this_function_var) {
|
| + DCHECK(this_var->is_this());
|
| + DCHECK(new_target_var->raw_name()->IsOneByteEqualTo("new.target"));
|
| + DCHECK(this_function_var->raw_name()->IsOneByteEqualTo(".this_function"));
|
| + }
|
| +
|
| + private:
|
| + VariableProxy* this_var_;
|
| + VariableProxy* new_target_var_;
|
| + VariableProxy* this_function_var_;
|
| +};
|
| +
|
| +
|
| #undef DECLARE_NODE_TYPE
|
|
|
|
|
| @@ -3581,9 +3608,18 @@ class AstNodeFactory final BASE_EMBEDDED {
|
| return new (zone_) ThisFunction(zone_, pos);
|
| }
|
|
|
| - SuperReference* NewSuperReference(VariableProxy* this_var,
|
| - VariableProxy* home_object_var, int pos) {
|
| - return new (zone_) SuperReference(zone_, this_var, home_object_var, pos);
|
| + SuperPropertyReference* NewSuperPropertyReference(
|
| + VariableProxy* this_var, VariableProxy* home_object_var, int pos) {
|
| + return new (zone_)
|
| + SuperPropertyReference(zone_, this_var, home_object_var, pos);
|
| + }
|
| +
|
| + SuperCallReference* NewSuperCallReference(VariableProxy* this_var,
|
| + VariableProxy* new_target_var,
|
| + VariableProxy* this_function_var,
|
| + int pos) {
|
| + return new (zone_) SuperCallReference(zone_, this_var, new_target_var,
|
| + this_function_var, pos);
|
| }
|
|
|
| private:
|
|
|