Changeset 266264 in webkit for trunk/Source/JavaScriptCore/parser/Nodes.h
- Timestamp:
- Aug 27, 2020, 5:27:19 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/Nodes.h
r266117 r266264 723 723 public: 724 724 enum Type : uint8_t { Constant = 1, Getter = 2, Setter = 4, Computed = 8, Shorthand = 16, Spread = 32, Private = 64 }; 725 enum PutType : uint8_t { Unknown, KnownDirect }; 726 727 PropertyNode(const Identifier&, ExpressionNode*, Type, PutType, SuperBinding, ClassElementTag); 728 PropertyNode(ExpressionNode*, Type, PutType, SuperBinding, ClassElementTag); 729 PropertyNode(ExpressionNode* propertyName, ExpressionNode*, Type, PutType, SuperBinding, ClassElementTag); 730 PropertyNode(const Identifier&, ExpressionNode* propertyName, ExpressionNode*, Type, PutType, SuperBinding, ClassElementTag); 725 726 PropertyNode(const Identifier&, ExpressionNode*, Type, SuperBinding, ClassElementTag); 727 PropertyNode(ExpressionNode*, Type, SuperBinding, ClassElementTag); 728 PropertyNode(ExpressionNode* propertyName, ExpressionNode*, Type, SuperBinding, ClassElementTag); 729 PropertyNode(const Identifier&, ExpressionNode* propertyName, ExpressionNode*, Type, SuperBinding, ClassElementTag); 731 730 732 731 ExpressionNode* expressionName() const { return m_expression; } … … 745 744 bool isComputedClassField() const { return isClassField() && hasComputedName(); } 746 745 void setIsOverriddenByDuplicate() { m_isOverriddenByDuplicate = true; } 747 PutType putType() const { return static_cast<PutType>(m_putType); } 748 749 ALWAYS_INLINE static bool isUnderscoreProtoSetter(VM& vm, const Identifier* name, Type type, bool needsSuperBinding) 750 { 751 return name && *name == vm.propertyNames->underscoreProto && type == Type::Constant && !needsSuperBinding; 746 747 ALWAYS_INLINE static bool isUnderscoreProtoSetter(VM& vm, const PropertyNode& node) 748 { 749 return isUnderscoreProtoSetter(vm, node.name(), node.type(), node.needsSuperBinding(), node.isClassProperty()); 750 } 751 752 ALWAYS_INLINE static bool isUnderscoreProtoSetter(VM& vm, const Identifier* name, Type type, bool needsSuperBinding, bool isClassProperty) 753 { 754 return name && *name == vm.propertyNames->underscoreProto && type == Type::Constant && !needsSuperBinding && !isClassProperty; 752 755 } 753 756 … … 759 762 unsigned m_type : 7; 760 763 unsigned m_needsSuperBinding : 1; 761 unsigned m_putType : 1;762 764 static_assert(1 << 2 > static_cast<unsigned>(ClassElementTag::LastTag), "ClassElementTag shouldn't use more than two bits"); 763 765 unsigned m_classElementTag : 2; … … 2329 2331 }; 2330 2332 2331 class ClassExprNode final : public ExpressionNode, public ThrowableExpressionData, publicVariableEnvironmentNode {2333 class ClassExprNode final : public ExpressionNode, public VariableEnvironmentNode { 2332 2334 JSC_MAKE_PARSER_ARENA_DELETABLE_ALLOCATED(ClassExprNode); 2333 2335 public:
Note:
See TracChangeset
for help on using the changeset viewer.