]>
git.saurik.com Git - apple/javascriptcore.git/blob - parser/NodeConstructors.h
2 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
21 #ifndef NodeConstructors_h
22 #define NodeConstructors_h
30 inline void* ParserArenaDeletable::operator new(size_t size
, JSGlobalData
* globalData
)
32 ParserArenaDeletable
* deletable
= static_cast<ParserArenaDeletable
*>(fastMalloc(size
));
33 globalData
->parser
->arena().deleteWithArena(deletable
);
37 inline void* ParserArenaDeletable::operator new(size_t size
)
39 return fastMalloc(size
);
42 inline ParserArenaRefCounted::ParserArenaRefCounted(JSGlobalData
* globalData
)
44 globalData
->parser
->arena().derefWithArena(adoptRef(this));
47 inline Node::Node(JSGlobalData
* globalData
)
48 : m_line(globalData
->lexer
->lineNumber())
52 inline ExpressionNode::ExpressionNode(JSGlobalData
* globalData
, ResultType resultType
)
54 , m_resultType(resultType
)
58 inline StatementNode::StatementNode(JSGlobalData
* globalData
)
64 inline NullNode::NullNode(JSGlobalData
* globalData
)
65 : ExpressionNode(globalData
, ResultType::nullType())
69 inline BooleanNode::BooleanNode(JSGlobalData
* globalData
, bool value
)
70 : ExpressionNode(globalData
, ResultType::booleanType())
75 inline NumberNode::NumberNode(JSGlobalData
* globalData
, double v
)
76 : ExpressionNode(globalData
, ResultType::numberType())
81 inline StringNode::StringNode(JSGlobalData
* globalData
, const Identifier
& v
)
82 : ExpressionNode(globalData
, ResultType::stringType())
87 inline RegExpNode::RegExpNode(JSGlobalData
* globalData
, const UString
& pattern
, const UString
& flags
)
88 : ExpressionNode(globalData
)
94 inline ThisNode::ThisNode(JSGlobalData
* globalData
)
95 : ExpressionNode(globalData
)
99 inline ResolveNode::ResolveNode(JSGlobalData
* globalData
, const Identifier
& ident
, int startOffset
)
100 : ExpressionNode(globalData
)
102 , m_startOffset(startOffset
)
106 inline ElementNode::ElementNode(JSGlobalData
*, int elision
, ExpressionNode
* node
)
113 inline ElementNode::ElementNode(JSGlobalData
*, ElementNode
* l
, int elision
, ExpressionNode
* node
)
121 inline ArrayNode::ArrayNode(JSGlobalData
* globalData
, int elision
)
122 : ExpressionNode(globalData
)
129 inline ArrayNode::ArrayNode(JSGlobalData
* globalData
, ElementNode
* element
)
130 : ExpressionNode(globalData
)
137 inline ArrayNode::ArrayNode(JSGlobalData
* globalData
, int elision
, ElementNode
* element
)
138 : ExpressionNode(globalData
)
145 inline PropertyNode::PropertyNode(JSGlobalData
*, const Identifier
& name
, ExpressionNode
* assign
, Type type
)
152 inline PropertyListNode::PropertyListNode(JSGlobalData
* globalData
, PropertyNode
* node
)
159 inline PropertyListNode::PropertyListNode(JSGlobalData
* globalData
, PropertyNode
* node
, PropertyListNode
* list
)
167 inline ObjectLiteralNode::ObjectLiteralNode(JSGlobalData
* globalData
)
168 : ExpressionNode(globalData
)
173 inline ObjectLiteralNode::ObjectLiteralNode(JSGlobalData
* globalData
, PropertyListNode
* list
)
174 : ExpressionNode(globalData
)
179 inline BracketAccessorNode::BracketAccessorNode(JSGlobalData
* globalData
, ExpressionNode
* base
, ExpressionNode
* subscript
, bool subscriptHasAssignments
)
180 : ExpressionNode(globalData
)
182 , m_subscript(subscript
)
183 , m_subscriptHasAssignments(subscriptHasAssignments
)
187 inline DotAccessorNode::DotAccessorNode(JSGlobalData
* globalData
, ExpressionNode
* base
, const Identifier
& ident
)
188 : ExpressionNode(globalData
)
194 inline ArgumentListNode::ArgumentListNode(JSGlobalData
* globalData
, ExpressionNode
* expr
)
201 inline ArgumentListNode::ArgumentListNode(JSGlobalData
* globalData
, ArgumentListNode
* listNode
, ExpressionNode
* expr
)
206 listNode
->m_next
= this;
209 inline ArgumentsNode::ArgumentsNode(JSGlobalData
*)
214 inline ArgumentsNode::ArgumentsNode(JSGlobalData
*, ArgumentListNode
* listNode
)
215 : m_listNode(listNode
)
219 inline NewExprNode::NewExprNode(JSGlobalData
* globalData
, ExpressionNode
* expr
)
220 : ExpressionNode(globalData
)
226 inline NewExprNode::NewExprNode(JSGlobalData
* globalData
, ExpressionNode
* expr
, ArgumentsNode
* args
)
227 : ExpressionNode(globalData
)
233 inline EvalFunctionCallNode::EvalFunctionCallNode(JSGlobalData
* globalData
, ArgumentsNode
* args
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
234 : ExpressionNode(globalData
)
235 , ThrowableExpressionData(divot
, startOffset
, endOffset
)
240 inline FunctionCallValueNode::FunctionCallValueNode(JSGlobalData
* globalData
, ExpressionNode
* expr
, ArgumentsNode
* args
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
241 : ExpressionNode(globalData
)
242 , ThrowableExpressionData(divot
, startOffset
, endOffset
)
248 inline FunctionCallResolveNode::FunctionCallResolveNode(JSGlobalData
* globalData
, const Identifier
& ident
, ArgumentsNode
* args
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
249 : ExpressionNode(globalData
)
250 , ThrowableExpressionData(divot
, startOffset
, endOffset
)
256 inline FunctionCallBracketNode::FunctionCallBracketNode(JSGlobalData
* globalData
, ExpressionNode
* base
, ExpressionNode
* subscript
, ArgumentsNode
* args
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
257 : ExpressionNode(globalData
)
258 , ThrowableSubExpressionData(divot
, startOffset
, endOffset
)
260 , m_subscript(subscript
)
265 inline FunctionCallDotNode::FunctionCallDotNode(JSGlobalData
* globalData
, ExpressionNode
* base
, const Identifier
& ident
, ArgumentsNode
* args
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
266 : ExpressionNode(globalData
)
267 , ThrowableSubExpressionData(divot
, startOffset
, endOffset
)
274 inline CallFunctionCallDotNode::CallFunctionCallDotNode(JSGlobalData
* globalData
, ExpressionNode
* base
, const Identifier
& ident
, ArgumentsNode
* args
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
275 : FunctionCallDotNode(globalData
, base
, ident
, args
, divot
, startOffset
, endOffset
)
279 inline ApplyFunctionCallDotNode::ApplyFunctionCallDotNode(JSGlobalData
* globalData
, ExpressionNode
* base
, const Identifier
& ident
, ArgumentsNode
* args
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
280 : FunctionCallDotNode(globalData
, base
, ident
, args
, divot
, startOffset
, endOffset
)
284 inline PrePostResolveNode::PrePostResolveNode(JSGlobalData
* globalData
, const Identifier
& ident
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
285 : ExpressionNode(globalData
, ResultType::numberType()) // could be reusable for pre?
286 , ThrowableExpressionData(divot
, startOffset
, endOffset
)
291 inline PostfixResolveNode::PostfixResolveNode(JSGlobalData
* globalData
, const Identifier
& ident
, Operator oper
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
292 : PrePostResolveNode(globalData
, ident
, divot
, startOffset
, endOffset
)
297 inline PostfixBracketNode::PostfixBracketNode(JSGlobalData
* globalData
, ExpressionNode
* base
, ExpressionNode
* subscript
, Operator oper
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
298 : ExpressionNode(globalData
)
299 , ThrowableSubExpressionData(divot
, startOffset
, endOffset
)
301 , m_subscript(subscript
)
306 inline PostfixDotNode::PostfixDotNode(JSGlobalData
* globalData
, ExpressionNode
* base
, const Identifier
& ident
, Operator oper
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
307 : ExpressionNode(globalData
)
308 , ThrowableSubExpressionData(divot
, startOffset
, endOffset
)
315 inline PostfixErrorNode::PostfixErrorNode(JSGlobalData
* globalData
, ExpressionNode
* expr
, Operator oper
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
316 : ExpressionNode(globalData
)
317 , ThrowableSubExpressionData(divot
, startOffset
, endOffset
)
323 inline DeleteResolveNode::DeleteResolveNode(JSGlobalData
* globalData
, const Identifier
& ident
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
324 : ExpressionNode(globalData
)
325 , ThrowableExpressionData(divot
, startOffset
, endOffset
)
330 inline DeleteBracketNode::DeleteBracketNode(JSGlobalData
* globalData
, ExpressionNode
* base
, ExpressionNode
* subscript
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
331 : ExpressionNode(globalData
)
332 , ThrowableExpressionData(divot
, startOffset
, endOffset
)
334 , m_subscript(subscript
)
338 inline DeleteDotNode::DeleteDotNode(JSGlobalData
* globalData
, ExpressionNode
* base
, const Identifier
& ident
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
339 : ExpressionNode(globalData
)
340 , ThrowableExpressionData(divot
, startOffset
, endOffset
)
346 inline DeleteValueNode::DeleteValueNode(JSGlobalData
* globalData
, ExpressionNode
* expr
)
347 : ExpressionNode(globalData
)
352 inline VoidNode::VoidNode(JSGlobalData
* globalData
, ExpressionNode
* expr
)
353 : ExpressionNode(globalData
)
358 inline TypeOfResolveNode::TypeOfResolveNode(JSGlobalData
* globalData
, const Identifier
& ident
)
359 : ExpressionNode(globalData
, ResultType::stringType())
364 inline TypeOfValueNode::TypeOfValueNode(JSGlobalData
* globalData
, ExpressionNode
* expr
)
365 : ExpressionNode(globalData
, ResultType::stringType())
370 inline PrefixResolveNode::PrefixResolveNode(JSGlobalData
* globalData
, const Identifier
& ident
, Operator oper
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
371 : PrePostResolveNode(globalData
, ident
, divot
, startOffset
, endOffset
)
376 inline PrefixBracketNode::PrefixBracketNode(JSGlobalData
* globalData
, ExpressionNode
* base
, ExpressionNode
* subscript
, Operator oper
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
377 : ExpressionNode(globalData
)
378 , ThrowablePrefixedSubExpressionData(divot
, startOffset
, endOffset
)
380 , m_subscript(subscript
)
385 inline PrefixDotNode::PrefixDotNode(JSGlobalData
* globalData
, ExpressionNode
* base
, const Identifier
& ident
, Operator oper
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
386 : ExpressionNode(globalData
)
387 , ThrowablePrefixedSubExpressionData(divot
, startOffset
, endOffset
)
394 inline PrefixErrorNode::PrefixErrorNode(JSGlobalData
* globalData
, ExpressionNode
* expr
, Operator oper
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
395 : ExpressionNode(globalData
)
396 , ThrowableExpressionData(divot
, startOffset
, endOffset
)
402 inline UnaryOpNode::UnaryOpNode(JSGlobalData
* globalData
, ResultType type
, ExpressionNode
* expr
, OpcodeID opcodeID
)
403 : ExpressionNode(globalData
, type
)
405 , m_opcodeID(opcodeID
)
409 inline UnaryPlusNode::UnaryPlusNode(JSGlobalData
* globalData
, ExpressionNode
* expr
)
410 : UnaryOpNode(globalData
, ResultType::numberType(), expr
, op_to_jsnumber
)
414 inline NegateNode::NegateNode(JSGlobalData
* globalData
, ExpressionNode
* expr
)
415 : UnaryOpNode(globalData
, ResultType::numberTypeCanReuse(), expr
, op_negate
)
419 inline BitwiseNotNode::BitwiseNotNode(JSGlobalData
* globalData
, ExpressionNode
* expr
)
420 : UnaryOpNode(globalData
, ResultType::forBitOp(), expr
, op_bitnot
)
424 inline LogicalNotNode::LogicalNotNode(JSGlobalData
* globalData
, ExpressionNode
* expr
)
425 : UnaryOpNode(globalData
, ResultType::booleanType(), expr
, op_not
)
429 inline BinaryOpNode::BinaryOpNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, OpcodeID opcodeID
, bool rightHasAssignments
)
430 : ExpressionNode(globalData
)
433 , m_opcodeID(opcodeID
)
434 , m_rightHasAssignments(rightHasAssignments
)
438 inline BinaryOpNode::BinaryOpNode(JSGlobalData
* globalData
, ResultType type
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, OpcodeID opcodeID
, bool rightHasAssignments
)
439 : ExpressionNode(globalData
, type
)
442 , m_opcodeID(opcodeID
)
443 , m_rightHasAssignments(rightHasAssignments
)
447 inline ReverseBinaryOpNode::ReverseBinaryOpNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, OpcodeID opcodeID
, bool rightHasAssignments
)
448 : BinaryOpNode(globalData
, expr1
, expr2
, opcodeID
, rightHasAssignments
)
452 inline ReverseBinaryOpNode::ReverseBinaryOpNode(JSGlobalData
* globalData
, ResultType type
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, OpcodeID opcodeID
, bool rightHasAssignments
)
453 : BinaryOpNode(globalData
, type
, expr1
, expr2
, opcodeID
, rightHasAssignments
)
457 inline MultNode::MultNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
458 : BinaryOpNode(globalData
, ResultType::numberTypeCanReuse(), expr1
, expr2
, op_mul
, rightHasAssignments
)
462 inline DivNode::DivNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
463 : BinaryOpNode(globalData
, ResultType::numberTypeCanReuse(), expr1
, expr2
, op_div
, rightHasAssignments
)
468 inline ModNode::ModNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
469 : BinaryOpNode(globalData
, ResultType::numberTypeCanReuse(), expr1
, expr2
, op_mod
, rightHasAssignments
)
473 inline AddNode::AddNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
474 : BinaryOpNode(globalData
, ResultType::forAdd(expr1
->resultDescriptor(), expr2
->resultDescriptor()), expr1
, expr2
, op_add
, rightHasAssignments
)
478 inline SubNode::SubNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
479 : BinaryOpNode(globalData
, ResultType::numberTypeCanReuse(), expr1
, expr2
, op_sub
, rightHasAssignments
)
483 inline LeftShiftNode::LeftShiftNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
484 : BinaryOpNode(globalData
, ResultType::forBitOp(), expr1
, expr2
, op_lshift
, rightHasAssignments
)
488 inline RightShiftNode::RightShiftNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
489 : BinaryOpNode(globalData
, ResultType::forBitOp(), expr1
, expr2
, op_rshift
, rightHasAssignments
)
493 inline UnsignedRightShiftNode::UnsignedRightShiftNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
494 : BinaryOpNode(globalData
, ResultType::numberTypeCanReuse(), expr1
, expr2
, op_urshift
, rightHasAssignments
)
498 inline LessNode::LessNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
499 : BinaryOpNode(globalData
, ResultType::booleanType(), expr1
, expr2
, op_less
, rightHasAssignments
)
503 inline GreaterNode::GreaterNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
504 : ReverseBinaryOpNode(globalData
, ResultType::booleanType(), expr1
, expr2
, op_less
, rightHasAssignments
)
508 inline LessEqNode::LessEqNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
509 : BinaryOpNode(globalData
, ResultType::booleanType(), expr1
, expr2
, op_lesseq
, rightHasAssignments
)
513 inline GreaterEqNode::GreaterEqNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
514 : ReverseBinaryOpNode(globalData
, ResultType::booleanType(), expr1
, expr2
, op_lesseq
, rightHasAssignments
)
518 inline ThrowableBinaryOpNode::ThrowableBinaryOpNode(JSGlobalData
* globalData
, ResultType type
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, OpcodeID opcodeID
, bool rightHasAssignments
)
519 : BinaryOpNode(globalData
, type
, expr1
, expr2
, opcodeID
, rightHasAssignments
)
523 inline ThrowableBinaryOpNode::ThrowableBinaryOpNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, OpcodeID opcodeID
, bool rightHasAssignments
)
524 : BinaryOpNode(globalData
, expr1
, expr2
, opcodeID
, rightHasAssignments
)
528 inline InstanceOfNode::InstanceOfNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
529 : ThrowableBinaryOpNode(globalData
, ResultType::booleanType(), expr1
, expr2
, op_instanceof
, rightHasAssignments
)
533 inline InNode::InNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
534 : ThrowableBinaryOpNode(globalData
, expr1
, expr2
, op_in
, rightHasAssignments
)
538 inline EqualNode::EqualNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
539 : BinaryOpNode(globalData
, ResultType::booleanType(), expr1
, expr2
, op_eq
, rightHasAssignments
)
543 inline NotEqualNode::NotEqualNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
544 : BinaryOpNode(globalData
, ResultType::booleanType(), expr1
, expr2
, op_neq
, rightHasAssignments
)
548 inline StrictEqualNode::StrictEqualNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
549 : BinaryOpNode(globalData
, ResultType::booleanType(), expr1
, expr2
, op_stricteq
, rightHasAssignments
)
553 inline NotStrictEqualNode::NotStrictEqualNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
554 : BinaryOpNode(globalData
, ResultType::booleanType(), expr1
, expr2
, op_nstricteq
, rightHasAssignments
)
558 inline BitAndNode::BitAndNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
559 : BinaryOpNode(globalData
, ResultType::forBitOp(), expr1
, expr2
, op_bitand
, rightHasAssignments
)
563 inline BitOrNode::BitOrNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
564 : BinaryOpNode(globalData
, ResultType::forBitOp(), expr1
, expr2
, op_bitor
, rightHasAssignments
)
568 inline BitXOrNode::BitXOrNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, bool rightHasAssignments
)
569 : BinaryOpNode(globalData
, ResultType::forBitOp(), expr1
, expr2
, op_bitxor
, rightHasAssignments
)
573 inline LogicalOpNode::LogicalOpNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, LogicalOperator oper
)
574 : ExpressionNode(globalData
, ResultType::booleanType())
581 inline ConditionalNode::ConditionalNode(JSGlobalData
* globalData
, ExpressionNode
* logical
, ExpressionNode
* expr1
, ExpressionNode
* expr2
)
582 : ExpressionNode(globalData
)
589 inline ReadModifyResolveNode::ReadModifyResolveNode(JSGlobalData
* globalData
, const Identifier
& ident
, Operator oper
, ExpressionNode
* right
, bool rightHasAssignments
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
590 : ExpressionNode(globalData
)
591 , ThrowableExpressionData(divot
, startOffset
, endOffset
)
595 , m_rightHasAssignments(rightHasAssignments
)
599 inline AssignResolveNode::AssignResolveNode(JSGlobalData
* globalData
, const Identifier
& ident
, ExpressionNode
* right
, bool rightHasAssignments
)
600 : ExpressionNode(globalData
)
603 , m_rightHasAssignments(rightHasAssignments
)
607 inline ReadModifyBracketNode::ReadModifyBracketNode(JSGlobalData
* globalData
, ExpressionNode
* base
, ExpressionNode
* subscript
, Operator oper
, ExpressionNode
* right
, bool subscriptHasAssignments
, bool rightHasAssignments
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
608 : ExpressionNode(globalData
)
609 , ThrowableSubExpressionData(divot
, startOffset
, endOffset
)
611 , m_subscript(subscript
)
614 , m_subscriptHasAssignments(subscriptHasAssignments
)
615 , m_rightHasAssignments(rightHasAssignments
)
619 inline AssignBracketNode::AssignBracketNode(JSGlobalData
* globalData
, ExpressionNode
* base
, ExpressionNode
* subscript
, ExpressionNode
* right
, bool subscriptHasAssignments
, bool rightHasAssignments
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
620 : ExpressionNode(globalData
)
621 , ThrowableExpressionData(divot
, startOffset
, endOffset
)
623 , m_subscript(subscript
)
625 , m_subscriptHasAssignments(subscriptHasAssignments
)
626 , m_rightHasAssignments(rightHasAssignments
)
630 inline AssignDotNode::AssignDotNode(JSGlobalData
* globalData
, ExpressionNode
* base
, const Identifier
& ident
, ExpressionNode
* right
, bool rightHasAssignments
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
631 : ExpressionNode(globalData
)
632 , ThrowableExpressionData(divot
, startOffset
, endOffset
)
636 , m_rightHasAssignments(rightHasAssignments
)
640 inline ReadModifyDotNode::ReadModifyDotNode(JSGlobalData
* globalData
, ExpressionNode
* base
, const Identifier
& ident
, Operator oper
, ExpressionNode
* right
, bool rightHasAssignments
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
641 : ExpressionNode(globalData
)
642 , ThrowableSubExpressionData(divot
, startOffset
, endOffset
)
647 , m_rightHasAssignments(rightHasAssignments
)
651 inline AssignErrorNode::AssignErrorNode(JSGlobalData
* globalData
, ExpressionNode
* left
, Operator oper
, ExpressionNode
* right
, unsigned divot
, unsigned startOffset
, unsigned endOffset
)
652 : ExpressionNode(globalData
)
653 , ThrowableExpressionData(divot
, startOffset
, endOffset
)
660 inline CommaNode::CommaNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
)
661 : ExpressionNode(globalData
)
663 m_expressions
.append(expr1
);
664 m_expressions
.append(expr2
);
667 inline ConstStatementNode::ConstStatementNode(JSGlobalData
* globalData
, ConstDeclNode
* next
)
668 : StatementNode(globalData
)
673 inline SourceElements::SourceElements(JSGlobalData
*)
677 inline EmptyStatementNode::EmptyStatementNode(JSGlobalData
* globalData
)
678 : StatementNode(globalData
)
682 inline DebuggerStatementNode::DebuggerStatementNode(JSGlobalData
* globalData
)
683 : StatementNode(globalData
)
687 inline ExprStatementNode::ExprStatementNode(JSGlobalData
* globalData
, ExpressionNode
* expr
)
688 : StatementNode(globalData
)
693 inline VarStatementNode::VarStatementNode(JSGlobalData
* globalData
, ExpressionNode
* expr
)
694 : StatementNode(globalData
)
699 inline IfNode::IfNode(JSGlobalData
* globalData
, ExpressionNode
* condition
, StatementNode
* ifBlock
)
700 : StatementNode(globalData
)
701 , m_condition(condition
)
706 inline IfElseNode::IfElseNode(JSGlobalData
* globalData
, ExpressionNode
* condition
, StatementNode
* ifBlock
, StatementNode
* elseBlock
)
707 : IfNode(globalData
, condition
, ifBlock
)
708 , m_elseBlock(elseBlock
)
712 inline DoWhileNode::DoWhileNode(JSGlobalData
* globalData
, StatementNode
* statement
, ExpressionNode
* expr
)
713 : StatementNode(globalData
)
714 , m_statement(statement
)
719 inline WhileNode::WhileNode(JSGlobalData
* globalData
, ExpressionNode
* expr
, StatementNode
* statement
)
720 : StatementNode(globalData
)
722 , m_statement(statement
)
726 inline ForNode::ForNode(JSGlobalData
* globalData
, ExpressionNode
* expr1
, ExpressionNode
* expr2
, ExpressionNode
* expr3
, StatementNode
* statement
, bool expr1WasVarDecl
)
727 : StatementNode(globalData
)
731 , m_statement(statement
)
732 , m_expr1WasVarDecl(expr1
&& expr1WasVarDecl
)
737 inline ContinueNode::ContinueNode(JSGlobalData
* globalData
)
738 : StatementNode(globalData
)
742 inline ContinueNode::ContinueNode(JSGlobalData
* globalData
, const Identifier
& ident
)
743 : StatementNode(globalData
)
748 inline BreakNode::BreakNode(JSGlobalData
* globalData
)
749 : StatementNode(globalData
)
753 inline BreakNode::BreakNode(JSGlobalData
* globalData
, const Identifier
& ident
)
754 : StatementNode(globalData
)
759 inline ReturnNode::ReturnNode(JSGlobalData
* globalData
, ExpressionNode
* value
)
760 : StatementNode(globalData
)
765 inline WithNode::WithNode(JSGlobalData
* globalData
, ExpressionNode
* expr
, StatementNode
* statement
, uint32_t divot
, uint32_t expressionLength
)
766 : StatementNode(globalData
)
768 , m_statement(statement
)
770 , m_expressionLength(expressionLength
)
774 inline LabelNode::LabelNode(JSGlobalData
* globalData
, const Identifier
& name
, StatementNode
* statement
)
775 : StatementNode(globalData
)
777 , m_statement(statement
)
781 inline ThrowNode::ThrowNode(JSGlobalData
* globalData
, ExpressionNode
* expr
)
782 : StatementNode(globalData
)
787 inline TryNode::TryNode(JSGlobalData
* globalData
, StatementNode
* tryBlock
, const Identifier
& exceptionIdent
, bool catchHasEval
, StatementNode
* catchBlock
, StatementNode
* finallyBlock
)
788 : StatementNode(globalData
)
789 , m_tryBlock(tryBlock
)
790 , m_exceptionIdent(exceptionIdent
)
791 , m_catchBlock(catchBlock
)
792 , m_finallyBlock(finallyBlock
)
793 , m_catchHasEval(catchHasEval
)
797 inline ParameterNode::ParameterNode(JSGlobalData
*, const Identifier
& ident
)
803 inline ParameterNode::ParameterNode(JSGlobalData
*, ParameterNode
* l
, const Identifier
& ident
)
810 inline FuncExprNode::FuncExprNode(JSGlobalData
* globalData
, const Identifier
& ident
, FunctionBodyNode
* body
, const SourceCode
& source
, ParameterNode
* parameter
)
811 : ExpressionNode(globalData
)
812 , ParserArenaRefCounted(globalData
)
816 m_body
->finishParsing(source
, parameter
);
819 inline FuncDeclNode::FuncDeclNode(JSGlobalData
* globalData
, const Identifier
& ident
, FunctionBodyNode
* body
, const SourceCode
& source
, ParameterNode
* parameter
)
820 : StatementNode(globalData
)
821 , ParserArenaRefCounted(globalData
)
825 m_body
->finishParsing(source
, parameter
);
828 inline CaseClauseNode::CaseClauseNode(JSGlobalData
*, ExpressionNode
* expr
)
833 inline CaseClauseNode::CaseClauseNode(JSGlobalData
*, ExpressionNode
* expr
, SourceElements
* children
)
837 children
->releaseContentsIntoVector(m_children
);
840 inline ClauseListNode::ClauseListNode(JSGlobalData
*, CaseClauseNode
* clause
)
846 inline ClauseListNode::ClauseListNode(JSGlobalData
*, ClauseListNode
* clauseList
, CaseClauseNode
* clause
)
850 clauseList
->m_next
= this;
853 inline CaseBlockNode::CaseBlockNode(JSGlobalData
*, ClauseListNode
* list1
, CaseClauseNode
* defaultClause
, ClauseListNode
* list2
)
855 , m_defaultClause(defaultClause
)
860 inline SwitchNode::SwitchNode(JSGlobalData
* globalData
, ExpressionNode
* expr
, CaseBlockNode
* block
)
861 : StatementNode(globalData
)
867 inline ConstDeclNode::ConstDeclNode(JSGlobalData
* globalData
, const Identifier
& ident
, ExpressionNode
* init
)
868 : ExpressionNode(globalData
)
875 inline BlockNode::BlockNode(JSGlobalData
* globalData
, SourceElements
* children
)
876 : StatementNode(globalData
)
879 children
->releaseContentsIntoVector(m_children
);
882 inline ForInNode::ForInNode(JSGlobalData
* globalData
, ExpressionNode
* l
, ExpressionNode
* expr
, StatementNode
* statement
)
883 : StatementNode(globalData
)
887 , m_statement(statement
)
888 , m_identIsVarDecl(false)
892 inline ForInNode::ForInNode(JSGlobalData
* globalData
, const Identifier
& ident
, ExpressionNode
* in
, ExpressionNode
* expr
, StatementNode
* statement
, int divot
, int startOffset
, int endOffset
)
893 : StatementNode(globalData
)
896 , m_lexpr(new (globalData
) ResolveNode(globalData
, ident
, divot
- startOffset
))
898 , m_statement(statement
)
899 , m_identIsVarDecl(true)
902 AssignResolveNode
* node
= new (globalData
) AssignResolveNode(globalData
, ident
, in
, true);
903 node
->setExceptionSourceCode(divot
, divot
- startOffset
, endOffset
- divot
);
906 // for( var foo = bar in baz )
911 #endif // NodeConstructors_h