Changeset 266117 in webkit for trunk/Source/JavaScriptCore/parser/SyntaxChecker.h
- Timestamp:
- Aug 25, 2020, 8:58:40 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/SyntaxChecker.h
r262613 r266117 65 65 }; 66 66 67 SyntaxChecker(VM& , void*) 67 SyntaxChecker(VM& vm, void*) 68 : m_vm(vm) 68 69 { 69 70 } … … 100 101 struct Property { 101 102 ALWAYS_INLINE Property(void* = nullptr) 102 : type((PropertyNode::Type)0) 103 { 104 } 105 ALWAYS_INLINE Property(const Identifier* ident, PropertyNode::Type ty) 106 : name(ident) 107 , type(ty) 108 { 109 } 110 ALWAYS_INLINE Property(PropertyNode::Type ty) 111 : name(nullptr) 112 , type(ty) 103 { 104 } 105 ALWAYS_INLINE Property(PropertyNode::Type type) 106 : type(type) 107 { 108 } 109 ALWAYS_INLINE Property(PropertyNode::Type type, bool isUnderscoreProtoSetter) 110 : type(type) 111 , isUnderscoreProtoSetter(isUnderscoreProtoSetter) 113 112 { 114 113 } 115 114 ALWAYS_INLINE bool operator!() { return !type; } 116 const Identifier* name;117 PropertyNode::Type type;115 PropertyNode::Type type { static_cast<PropertyNode::Type>(0) }; 116 bool isUnderscoreProtoSetter { false }; 118 117 }; 119 118 typedef int PropertyList; … … 216 215 int createArgumentsList(const JSTokenLocation&, int) { return ArgumentsListResult; } 217 216 int createArgumentsList(const JSTokenLocation&, int, int) { return ArgumentsListResult; } 218 Property createProperty(const Identifier* name, int, PropertyNode::Type type, PropertyNode::PutType, bool complete, SuperBinding, InferName, ClassElementTag) 219 { 220 if (!complete) 221 return Property(type); 222 ASSERT(name); 223 return Property(name, type); 224 } 225 Property createProperty(int, PropertyNode::Type type, PropertyNode::PutType, bool, SuperBinding, ClassElementTag) 226 { 227 return Property(type); 228 } 229 Property createProperty(VM& vm, ParserArena& parserArena, double name, int, PropertyNode::Type type, PropertyNode::PutType, bool complete, SuperBinding, ClassElementTag) 230 { 231 if (!complete) 232 return Property(type); 233 return Property(&parserArena.identifierArena().makeNumericIdentifier(vm, name), type); 234 } 235 Property createProperty(int, int, PropertyNode::Type type, PropertyNode::PutType, bool, SuperBinding, ClassElementTag) 236 { 237 return Property(type); 238 } 239 Property createProperty(const Identifier*, int, int, PropertyNode::Type type, PropertyNode::PutType, bool, SuperBinding, ClassElementTag) 217 Property createProperty(const Identifier* name, int, PropertyNode::Type type, PropertyNode::PutType, SuperBinding superBinding, InferName, ClassElementTag) 218 { 219 return Property(type, PropertyNode::isUnderscoreProtoSetter(m_vm, name, type, superBinding == SuperBinding::Needed)); 220 } 221 Property createProperty(int, PropertyNode::Type type, PropertyNode::PutType, SuperBinding, ClassElementTag) 222 { 223 return Property(type); 224 } 225 Property createProperty(VM&, ParserArena&, double, int, PropertyNode::Type type, PropertyNode::PutType, SuperBinding, ClassElementTag) 226 { 227 return Property(type); 228 } 229 Property createProperty(int, int, PropertyNode::Type type, PropertyNode::PutType, SuperBinding, ClassElementTag) 230 { 231 return Property(type); 232 } 233 Property createProperty(const Identifier*, int, int, PropertyNode::Type type, PropertyNode::PutType, SuperBinding, ClassElementTag) 240 234 { 241 235 return Property(type); … … 292 286 293 287 int appendConstDecl(const JSTokenLocation&, int, const Identifier*, int) { return StatementResult; } 294 Property createGetterOrSetterProperty(const JSTokenLocation&, PropertyNode::Type type, bool strict, const Identifier* name, const ParserFunctionInfo<SyntaxChecker>&, ClassElementTag) 295 { 296 ASSERT(name); 297 if (!strict) 298 return Property(type); 299 return Property(name, type); 300 } 301 Property createGetterOrSetterProperty(const JSTokenLocation&, PropertyNode::Type type, bool, int, const ParserFunctionInfo<SyntaxChecker>&, ClassElementTag) 302 { 303 return Property(type); 304 } 305 Property createGetterOrSetterProperty(VM& vm, ParserArena& parserArena, const JSTokenLocation&, PropertyNode::Type type, bool strict, double name, const ParserFunctionInfo<SyntaxChecker>&, ClassElementTag) 306 { 307 if (!strict) 308 return Property(type); 309 return Property(&parserArena.identifierArena().makeNumericIdentifier(vm, name), type); 288 Property createGetterOrSetterProperty(const JSTokenLocation&, PropertyNode::Type type, const Identifier*, const ParserFunctionInfo<SyntaxChecker>&, ClassElementTag) 289 { 290 return Property(type); 291 } 292 Property createGetterOrSetterProperty(const JSTokenLocation&, PropertyNode::Type type, int, const ParserFunctionInfo<SyntaxChecker>&, ClassElementTag) 293 { 294 return Property(type); 295 } 296 Property createGetterOrSetterProperty(VM&, ParserArena&, const JSTokenLocation&, PropertyNode::Type type, double, const ParserFunctionInfo<SyntaxChecker>&, ClassElementTag) 297 { 298 return Property(type); 310 299 } 311 300 … … 340 329 void assignmentStackAppend(int& assignmentStackDepth, int, int, int, int, Operator) { assignmentStackDepth = 1; } 341 330 int createAssignment(const JSTokenLocation&, int& assignmentStackDepth, int, int, int, int) { assignmentStackDepth = 0; return AssignmentExpr; } 342 const Identifier* getName(const Property& property) const { return property.name; }343 331 PropertyNode::Type getType(const Property& property) const { return property.type; } 332 bool isUnderscoreProtoSetter(const Property& property) const { return property.isUnderscoreProtoSetter; } 344 333 bool isResolve(ExpressionType expr) const { return expr == ResolveExpr || expr == ResolveEvalExpr; } 345 334 ExpressionType createDestructuringAssignment(const JSTokenLocation&, int, ExpressionType) … … 448 437 449 438 private: 439 VM& m_vm; 450 440 int m_topBinaryExpr; 451 441 int m_topUnaryToken;
Note:
See TracChangeset
for help on using the changeset viewer.