Changeset 177001 in webkit for trunk/Source/JavaScriptCore/parser/Nodes.h
- Timestamp:
- Dec 8, 2014, 5:53:53 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/parser/Nodes.h
r176836 r177001 107 107 }; 108 108 109 template <typename T>110 struct ParserArenaData : ParserArenaDeletable {111 T data;112 };113 114 109 class ParserArenaRoot { 115 110 WTF_MAKE_FAST_ALLOCATED; … … 191 186 unsigned lastLine() const { return m_lastLine; } 192 187 188 StatementNode* next() { return m_next; } 189 void setNext(StatementNode* next) { m_next = next; } 190 193 191 virtual bool isEmptyStatement() const { return false; } 194 192 virtual bool isReturnNode() const { return false; } … … 199 197 200 198 protected: 199 StatementNode* m_next; 201 200 int m_lastLine; 202 201 }; … … 1098 1097 }; 1099 1098 1100 typedef Vector<ExpressionNode*, 8> ExpressionVector; 1101 1102 class CommaNode : public ExpressionNode, public ParserArenaDeletable { 1103 public: 1104 CommaNode(const JSTokenLocation&, ExpressionNode* expr1, ExpressionNode* expr2); 1105 1106 using ParserArenaDeletable::operator new; 1107 1108 void append(ExpressionNode* expr) { ASSERT(expr); m_expressions.append(expr); } 1099 class CommaNode final : public ExpressionNode, public ParserArenaFreeable { 1100 public: 1101 CommaNode(const JSTokenLocation&, ExpressionNode*); 1102 1103 void setNext(CommaNode* next) { m_next = next; } 1104 CommaNode* next() { return m_next; } 1109 1105 1110 1106 private: … … 1112 1108 virtual RegisterID* emitBytecode(BytecodeGenerator&, RegisterID* = 0) override; 1113 1109 1114 ExpressionVector m_expressions; 1110 ExpressionNode* m_expr; 1111 CommaNode* m_next; 1115 1112 }; 1116 1113 … … 1145 1142 }; 1146 1143 1147 class SourceElements : public ParserArenaDeletable {1144 class SourceElements final : public ParserArenaFreeable { 1148 1145 public: 1149 1146 SourceElements(); … … 1157 1154 1158 1155 private: 1159 Vector<StatementNode*> m_statements; 1156 StatementNode* m_head; 1157 StatementNode* m_tail; 1160 1158 }; 1161 1159 … … 1412 1410 1413 1411 ScopeNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, bool inStrictContext); 1414 ScopeNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, const SourceCode&, SourceElements*, VarStack *, FunctionStack*, IdentifierSet&, CodeFeatures, int numConstants);1412 ScopeNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, const SourceCode&, SourceElements*, VarStack&, FunctionStack&, IdentifierSet&, CodeFeatures, int numConstants); 1415 1413 1416 1414 using ParserArenaRoot::operator new; … … 1474 1472 class ProgramNode : public ScopeNode { 1475 1473 public: 1476 ProgramNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VarStack *, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);1474 ProgramNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VarStack&, FunctionStack&, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); 1477 1475 1478 1476 unsigned startColumn() const { return m_startColumn; } … … 1493 1491 class EvalNode : public ScopeNode { 1494 1492 public: 1495 EvalNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VarStack *, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);1493 EvalNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VarStack&, FunctionStack&, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); 1496 1494 1497 1495 ALWAYS_INLINE unsigned startColumn() const { return 0; } … … 1574 1572 class FunctionNode final : public ScopeNode { 1575 1573 public: 1576 FunctionNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VarStack *, FunctionStack*, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants);1574 FunctionNode(ParserArena&, const JSTokenLocation& start, const JSTokenLocation& end, unsigned startColumn, unsigned endColumn, SourceElements*, VarStack&, FunctionStack&, IdentifierSet&, const SourceCode&, CodeFeatures, int numConstants); 1577 1575 1578 1576 FunctionParameters* parameters() const { return m_parameters.get(); }
Note:
See TracChangeset
for help on using the changeset viewer.