45#define DECLARATION_NODE_LIST(V) \
46 V(VariableDeclaration) \
47 V(FunctionDeclaration)
49#define ITERATION_NODE_LIST(V) \
56#define BREAKABLE_NODE_LIST(V) \
60#define STATEMENT_NODE_LIST(V) \
61 ITERATION_NODE_LIST(V) \
62 BREAKABLE_NODE_LIST(V) \
63 V(ExpressionStatement) \
65 V(SloppyBlockFunctionStatement) \
67 V(ContinueStatement) \
71 V(TryCatchStatement) \
72 V(TryFinallyStatement) \
73 V(DebuggerStatement) \
74 V(InitializeClassMembersStatement) \
75 V(InitializeClassStaticElementsStatement) \
76 V(AutoAccessorGetterBody) \
77 V(AutoAccessorSetterBody)
79#define LITERAL_NODE_LIST(V) \
84#define EXPRESSION_NODE_LIST(V) \
85 LITERAL_NODE_LIST(V) \
91 V(SuperCallForwardArgs) \
96 V(CompoundAssignment) \
100 V(EmptyParentheses) \
102 V(GetTemplateObject) \
103 V(ImportCallExpression) \
105 V(NativeFunctionLiteral) \
109 V(SuperCallReference) \
110 V(SuperPropertyReference) \
119#define FAILURE_NODE_LIST(V) V(FailureExpression)
121#define AST_NODE_LIST(V) \
122 DECLARATION_NODE_LIST(V) \
123 STATEMENT_NODE_LIST(V) \
124 EXPRESSION_NODE_LIST(V)
132class BreakableStatement;
134class IterationStatement;
135class MaterializedLiteral;
136class NestedVariableDeclaration;
137class ProducedPreparseData;
140#define DEF_FORWARD_DECLARATION(type) class type;
143#undef DEF_FORWARD_DECLARATION
147#define DECLARE_TYPE_ENUM(type) k##type,
152#undef DECLARE_TYPE_ENUM
162#define DECLARE_NODE_FUNCTIONS(type) \
163 V8_INLINE bool Is##type() const; \
164 V8_INLINE type* As##type(); \
165 V8_INLINE const type* As##type() const;
168#undef DECLARE_NODE_FUNCTIONS
180 template <
class T,
int size>
268 static_assert(kObjectLiteral + 1 == kArrayLiteral);
292 template <
class T,
int size>
406 template <
class T,
int size>
544 return mode ==
ITERATE ?
"for-of" :
"for-in";
825 return outer_catch_prediction;
1029 bool ToUint32(uint32_t* value)
const;
1033 template <
typename IsolateT>
1039 static bool Match(
void* literal1,
void* literal2);
1167 template <
typename IsolateT>
1237 template <
typename IsolateT>
1240 template <
class T,
int size>
1309 uint32_t boilerplate_properties,
1337 template <
typename IsolateT>
1341 template <
typename IsolateT>
1343 IsolateT* isolate) {
1421 uint32_t boilerplate_properties,
int pos,
1458 template <
typename IsolateT>
1460 IsolateT* isolate) {
1468 template <
typename IsolateT>
1490 int first_spread_index,
int pos)
1492 values_(values.ToConstVector(), zone),
1555 var()->binding_needs_init() ||
1556 var()->local_if_not_shadowed()->binding_needs_init());
1589 while (*n !=
nullptr && (*n)->is_removed_from_unresolved()) {
1608 :
Expression(start_position, kVariableProxy),
1688 if (property->IsPrivateReference()) {
1689 DCHECK(!property->IsSuperAccess());
1694 switch (var->
mode()) {
1712 bool super_access =
property->IsSuperAccess();
1713 return (property->key()->IsPropertyName())
1748 arguments_(arguments.ToConstVector(), zone) {
1762 template <
class T,
int size>
1847 :
CallBase(zone, kCallNew, expression, arguments,
pos, has_spread) {}
1884 arguments_(arguments.ToConstVector(), zone) {
1962 size_t initial_subsequent_size)
2308 template <
typename IsolateT>
2669 :
Statement(
pos, kInitializeClassStaticElementsStatement),
2889 template <
typename IsolateT>
2933template <
class Sub
class>
2943 for (
int i = 0;
i < statements->
length();
i++) {
2950 for (
int i = 0;
i < expressions->
length();
i++) {
2956 if (expression !=
nullptr)
Visit(expression);
2961 Subclass*
impl() {
return static_cast<Subclass*
>(
this); }
2964#define GENERATE_VISIT_CASE(NodeType) \
2965 case AstNode::k##NodeType: \
2966 return this->impl()->Visit##NodeType(static_cast<NodeType*>(node));
2968#define GENERATE_FAILURE_CASE(NodeType) \
2969 case AstNode::k##NodeType: \
2972#define GENERATE_AST_VISITOR_SWITCH() \
2973 switch (node->node_type()) { \
2974 AST_NODE_LIST(GENERATE_VISIT_CASE) \
2975 FAILURE_NODE_LIST(GENERATE_FAILURE_CASE) \
2978#define DEFINE_AST_VISITOR_SUBCLASS_MEMBERS() \
2980 void VisitNoStackOverflowCheck(AstNode* node) { \
2981 GENERATE_AST_VISITOR_SWITCH() \
2984 void Visit(AstNode* node) { \
2985 if (CheckStackOverflow()) return; \
2986 VisitNoStackOverflowCheck(node); \
2989 void SetStackOverflow() { stack_overflow_ = true; } \
2990 void ClearStackOverflow() { stack_overflow_ = false; } \
2991 bool HasStackOverflow() const { return stack_overflow_; } \
2993 bool CheckStackOverflow() { \
2994 if (stack_overflow_) return true; \
2995 if (GetCurrentStackPosition() < stack_limit_) { \
2996 stack_overflow_ = true; \
3003 uintptr_t stack_limit() const { return stack_limit_; } \
3006 void InitializeAstVisitor(Isolate* isolate) { \
3007 stack_limit_ = isolate->stack_guard()->real_climit(); \
3008 stack_overflow_ = false; \
3011 void InitializeAstVisitor(uintptr_t stack_limit) { \
3012 stack_limit_ = stack_limit; \
3013 stack_overflow_ = false; \
3016 uintptr_t stack_limit_; \
3017 bool stack_overflow_
3019#define DEFINE_AST_VISITOR_MEMBERS_WITHOUT_STACKOVERFLOW() \
3021 void Visit(AstNode* node) { GENERATE_AST_VISITOR_SWITCH() } \
3059 return zone_->
New<
Block>(ignore_completion_value, is_breakable,
false);
3078#define STATEMENT_WITH_POSITION(NodeType) \
3079 NodeType* New##NodeType(int pos) { return zone_->New<NodeType>(pos); }
3083#undef STATEMENT_WITH_POSITION
3091 switch (visit_mode) {
3264 uint32_t boilerplate_properties,
int pos,
bool has_rest_property,
3267 pos, has_rest_property, home_object);
3272 bool is_computed_name) {
3279 bool is_computed_name) {
3295 int first_spread_index,
int pos) {
3325 bool optional_chain =
false) {
3331 bool has_spread,
int eval_scope_info_index = 0,
3332 bool optional_chain =
false) {
3335 eval_scope_info_index, optional_chain);
3382 size_t initial_subsequent_size) {
3424 if (op != Token::kInit && target->IsVariableProxy()) {
3425 target->AsVariableProxy()->set_is_assigned();
3428 if (op == Token::kAssign || op == Token::kInit) {
3465 bool has_braces,
int function_literal_id,
3472 function_literal_id, produced_preparse_data);
3494 accessor_storage_name_proxy);
3499 bool is_static,
bool is_computed_name,
bool is_private) {
3501 is_computed_name, is_private);
3505 bool is_static,
bool is_computed_name,
bool is_private) {
3507 is_static, is_computed_name,
3517 Block* static_block) {
3527 int start_position,
int end_position,
bool has_static_computed_names,
3530 scope, extends, constructor, public_members, private_members,
3531 static_initializer, instance_members_initializer_function,
3532 start_position, end_position, has_static_computed_names, is_anonymous,
3533 home_object, static_home_object);
3623#define DECLARE_NODE_FUNCTIONS(type) \
3624 bool AstNode::Is##type() const { return node_type() == AstNode::k##type; } \
3625 type* AstNode::As##type() { \
3626 return node_type() == AstNode::k##type ? reinterpret_cast<type*>(this) \
3629 const type* AstNode::As##type() const { \
3630 return node_type() == AstNode::k##type \
3631 ? reinterpret_cast<const type*>(this) \
3636#undef DECLARE_NODE_FUNCTIONS
#define DEF_FORWARD_DECLARATION(type)
#define DECLARE_TYPE_ENUM(type)
#define STATEMENT_WITH_POSITION(NodeType)
#define FAILURE_NODE_LIST(V)
#define DECLARE_NODE_FUNCTIONS(type)
static constexpr T decode(U value)
static constexpr U encode(T value)
static V8_NODISCARD constexpr U update(U previous, T value)
AggregateLiteral(int pos, NodeType type)
@ kIsShallowAndDisableMementos
@ kNeedsInitialAllocationSite
int first_spread_index() const
bool IsFastCloningSupported() const
ArrayLiteralBoilerplateBuilder(const ZonePtrList< Expression > *values, int first_spread_index)
DirectHandle< ArrayBoilerplateDescription > boilerplate_description() const
const ZonePtrList< Expression > * values_
IndirectHandle< ArrayBoilerplateDescription > boilerplate_description_
int ComputeFlags(bool disable_mementos=false) const
void BuildBoilerplateDescription(IsolateT *isolate)
Handle< ArrayBoilerplateDescription > GetOrBuildBoilerplateDescription(IsolateT *isolate)
const ArrayLiteralBoilerplateBuilder * builder() const
ArrayLiteralBoilerplateBuilder builder_
ArrayLiteral(Zone *zone, const ScopedPtrList< Expression > &values, int first_spread_index, int pos)
ArrayLiteralBoilerplateBuilder * builder()
const ZonePtrList< Expression > * values() const
ZonePtrList< Expression > values_
void set_lookup_hoisting_mode(LookupHoistingMode mode)
Expression * target() const
Expression * value() const
LookupHoistingMode lookup_hoisting_mode() const
Assignment(NodeType type, Token::Value op, Expression *target, Expression *value, int pos)
IndirectHandle< String > GetString(IsolateT *isolate)
Variable * CopyVariable(Variable *variable)
FunctionLiteral * NewFunctionLiteral(const AstRawString *name, DeclarationScope *scope, const ScopedPtrList< Statement > &body, int expected_property_count, int parameter_count, int function_length, FunctionLiteral::ParameterFlag has_duplicate_parameters, FunctionSyntaxKind function_syntax_kind, FunctionLiteral::EagerCompileHint eager_compile_hint, int position, bool has_braces, int function_literal_id, ProducedPreparseData *produced_preparse_data=nullptr)
Block * NewBlock(bool ignore_completion_value, bool is_breakable)
ImportCallExpression * NewImportCallExpression(Expression *specifier, ModuleImportPhase phase, int pos)
AstValueFactory * ast_value_factory_
SuperCallForwardArgs * NewSuperCallForwardArgs(SuperCallReference *expression, int pos)
Conditional * NewConditional(Expression *condition, Expression *then_expression, Expression *else_expression, int position)
Literal * NewStringLiteral(const AstRawString *string, int pos)
Await * NewAwait(Expression *expression, int pos)
Block * NewParameterInitializationBlock(const ScopedPtrList< Statement > &statements)
FunctionDeclaration * NewFunctionDeclaration(FunctionLiteral *fun, int pos)
ClassLiteral::Property * NewClassLiteralProperty(Expression *key, Expression *value, ClassLiteralProperty::Kind kind, bool is_static, bool is_computed_name, bool is_private)
BreakStatement * NewBreakStatement(BreakableStatement *target, int pos)
Call * NewTaggedTemplate(Expression *expression, const ScopedPtrList< Expression > &arguments, int pos)
Throw * NewThrow(Expression *exception, int pos)
WithStatement * NewWithStatement(Scope *scope, Expression *expression, Statement *statement, int pos)
class FailureExpression * FailureExpression()
GetTemplateObject * NewGetTemplateObject(const ZonePtrList< const AstRawString > *cooked_strings, const ZonePtrList< const AstRawString > *raw_strings, int pos)
ReturnStatement * NewAsyncReturnStatement(Expression *expression, int pos, int end_position=ReturnStatement::kFunctionLiteralReturnPosition)
class FailureExpression * failure_expression_
class EmptyStatement * EmptyStatement()
TryCatchStatement * NewTryCatchStatement(Block *try_block, Scope *scope, Block *catch_block, int pos)
NestedVariableDeclaration * NewNestedVariableDeclaration(Scope *scope, int pos)
VariableProxy * CopyVariableProxy(VariableProxy *proxy)
SloppyBlockFunctionStatement * NewSloppyBlockFunctionStatement(int pos, Variable *var, Token::Value init)
TryCatchStatement * NewTryCatchStatementForReplAsyncAwait(Block *try_block, Scope *scope, Block *catch_block, int pos)
ClassLiteral::Property * NewClassLiteralProperty(Expression *key, Expression *value, AutoAccessorInfo *auto_accessor_info, bool is_static, bool is_computed_name, bool is_private)
Property * NewProperty(Expression *obj, Expression *key, int pos, bool optional_chain=false)
ClassLiteral * NewClassLiteral(ClassScope *scope, Expression *extends, FunctionLiteral *constructor, ZonePtrList< ClassLiteral::Property > *public_members, ZonePtrList< ClassLiteral::Property > *private_members, FunctionLiteral *static_initializer, FunctionLiteral *instance_members_initializer_function, int start_position, int end_position, bool has_static_computed_names, bool is_anonymous, Variable *home_object, Variable *static_home_object)
ObjectLiteral::Property * NewObjectLiteralProperty(Expression *key, Expression *value, bool is_computed_name)
RegExpLiteral * NewRegExpLiteral(const AstRawString *pattern, int flags, int pos)
AutoAccessorSetterBody * NewAutoAccessorSetterBody(VariableProxy *name_proxy, int pos)
ClassLiteral::StaticElement * NewClassLiteralStaticElement(ClassLiteral::Property *property)
DebuggerStatement * NewDebuggerStatement(int pos)
ForEachStatement * NewForEachStatement(ForEachStatement::VisitMode visit_mode, int pos)
CallRuntime * NewCallRuntime(Runtime::FunctionId id, const ScopedPtrList< Expression > &arguments, int pos)
ContinueStatement * NewContinueStatement(IterationStatement *target, int pos)
SuperCallReference * NewSuperCallReference(VariableProxy *new_target_var, VariableProxy *this_function_var, int pos)
BinaryOperation * NewBinaryOperation(Token::Value op, Expression *left, Expression *right, int pos)
EmptyParentheses * NewEmptyParentheses(int pos)
ArrayLiteral * NewArrayLiteral(const ScopedPtrList< Expression > &values, int first_spread_index, int pos)
Literal * NewNullLiteral(int pos)
class ThisExpression * NewThisExpression(int pos)
ReturnStatement * NewReturnStatement(Expression *expression, int pos, int end_position=ReturnStatement::kFunctionLiteralReturnPosition)
InitializeClassMembersStatement * NewInitializeClassMembersStatement(ZonePtrList< ClassLiteral::Property > *args, int pos)
IfStatement * NewIfStatement(Expression *condition, Statement *then_statement, Statement *else_statement, int pos)
SwitchStatement * NewSwitchStatement(Expression *tag, int pos)
Assignment * NewAssignment(Token::Value op, Expression *target, Expression *value, int pos)
Suspend * NewYield(Expression *expression, int pos, Suspend::OnAbruptResume on_abrupt_resume)
class ThisExpression * ThisExpression()
Block * NewBlock(bool ignore_completion_value, const ScopedPtrList< Statement > &statements)
ForOfStatement * NewForOfStatement(int pos, IteratorType type)
ImportCallExpression * NewImportCallExpression(Expression *specifier, ModuleImportPhase phase, Expression *import_options, int pos)
AutoAccessorGetterBody * NewAutoAccessorGetterBody(VariableProxy *name_proxy, int pos)
Literal * NewUndefinedLiteral(int pos)
AstNodeFactory(AstValueFactory *ast_value_factory, Zone *zone)
InitializeClassStaticElementsStatement * NewInitializeClassStaticElementsStatement(ZonePtrList< ClassLiteral::StaticElement > *args, int pos)
ObjectLiteral::Property * NewObjectLiteralProperty(Expression *key, Expression *value, ObjectLiteralProperty::Kind kind, bool is_computed_name)
TryCatchStatement * NewTryCatchStatementForReThrow(Block *try_block, Scope *scope, Block *catch_block, int pos)
CaseClause * NewCaseClause(Expression *label, const ScopedPtrList< Statement > &statements)
VariableDeclaration * NewVariableDeclaration(int pos)
VariableProxy * NewVariableProxy(Variable *var, int start_position=kNoSourcePosition)
Literal * NewBooleanLiteral(bool b, int pos)
AstValueFactory * ast_value_factory() const
TryFinallyStatement * NewTryFinallyStatement(Block *try_block, Block *finally_block, int pos)
Call * NewCall(Expression *expression, const ScopedPtrList< Expression > &arguments, int pos, bool has_spread, int eval_scope_info_index=0, bool optional_chain=false)
TryCatchStatement * NewTryCatchStatementForAsyncAwait(Block *try_block, Scope *scope, Block *catch_block, int pos)
UnaryOperation * NewUnaryOperation(Token::Value op, Expression *expression, int pos)
CompareOperation * NewCompareOperation(Token::Value op, Expression *left, Expression *right, int pos)
CallRuntime * NewCallRuntime(const Runtime::Function *function, const ScopedPtrList< Expression > &arguments, int pos)
Literal * NewConsStringLiteral(AstConsString *string, int pos)
Literal * NewNumberLiteral(double number, int pos)
AutoAccessorInfo * NewAutoAccessorInfo(FunctionLiteral *generated_getter, FunctionLiteral *generated_setter, VariableProxy *accessor_storage_name_proxy)
ArrayLiteral * NewArrayLiteral(const ScopedPtrList< Expression > &values, int pos)
VariableProxy * NewVariableProxy(const AstRawString *name, VariableKind variable_kind, int start_position=kNoSourcePosition)
YieldStar * NewYieldStar(Expression *expression, int pos)
Literal * NewSmiLiteral(int number, int pos)
AstNodeFactory * ast_node_factory()
FunctionLiteral * NewScriptOrEvalFunctionLiteral(DeclarationScope *scope, const ScopedPtrList< Statement > &body, int expected_property_count, int parameter_count)
CallNew * NewCallNew(Expression *expression, const ScopedPtrList< Expression > &arguments, int pos, bool has_spread)
Literal * NewBigIntLiteral(AstBigInt bigint, int pos)
class EmptyStatement * empty_statement_
SuperPropertyReference * NewSuperPropertyReference(VariableProxy *home_object_var, int pos)
TemplateLiteral * NewTemplateLiteral(const ZonePtrList< const AstRawString > *string_parts, const ZonePtrList< Expression > *substitutions, int pos)
Spread * NewSpread(Expression *expression, int pos, int expr_pos)
OptionalChain * NewOptionalChain(Expression *expression)
Block * NewBlock(int capacity, bool ignore_completion_value)
ReturnStatement * NewSyntheticAsyncReturnStatement(Expression *expression, int pos, int end_position=ReturnStatement::kFunctionLiteralReturnPosition)
ObjectLiteral * NewObjectLiteral(const ScopedPtrList< ObjectLiteral::Property > &properties, uint32_t boilerplate_properties, int pos, bool has_rest_property, Variable *home_object=nullptr)
NativeFunctionLiteral * NewNativeFunctionLiteral(const AstRawString *name, v8::Extension *extension, int pos)
class ThisExpression * this_expression_
CountOperation * NewCountOperation(Token::Value op, bool is_prefix, Expression *expr, int pos)
ExpressionStatement * NewExpressionStatement(Expression *expression, int pos)
NaryOperation * NewNaryOperation(Token::Value op, Expression *first, size_t initial_subsequent_size)
ClassLiteral::StaticElement * NewClassLiteralStaticElement(Block *static_block)
Literal * NewTheHoleLiteral()
ConditionalChain * NewConditionalChain(size_t initial_size, int pos)
AstNode(int position, NodeType type)
MaterializedLiteral * AsMaterializedLiteral()
NodeType node_type() const
IterationStatement * AsIterationStatement()
AstConsString * empty_cons_string() const
V8_EXPORT_PRIVATE AstConsString * NewConsString()
void VisitStatements(const ZonePtrList< Statement > *statements)
void Visit(AstNode *node)
void VisitDeclarations(Declaration::List *declarations)
void VisitExpressions(const ZonePtrList< Expression > *expressions)
VariableProxy * name_proxy_
VariableProxy * name_proxy() const
AutoAccessorGetterBody(VariableProxy *name_proxy, int pos)
void set_property_private_name_proxy(VariableProxy *property_private_name_proxy)
VariableProxy * accessor_storage_name_proxy_
FunctionLiteral * generated_getter() const
FunctionLiteral * generated_setter() const
FunctionLiteral * generated_getter_
VariableProxy * property_private_name_proxy_
VariableProxy * property_private_name_proxy() const
VariableProxy * accessor_storage_name_proxy() const
FunctionLiteral * generated_setter_
AutoAccessorInfo(FunctionLiteral *generated_getter, FunctionLiteral *generated_setter, VariableProxy *accessor_storage_name_proxy)
AutoAccessorSetterBody(VariableProxy *name_proxy, int pos)
VariableProxy * name_proxy_
VariableProxy * name_proxy() const
Await(Expression *expression, int pos)
Expression * right() const
Expression * left() const
bool IsSmiLiteralOperation(Expression **subexpr, Tagged< Smi > *literal)
BinaryOperation(Token::Value op, Expression *left, Expression *right, int pos)
void InitializeStatements(const ScopedPtrList< Statement > &statements, Zone *zone)
bool ignore_completion_value() const
void set_scope(Scope *scope)
Block(bool ignore_completion_value, bool is_breakable, bool is_initialization_block_for_parameters)
Block(Zone *zone, int capacity, bool ignore_completion_value, bool is_breakable, bool is_initialization_block_for_parameters)
bool is_breakable() const
ZonePtrList< Statement > * statements()
ZonePtrList< Statement > statements_
bool is_initialization_block_for_parameters() const
BreakableStatement * target() const
BreakStatement(BreakableStatement *target, int pos)
BreakableStatement * target_
BreakableStatement(int position, NodeType type)
SpreadPosition spread_position() const
void ComputeSpreadPosition()
CallBase(Zone *zone, NodeType type, Expression *expression, const ScopedPtrList< Expression > &arguments, int pos, bool has_spread)
const ZonePtrList< Expression > * arguments() const
ZonePtrList< Expression > arguments_
Expression * expression() const
CallNew(Zone *zone, Expression *expression, const ScopedPtrList< Expression > &arguments, int pos, bool has_spread)
CallRuntime(Zone *zone, const Runtime::Function *function, const ScopedPtrList< Expression > &arguments, int pos)
ZonePtrList< Expression > arguments_
const ZonePtrList< Expression > * arguments() const
const Runtime::Function * function_
const Runtime::Function * function() const
bool is_optional_chain_link() const
bool is_tagged_template() const
bool is_possibly_eval() const
CallType GetCallType() const
Call(Zone *zone, Expression *expression, const ScopedPtrList< Expression > &arguments, int pos, bool has_spread, int eval_scope_info_index, bool optional_chain)
@ PRIVATE_OPTIONAL_CHAIN_CALL
@ KEYED_OPTIONAL_CHAIN_PROPERTY_CALL
@ NAMED_SUPER_PROPERTY_CALL
@ KEYED_SUPER_PROPERTY_CALL
@ NAMED_OPTIONAL_CHAIN_PROPERTY_CALL
Call(Zone *zone, Expression *expression, const ScopedPtrList< Expression > &arguments, int pos, TaggedTemplateTag tag)
void adjust_eval_scope_info_index(int delta)
uint32_t eval_scope_info_index() const
CaseClause(Zone *zone, Expression *label, const ScopedPtrList< Statement > &statements)
Expression * label() const
ZonePtrList< Statement > * statements()
ZonePtrList< Statement > statements_
void set_computed_name_proxy(VariableProxy *proxy)
bool is_auto_accessor() const
VariableProxy * private_or_computed_name_proxy_
Variable * computed_name_var() const
Variable * private_name_var() const
AutoAccessorInfo * auto_accessor_info()
AutoAccessorInfo * auto_accessor_info_
ClassLiteralProperty(Expression *key, Expression *value, Kind kind, bool is_static, bool is_computed_name, bool is_private)
void SetPrivateNameProxy(VariableProxy *proxy)
ClassLiteralProperty * property_
ClassLiteralStaticElement(Block *static_block)
ClassLiteralStaticElement(ClassLiteralProperty *property)
ClassLiteralProperty * property() const
Block * static_block() const
Variable * static_home_object_
bool has_static_computed_names() const
ZonePtrList< Property > * private_members_
FunctionLiteral * constructor_
Variable * static_home_object() const
ClassLiteral(ClassScope *scope, Expression *extends, FunctionLiteral *constructor, ZonePtrList< Property > *public_members, ZonePtrList< Property > *private_members, FunctionLiteral *static_initializer, FunctionLiteral *instance_members_initializer_function, int start_position, int end_position, bool has_static_computed_names, bool is_anonymous, Variable *home_object, Variable *static_home_object)
int start_position() const
FunctionLiteral * static_initializer_
ZonePtrList< Property > * public_members() const
FunctionLiteral * instance_members_initializer_function() const
bool IsAnonymousFunctionDefinition() const
ZonePtrList< Property > * private_members() const
Variable * home_object() const
ClassScope * scope() const
Expression * extends() const
FunctionLiteral * instance_members_initializer_function_
ZonePtrList< Property > * public_members_
FunctionLiteral * static_initializer() const
FunctionLiteral * constructor() const
bool is_anonymous_expression() const
bool IsLiteralCompareEqualVariable(Expression **expr, Literal **literal)
Expression * left() const
bool IsLiteralStrictCompareBoolean(Expression **expr, Literal **literal)
CompareOperation(Token::Value op, Expression *left, Expression *right, int pos)
bool IsLiteralCompareUndefined(Expression **expr)
bool IsLiteralCompareNull(Expression **expr)
Expression * right() const
BinaryOperation * binary_operation() const
CompoundAssignment(Token::Value op, Expression *target, Expression *value, int pos, BinaryOperation *binary_operation)
BinaryOperation * binary_operation_
ConditionalChain(Zone *zone, size_t initial_size, int pos)
int condition_position_at(size_t index) const
Expression * else_expression() const
Expression * condition_at(size_t index) const
size_t conditional_chain_length() const
void set_else_expression(Expression *s)
void AddChainEntry(Expression *cond, Expression *then, int pos)
ZoneVector< ConditionalChainEntry > conditional_chain_entries_
Expression * then_expression_at(size_t index) const
Expression * else_expression_
Expression * else_expression_
Expression * then_expression() const
Expression * condition() const
Expression * then_expression_
Conditional(Expression *condition, Expression *then_expression, Expression *else_expression, int position)
Expression * else_expression() const
IterationStatement * target_
IterationStatement * target() const
ContinueStatement(IterationStatement *target, int pos)
CountOperation(Token::Value op, bool is_prefix, Expression *expr, int pos)
Expression * expression() const
DebuggerStatement(int pos)
Declaration(int pos, NodeType type)
void set_var(Variable *var)
void Initialize(Expression *cond, Statement *body)
Expression * cond() const
DoWhileStatement(int pos)
EmptyParentheses(int pos)
Expression * expression() const
void set_expression(Expression *e)
ExpressionStatement(Expression *expression, int pos)
bool ToBooleanIsFalse() const
bool IsUndefinedLiteral() const
bool IsAccessorFunctionDefinition() const
bool IsBooleanLiteral() const
bool is_parenthesized() const
bool IsValidReferenceExpression() const
bool IsPrivateName() const
bool IsNullOrUndefinedLiteral() const
bool IsAnonymousFunctionDefinition() const
void clear_parenthesized()
void mark_parenthesized()
bool IsCompileTimeValue()
V8_EXPORT_PRIVATE bool IsNumberLiteral() const
Expression(int pos, NodeType type)
bool IsStringLiteral() const
bool IsConsStringLiteral() const
bool ToBooleanIsTrue() const
bool IsTheHoleLiteral() const
bool IsNullLiteral() const
bool IsLiteralButNotNullOrUndefined() const
bool IsSmiLiteral() const
bool IsConciseMethodDefinition() const
bool IsPropertyName() const
void Initialize(Expression *each, Expression *subject, Statement *body, Scope *subject_scope)
Expression * each() const
static const char * VisitModeString(VisitMode mode)
ForEachStatement(int pos, NodeType type)
Scope * subject_scope() const
Expression * subject() const
IteratorType type() const
ForOfStatement(int pos, IteratorType type)
void Initialize(Statement *init, Expression *cond, Statement *next, Statement *body)
Expression * cond() const
FunctionDeclaration(FunctionLiteral *fun, int pos)
FunctionLiteral * fun() const
void set_raw_name(const AstConsString *name)
FunctionSyntaxKind syntax_kind() const
bool has_shared_name() const
FunctionKind kind() const
int function_literal_id() const
bool IsAnonymousFunctionDefinition() const
int function_token_position() const
V8_EXPORT_PRIVATE void SetShouldEagerCompile()
void add_expected_properties(int number_properties)
void set_raw_inferred_name(AstConsString *raw_inferred_name)
bool has_duplicate_parameters() const
Handle< SharedFunctionInfo > shared_function_info() const
void set_class_scope_has_private_brand(bool value)
V8_EXPORT_PRIVATE LanguageMode language_mode() const
ZonePtrList< Statement > * body()
DeclarationScope * scope_
void set_requires_instance_members_initializer(bool value)
@ kHasDuplicateParameters
ProducedPreparseData * produced_preparse_data_
const AstConsString * raw_name_
MaybeHandle< String > GetName(IsolateT *isolate) const
ZonePtrList< Statement > body_
const AstConsString * raw_inferred_name()
FunctionLiteral(Zone *zone, const AstConsString *name, AstValueFactory *ast_value_factory, DeclarationScope *scope, const ScopedPtrList< Statement > &body, int expected_property_count, int parameter_count, int function_length, FunctionSyntaxKind function_syntax_kind, ParameterFlag has_duplicate_parameters, EagerCompileHint eager_compile_hint, int position, bool has_braces, int function_literal_id, ProducedPreparseData *produced_preparse_data=nullptr)
bool AllowsLazyCompilation()
void set_function_literal_id(int function_literal_id)
int start_position() const
AstConsString * raw_inferred_name_
bool has_static_private_methods_or_accessors() const
void set_should_parallel_compile()
IndirectHandle< SharedFunctionInfo > shared_function_info_
ProducedPreparseData * produced_preparse_data() const
int expected_property_count_
bool class_scope_has_private_brand() const
bool is_anonymous_expression() const
int expected_property_count()
Handle< String > GetInferredName(LocalIsolate *isolate) const
bool private_name_lookup_skips_outer_class() const
Handle< String > GetInferredName(Isolate *isolate)
const AstConsString * raw_name() const
bool requires_instance_members_initializer() const
void set_suspend_count(int suspend_count)
bool should_parallel_compile() const
DeclarationScope * scope() const
V8_EXPORT_PRIVATE bool ShouldEagerCompile() const
void set_function_token_position(int pos)
int function_token_position_
void set_has_static_private_methods_or_accessors(bool value)
std::unique_ptr< char[]> GetDebugName() const
void set_shared_function_info(Handle< SharedFunctionInfo > shared_function_info)
const ZonePtrList< const AstRawString > * cooked_strings_
const ZonePtrList< const AstRawString > * raw_strings() const
Handle< TemplateObjectDescription > GetOrBuildDescription(IsolateT *isolate)
const ZonePtrList< const AstRawString > * cooked_strings() const
const ZonePtrList< const AstRawString > * raw_strings_
GetTemplateObject(const ZonePtrList< const AstRawString > *cooked_strings, const ZonePtrList< const AstRawString > *raw_strings, int pos)
Statement * then_statement() const
Statement * else_statement_
void set_else_statement(Statement *s)
Statement * else_statement() const
bool HasThenStatement() const
bool HasElseStatement() const
Statement * then_statement_
IfStatement(Expression *condition, Statement *then_statement, Statement *else_statement, int pos)
Expression * condition() const
void set_then_statement(Statement *s)
ModuleImportPhase phase() const
Expression * specifier() const
ImportCallExpression(Expression *specifier, ModuleImportPhase phase, Expression *import_options, int pos)
Expression * import_options_
Expression * import_options() const
ImportCallExpression(Expression *specifier, ModuleImportPhase phase, int pos)
ZonePtrList< StaticElement > * elements() const
ZonePtrList< StaticElement > * elements_
InitializeClassStaticElementsStatement(ZonePtrList< StaticElement > *elements, int pos)
IterationStatement(int pos, NodeType type)
void Initialize(Statement *body)
void set_body(Statement *s)
JumpStatement(int pos, NodeType type)
LiteralBoilerplateBuilder()
void set_needs_initial_allocation_site(bool required)
void set_boilerplate_descriptor_kind(ElementsKind kind)
ElementsKind boilerplate_descriptor_kind() const
bool is_initialized() const
int ComputeFlags(bool disable_mementos=false) const
void set_is_simple(bool is_simple)
static DirectHandle< Object > GetBoilerplateValue(Expression *expression, IsolateT *isolate)
bool needs_initial_allocation_site() const
static constexpr int kDepthKindBits
void BuildConstants(IsolateT *isolate, MaterializedLiteral *expr)
static void InitDepthAndFlags(MaterializedLiteral *expr)
void set_depth(DepthKind depth)
LiteralProperty(Expression *key, Expression *value, bool is_computed_name)
Expression * value() const
bool NeedsSetFunctionName() const
base::PointerWithPayload< Expression, bool, 1 > key_and_is_computed_name_
bool is_computed_name() const
bool AsArrayIndex(uint32_t *index) const
static bool Match(void *literal1, void *literal2)
Tagged< Smi > AsSmiLiteral() const
bool ToUint32(uint32_t *value) const
Literal(double number, int position)
const AstRawString * AsRawPropertyName()
DirectHandle< Object > BuildValue(IsolateT *isolate) const
Literal(bool boolean, int position)
Literal(const AstRawString *string, int position)
Literal(AstConsString *string, int position)
AstBigInt AsBigInt() const
bool IsConsString() const
Literal(int smi, int position)
AstConsString * AsConsString()
Literal(Type type, int position)
bool IsPropertyName() const
const AstRawString * AsRawString()
bool ToBooleanIsFalse() const
Literal(AstBigInt bigint, int position)
V8_EXPORT_PRIVATE bool ToBooleanIsTrue() const
bool AsBooleanLiteral() const
const AstRawString * string_
AstConsString * cons_string_
bool NeedsInitialAllocationSite()
friend class CompileTimeValue
MaterializedLiteral(int pos, NodeType type)
Expression * subsequent(size_t index) const
int subsequent_op_position(size_t index) const
void AddSubsequent(Expression *expr, int pos)
NaryOperation(Zone *zone, Token::Value op, Expression *first, size_t initial_subsequent_size)
ZoneVector< NaryOperationEntry > subsequent_
size_t subsequent_length() const
Expression * first() const
v8::Extension * extension() const
DirectHandle< String > name() const
NativeFunctionLiteral(const AstRawString *name, v8::Extension *extension, int pos)
const AstRawString * raw_name() const
const AstRawString * name_
v8::Extension * extension_
NestedVariableDeclaration(Scope *scope, int pos)
void set_has_elements(bool has_elements)
const ZonePtrList< Property > * properties() const
bool has_rest_property() const
ObjectLiteralBoilerplateBuilder(ZoneList< Property * > *properties, uint32_t boilerplate_properties, bool has_rest_property)
void BuildBoilerplateDescription(IsolateT *isolate)
bool has_elements() const
int properties_count() const
Handle< ObjectBoilerplateDescription > GetOrBuildBoilerplateDescription(IsolateT *isolate)
ZoneList< Property * > * properties_
uint32_t boilerplate_properties_
bool has_null_prototype() const
void InitFlagsForPendingNullPrototype(int i)
bool IsFastCloningSupported() const
DirectHandle< ObjectBoilerplateDescription > boilerplate_description() const
bool fast_elements() const
IndirectHandle< ObjectBoilerplateDescription > boilerplate_description_
int ComputeFlags(bool disable_mementos=false) const
void set_has_null_protoype(bool has_null_prototype)
void set_fast_elements(bool fast_elements)
bool IsEmptyObjectLiteral() const
void set_emit_store(bool emit_store)
bool IsNullPrototype() const
bool IsCompileTimeValue() const
ObjectLiteralProperty(Expression *key, Expression *value, Kind kind, bool is_computed_name)
const ObjectLiteralBoilerplateBuilder * builder() const
ObjectLiteralBoilerplateBuilder * builder()
ObjectLiteralBoilerplateBuilder builder_
ObjectLiteral(Zone *zone, const ScopedPtrList< Property > &properties, uint32_t boilerplate_properties, int pos, bool has_rest_property, Variable *home_object)
ZoneList< Property * > * properties()
ZoneList< Property * > properties_
void CalculateEmitStore(Zone *zone)
Variable * home_object() const
OptionalChain(Expression *expression)
Expression * expression() const
Property(Expression *obj, Expression *key, int pos, bool optional_chain)
static AssignType GetAssignType(Property *property)
bool is_optional_chain_link() const
bool IsPrivateReference() const
bool IsValidReferenceExpression() const
const AstRawString * raw_pattern() const
DirectHandle< String > pattern() const
const AstRawString *const pattern_
RegExpLiteral(const AstRawString *pattern, int flags, int pos)
Expression * expression() const
static constexpr int kFunctionLiteralReturnPosition
bool is_async_return() const
bool is_synthetic_async_return() const
ReturnStatement(Expression *expression, Type type, int pos, int end_position)
static V8_EXPORT_PRIVATE const Function * FunctionForId(FunctionId id)
SloppyBlockFunctionStatement * next_
Token::Value init() const
SloppyBlockFunctionStatement ** next()
const AstRawString * name() const
void set_statement(Statement *statement)
SloppyBlockFunctionStatement(int pos, Variable *var, Token::Value init, Statement *statement)
Statement * statement() const
static constexpr Tagged< Smi > FromInt(int value)
Expression * expression() const
int expression_position() const
Spread(Expression *expression, int pos, int expr_pos)
Statement(int position, NodeType type)
SuperCallForwardArgs(Zone *zone, SuperCallReference *expression, int pos)
SuperCallReference * expression_
SuperCallReference * expression() const
VariableProxy * new_target_var() const
SuperCallReference(VariableProxy *new_target_var, VariableProxy *this_function_var, int pos)
VariableProxy * this_function_var_
VariableProxy * this_function_var() const
VariableProxy * new_target_var_
SuperPropertyReference(VariableProxy *home_object, int pos)
VariableProxy * home_object_
VariableProxy * home_object() const
Expression * expression() const
OnAbruptResume on_abrupt_resume() const
Suspend(NodeType node_type, Expression *expression, int pos, OnAbruptResume on_abrupt_resume)
ZonePtrList< CaseClause > cases_
void set_tag(Expression *t)
SwitchStatement(Zone *zone, Expression *tag, int pos)
ZonePtrList< CaseClause > * cases()
const ZonePtrList< Expression > * substitutions_
const ZonePtrList< const AstRawString > * string_parts_
const ZonePtrList< const AstRawString > * string_parts() const
const ZonePtrList< Expression > * substitutions() const
TemplateLiteral(const ZonePtrList< const AstRawString > *parts, const ZonePtrList< Expression > *substitutions, int pos)
Expression * exception() const
Throw(Expression *exception, int pos)
static bool IsCompareOp(Value op)
static bool IsBinaryOp(Value op)
static bool IsUnaryOp(Value op)
static Value BinaryOpForAssignment(Value op)
static bool IsAssignmentOp(Value token)
void set_catch_block(Block *b)
HandlerTable::CatchPrediction GetCatchPrediction(HandlerTable::CatchPrediction outer_catch_prediction) const
bool ShouldClearException(HandlerTable::CatchPrediction outer_catch_prediction) const
Block * catch_block() const
bool is_try_catch_for_async()
HandlerTable::CatchPrediction catch_prediction_
TryCatchStatement(Block *try_block, Scope *scope, Block *catch_block, HandlerTable::CatchPrediction catch_prediction, int pos)
Block * finally_block() const
TryFinallyStatement(Block *try_block, Block *finally_block, int pos)
void set_finally_block(Block *b)
Block * try_block() const
void set_try_block(Block *b)
TryStatement(Block *try_block, int pos, NodeType type)
UnaryOperation(Token::Value op, Expression *expression, int pos)
Expression * expression() const
VariableDeclaration(int pos, bool is_nested=false)
NestedVariableDeclaration * AsNested()
bool is_home_object() const
void mark_removed_from_unresolved()
bool is_new_target() const
void BindTo(Variable *var)
bool IsValidReferenceExpression() const
V8_INLINE VariableProxy * next_unresolved()
bool IsPrivateName() const
const AstRawString * raw_name() const
V8_INLINE VariableProxy ** next()
VariableProxy(const AstRawString *name, VariableKind variable_kind, int start_position)
HoleCheckMode hole_check_mode() const
Scanner::Location location()
void set_is_home_object()
void set_var(Variable *v)
V8_INLINE bool is_removed_from_unresolved() const
VariableProxy * next_unresolved_
DirectHandle< String > name() const
const AstRawString * raw_name_
void set_needs_hole_check()
VariableMode mode() const
const AstRawString * raw_name() const
Expression * cond() const
void Initialize(Expression *cond, Statement *body)
void set_statement(Statement *s)
Statement * statement() const
Expression * expression() const
WithStatement(Scope *scope, Expression *expression, Statement *statement, int pos)
YieldStar(Expression *expression, int pos)
Yield(Expression *expression, int pos, OnAbruptResume on_abrupt_resume)
V8_INLINE int length() const
base::Vector< const DirectHandle< Object > > args
ZoneVector< RpoNumber > & result
FunctionLiteral * literal
constexpr bool IsInRange(T value, U lower_limit, U higher_limit)
constexpr int kNoSourcePosition
@ kPrivateGetterAndSetter
@ PRIVATE_GETTER_AND_SETTER
bool IsResumableFunction(FunctionKind kind)
@ FIRST_FAST_ELEMENTS_KIND
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in name
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in allocation gc speed threshold for starting incremental marking via a task in percent of available threshold for starting incremental marking immediately in percent of available Use a single schedule for determining a marking schedule between JS and C objects schedules the minor GC task with kUserVisible priority max worker number of concurrent for NumberOfWorkerThreads start background threads that allocate memory concurrent_array_buffer_sweeping use parallel threads to clear weak refs in the atomic pause trace progress of the incremental marking trace object counts and memory usage report a tick only when allocated zone memory changes by this amount TracingFlags::gc_stats TracingFlags::gc_stats track native contexts that are expected to be garbage collected verify heap pointers before and after GC memory reducer runs GC with ReduceMemoryFootprint flag Maximum number of memory reducer GCs scheduled Old gen GC speed is computed directly from gc tracer counters Perform compaction on full GCs based on V8 s default heuristics Perform compaction on every full GC Perform code space compaction when finalizing a full GC with stack Stress GC compaction to flush out bugs with moving objects flush of baseline code when it has not been executed recently Use time base code flushing instead of age Use a progress bar to scan large objects in increments when incremental marking is active force incremental marking for small heaps and run it more often force marking at random points between and force scavenge at random points between and reclaim otherwise unreachable unmodified wrapper objects when possible less compaction in non memory reducing mode use high priority threads for concurrent Marking Test mode only flag It allows an unit test to select evacuation candidates use incremental marking for CppHeap cppheap_concurrent_marking c value for membalancer A special constant to balance between memory and space tradeoff The smaller the more memory it uses enable use of SSE4 instructions if available enable use of AVX VNNI instructions if available enable use of POPCNT instruction if available force all emitted branches to be in long mode(MIPS/PPC only)") DEFINE_BOOL(partial_constant_pool
void Print(Tagged< Object > obj)
SharedFunctionInfo::HasStaticPrivateMethodsOrAccessorsBit SharedFunctionInfo::MaglevCompilationFailedBit SharedFunctionInfo::FunctionSyntaxKindBits has_duplicate_parameters
bool IsFastElementsKind(ElementsKind kind)
constexpr int kFunctionLiteralIdTopLevel
ZoneList< T * > ZonePtrList
template const char * string
#define DCHECK_NOT_NULL(val)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK_NE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
#define V8_EXPORT_PRIVATE
ConditionalChainEntry(Expression *cond, Expression *then, int pos)
Expression * then_expression
NaryOperationEntry(Expression *e, int pos)
static VariableProxy ** filter(VariableProxy **t)
static VariableProxy ** start(VariableProxy **head)
static VariableProxy ** next(VariableProxy *t)