5#ifndef V8_PARSING_PREPARSER_H_
6#define V8_PARSING_PREPARSER_H_
27class PreparseDataBuilder;
296 :
code_(expression_code) {}
390 if (expression.IsStringLiteral()) {
486 int js_flags,
int pos) {
490 int first_spread_index,
int pos) {
497 bool is_computed_name,
504 bool is_computed_name) {
509 bool is_computed_name) {
514 int pos,
bool has_rest_property,
Variable* home_object =
nullptr) {
531 bool optional_chain =
false) {
532 if (
key.IsIdentifier() &&
key.AsIdentifier().IsPrivateName()) {
595 bool has_spread,
int eval_scope_info_index = 0,
596 bool optional_chain =
false) {
597 if (eval_scope_info_index > 0) {
598 DCHECK(expression.IsIdentifier() && expression.AsIdentifier().IsEval());
606 int pos,
bool has_spread) {
626 bool has_braces,
int function_literal_id,
639 result.mark_parenthesized();
673 return else_statement.
IsJumpStatement() ? then_statement : else_statement;
880 parsing_on_main_thread,
952 int* num_parameters,
int* function_length,
986 return expression.IsPrivateReference();
1008 int initializer_position) {
1020 return scope->DeclarePrivateName(name, mode, is_static_flag, was_added);
1029 if (var ==
nullptr) {
1039 nested_declaration->
set_var(var);
1057 const SourceRange& finally_range,
const CatchInfo& catch_info,
int pos) {
1078 function_scope->
LookupLocal(function_name) ==
nullptr) {
1102 &was_added, beg_pos,
kind);
1108 end_pos, var, init);
1117 int class_token_pos,
int end_pos) {
1127 ClassInfo* class_info,
1128 int class_token_pos) {
1138 ClassInfo* class_info) {}
1145 bool is_static,
bool is_computed_name,
1146 ClassInfo* class_info) {
1147 if (is_computed_name) {
1151 class_info->computed_field_count),
1159 bool is_static, ClassInfo* class_info) {
1174 ClassInfo* class_info) {
1175 DCHECK(class_info->has_static_elements());
1194 ClassInfo* class_info,
int pos) {
1195 bool has_default_constructor = !class_info->has_seen_constructor;
1197 if (has_default_constructor) {
1198 bool has_extends = class_info->extends.IsNull();
1231 return expression.IsThisProperty();
1235 return expression.IsIdentifier();
1240 return expression.AsIdentifier();
1321 x->clear_parenthesized();
1345 const ForInfo& for_info) {
1347 for (
auto name : for_info.bound_names) {
1361 for (
auto name : for_info.bound_names) {
1364 inner_scope, &was_added);
1373 scope->HoistSloppyBlockFunctions(
nullptr);
1421 template <
typename T>
1423 return subject.IsNull();
1436 return subject.
string_->IsEmpty();
1513 int start_position) {
1537 bool is_static,
bool is_computed_name,
bool is_private,
int pos) {
1543 class_info->autoaccessor_count++),
1554 is_computed_name, is_private);
1571 int initializer_end_position,
1574 scope->RecordParameter(is_rest);
1612 return current_compile_hint;
1617#define DEFINE_RECORD_SOURCE_RANGE(Name) \
1618 template <typename... Ts> \
1619 V8_INLINE void Record##Name##SourceRange(Ts... args) {}
1621#undef DEFINE_RECORD_SOURCE_RANGE
#define AST_SOURCE_RANGE_LIST(V)
static constexpr T decode(U value)
static constexpr U encode(T value)
static V8_NODISCARD constexpr U update(U previous, T value)
NestedVariableDeclaration * NewNestedVariableDeclaration(Scope *scope, int pos)
SloppyBlockFunctionStatement * NewSloppyBlockFunctionStatement(int pos, Variable *var, Token::Value init)
VariableProxy * NewVariableProxy(Variable *var, int start_position=kNoSourcePosition)
void SetHasNonSimpleParameters()
void DeclareSloppyBlockFunction(SloppyBlockFunctionStatement *sloppy_block_function)
Variable * DeclareFunctionVar(const AstRawString *name, Scope *cache=nullptr)
void set_var(Variable *var)
Scanner * scanner() const
V8_INLINE void ParseStatementList(StatementListT *body, Token::Value end_token)
V8_INLINE DeclarationScope * GetDeclarationScope() const
V8_INLINE ExpressionScope * expression_scope() const
const AstRawString * ClassFieldVariableName(AstValueFactory *ast_value_factory, int index)
FunctionState * function_state_
DeclarationScope * NewFunctionScope(FunctionKind kind, Zone *parse_zone=nullptr) const
VariableMode GetVariableMode(ClassLiteralProperty::Kind kind)
typename Types::SourceRange SourceRange
typename Types::Statement StatementT
const AstRawString * AutoAccessorVariableName(AstValueFactory *ast_value_factory, int index)
int loop_nesting_depth() const
Types::Factory * factory()
AstValueFactory * ast_value_factory() const
PendingCompilationErrorHandler * pending_error_handler_
V8_NOINLINE void ReportMessageAt(Scanner::Location source_location, MessageTemplate message, const Ts &... args)
uintptr_t stack_limit() const
LanguageMode language_mode()
void set_unidentifiable_error()
PreParserBlock * operator->()
static PreParserBlock Null()
void set_scope(Scope *scope)
PreParserBlock(PreParserStatement::Type type)
static PreParserBlock Default()
PreParserExpressionList(std::vector< void * > *buffer)
void Add(const PreParserExpression &expression)
bool IsPrivateReference() const
void set_suspend_count(int suspend_count)
PreParserExpression * AsFunctionLiteral()
bool is_parenthesized() const
static PreParserExpression ThisProperty()
PreParserExpression(uint32_t expression_code)
bool IsIdentifier() const
static PreParserExpression Assignment()
void clear_parenthesized()
bool IsStringLiteral() const
static PreParserExpression ImportCall()
void set_function_token_position(int position)
static PreParserExpression Failure()
bool IsThisProperty() const
void mark_parenthesized()
PreParserExpression * operator->()
bool is_tagged_template() const
static PreParserExpression Call()
static PreParserExpression This()
static PreParserExpression Null()
bool IsFailureExpression() const
static PreParserExpression Property()
static PreParserExpression CallEval()
bool IsAssignment() const
static PreParserExpression FromIdentifier(const PreParserIdentifier &id)
static PreParserExpression SuperCallReference()
static PreParserExpression Default()
@ kArrayOrObjectLiteralExpression
@ kStringLiteralExpression
static PreParserExpression PrivateReference()
static PreParserExpression StringLiteral()
bool IsSuperCallReference() const
bool IsImportCallExpression() const
static PreParserExpression ObjectLiteral()
void SetShouldEagerCompile()
PreParserIdentifier AsIdentifier() const
@ kThisPropertyExpression
@ kThisPrivateReferenceExpression
@ kPrivateReferenceExpression
static PreParserExpression ThisPrivateReference()
PreParserExpression * AsCall()
static PreParserExpression ArrayLiteral()
bool IsFunctionLiteral() const
PreParserStatement NewForOfStatement(int pos, IteratorType type)
PreParserStatement NewDoWhileStatement(int pos)
PreParserStatement NewContinueStatement(PreParserStatement target, int pos, int continuation_pos=kNoSourcePosition)
PreParserExpression NewConditional(const PreParserExpression &condition, const PreParserExpression &then_expression, const PreParserExpression &else_expression, int pos)
PreParserBlock NewBlock(bool ignore_completion_value, const PreParserScopedStatementList &list)
PreParserExpression NewBinaryOperation(Token::Value op, const PreParserExpression &left, const PreParserExpression &right, int pos)
PreParserStatement NewSwitchStatement(const PreParserExpression &tag, int pos)
PreParserExpression NewSpread(const PreParserExpression &expression, int pos, int expr_pos)
PreParserExpression NewCallNew(const PreParserExpression &expression, const PreParserExpressionList &arguments, int pos, bool has_spread)
AstNodeFactory * ast_node_factory()
PreParserFactory(AstValueFactory *ast_value_factory, Zone *zone)
PreParserExpression NewYield(const PreParserExpression &expression, int pos, Suspend::OnAbruptResume on_abrupt_resume)
PreParserExpression NewNumberLiteral(double number, int pos)
PreParserStatement NewWithStatement(Scope *scope, const PreParserExpression &expression, PreParserStatement statement, int pos)
PreParserExpression NewConditionalChain(size_t initial_size, int pos)
PreParserExpression NewVariableProxy(void *variable)
PreParserExpression NewStringLiteral(const PreParserIdentifier &identifier, int pos)
PreParserExpression NewCall(PreParserExpression expression, const PreParserExpressionList &arguments, int pos, bool has_spread, int eval_scope_info_index=0, bool optional_chain=false)
PreParserExpression NewCountOperation(Token::Value op, bool is_prefix, const PreParserExpression &expression, int pos)
PreParserExpression NewObjectLiteralProperty(const PreParserExpression &key, const PreParserExpression &value, ObjectLiteralProperty::Kind kind, bool is_computed_name)
PreParserExpression NewOptionalChain(const PreParserExpression &expr)
PreParserStatement NewForEachStatement(ForEachStatement::VisitMode visit_mode, int pos)
PreParserExpression NewEmptyParentheses(int pos)
PreParserExpression NewFunctionLiteral(const PreParserIdentifier &name, Scope *scope, const PreParserScopedStatementList &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)
PreParserStatement NewExpressionStatement(const PreParserExpression &expr, int pos)
PreParserExpression NewImportCallExpression(const PreParserExpression &specifier, const ModuleImportPhase phase, const PreParserExpression &import_options, int pos)
AstNodeFactory ast_node_factory_
PreParserBlock NewBlock(int capacity, bool ignore_completion_value)
PreParserExpression NewCompareOperation(Token::Value op, const PreParserExpression &left, const PreParserExpression &right, int pos)
PreParserBlock NewBlock(bool ignore_completion_value, bool is_breakable)
PreParserExpression NewAwait(const PreParserExpression &expression, int pos)
PreParserStatement NewForStatement(int pos)
PreParserStatement NewCaseClause(const PreParserExpression &label, const PreParserScopedStatementList &statements)
PreParserExpression NewProperty(const PreParserExpression &obj, const PreParserExpression &key, int pos, bool optional_chain=false)
PreParserExpression NewObjectLiteralProperty(const PreParserExpression &key, const PreParserExpression &value, bool is_computed_name)
PreParserExpression NewUndefinedLiteral(int pos)
PreParserStatement NewAsyncReturnStatement(const PreParserExpression &expression, int pos, int continuation_pos=kNoSourcePosition)
PreParserExpression NewUnaryOperation(Token::Value op, const PreParserExpression &expression, int pos)
PreParserExpression NewRegExpLiteral(const AstRawString *js_pattern, int js_flags, int pos)
PreParserExpression NewTheHoleLiteral()
PreParserStatement NewWhileStatement(int pos)
PreParserStatement EmptyStatement()
PreParserExpression NewAssignment(Token::Value op, const PreParserExpression &left, const PreParserExpression &right, int pos)
PreParserExpression NewObjectLiteral(const PreParserExpressionList &properties, int boilerplate_properties, int pos, bool has_rest_property, Variable *home_object=nullptr)
PreParserStatement NewDebuggerStatement(int pos)
PreParserStatement NewReturnStatement(const PreParserExpression &expression, int pos, int continuation_pos=kNoSourcePosition)
PreParserExpression NewYieldStar(const PreParserExpression &iterable, int pos)
PreParserExpression NewClassLiteralProperty(const PreParserExpression &key, const PreParserExpression &value, ClassLiteralProperty::Kind kind, bool is_static, bool is_computed_name, bool is_private)
PreParserExpression NewImportCallExpression(const PreParserExpression &args, const ModuleImportPhase phase, int pos)
PreParserStatement NewBreakStatement(PreParserStatement target, int pos, int continuation_pos=kNoSourcePosition)
PreParserExpression NewArrayLiteral(const PreParserExpressionList &values, int first_spread_index, int pos)
PreParserStatement NewIfStatement(const PreParserExpression &condition, PreParserStatement then_statement, PreParserStatement else_statement, int pos, SourceRange then_range={}, SourceRange else_range={})
State & operator=(const State &)=delete
State(const State &)=delete
State(PreParserFuncNameInferrer *fni)
PreParserFuncNameInferrer(AstValueFactory *avf)
PreParserFuncNameInferrer(const PreParserFuncNameInferrer &)=delete
void RemoveAsyncKeywordFromEnd() const
PreParserFuncNameInferrer & operator=(const PreParserFuncNameInferrer &)=delete
void RemoveLastFunction() const
static PreParserIdentifier Eval()
static PreParserIdentifier Arguments()
static PreParserIdentifier Null()
bool IsPrivateName() const
bool IsEvalOrArguments() const
static PreParserIdentifier Async()
PreParserIdentifier(Type type)
const AstRawString * string_
static PreParserIdentifier PrivateName()
bool IsConstructor() const
static PreParserIdentifier Default()
static PreParserIdentifier Constructor()
void Add(const PreParserStatement &element)
PreParserScopedStatementList(std::vector< void * > *buffer)
void MergeInto(const PreParserScopedStatementList *other)
const PreParserSourceRange & Finalize() const
DISALLOW_IMPLICIT_CONSTRUCTORS(PreParserSourceRangeScope)
PreParserSourceRange range_
PreParserSourceRangeScope(Scanner *scanner, PreParserSourceRange *range)
static PreParserSourceRange Empty()
static const PreParserSourceRange & ContinuationOf(const PreParserSourceRange &that, int end)
PreParserSourceRange(int start, int end)
static PreParserSourceRange OpenEnded(int32_t start)
PreParserSourceRange()=default
PreParserStatementList(bool is_null)
void Add(const PreParserStatement &element, Zone *zone)
PreParserStatementList * operator->()
static PreParserStatementList Null()
void Initialize(const PreParserExpression &cond, PreParserStatement body, const SourceRange &body_range={})
@ kStringLiteralExpressionStatement
void set_scope(Scope *scope)
PreParserStatement(Type code)
static PreParserStatement Null()
static PreParserStatement Iteration()
PreParserStatement * operator->()
static PreParserStatement Default()
PreParserStatementList statements()
void Initialize(PreParserExpression each, const PreParserExpression &subject, PreParserStatement body, Scope *subject_scope)
static PreParserStatement Jump()
void InitializeStatements(const PreParserScopedStatementList &statements, Zone *zone)
bool IsIterationStatement()
static PreParserStatement ExpressionStatement(const PreParserExpression &expression)
PreParserStatementList cases()
void Initialize(PreParserStatement init, const PreParserExpression &cond, PreParserStatement next, PreParserStatement body, const SourceRange &body_range={})
V8_INLINE void AddTemplateExpression(TemplateLiteralState *state, const PreParserExpression &expression)
V8_INLINE void ReindexComputedMemberName(const PreParserExpression &expression)
Variable * DeclareVariable(const AstRawString *name, VariableKind kind, VariableMode mode, InitializationFlag init, Scope *scope, bool *was_added, int position)
Variable * DeclareVariableName(const AstRawString *name, VariableMode mode, Scope *scope, bool *was_added, int position=kNoSourcePosition, VariableKind kind=NORMAL_VARIABLE)
static V8_INLINE PreParserIdentifier NullIdentifier()
V8_INLINE void DeclarePrivateClassMember(ClassScope *scope, const PreParserIdentifier &property_name, const PreParserExpression &property, ClassLiteralProperty::Kind kind, bool is_static, ClassInfo *class_info)
static V8_INLINE PreParserExpression AsIdentifierExpression(const PreParserExpression &expression)
V8_INLINE PreParserExpression NewClassLiteralPropertyWithAccessorInfo(ClassScope *scope, ClassInfo *class_info, const PreParserIdentifier &name, const PreParserExpression &key, const PreParserExpression &value, bool is_static, bool is_computed_name, bool is_private, int pos)
V8_INLINE PreParserExpression CloseTemplateLiteral(TemplateLiteralState *state, int start, const PreParserExpression &tag)
V8_INLINE void AddInstanceFieldOrStaticElement(const PreParserExpression &property, ClassInfo *class_info, bool is_static)
static V8_INLINE void CheckAssigningFunctionLiteralToProperty(const PreParserExpression &left, const PreParserExpression &right)
static V8_INLINE PreParserStatement NullStatement()
V8_INLINE void DeclarePublicClassMethod(const PreParserIdentifier &class_name, const PreParserExpression &property, bool is_constructor, ClassInfo *class_info)
V8_INLINE void DeclareArrowFunctionFormalParameters(PreParserFormalParameters *parameters, const PreParserExpression ¶ms, const Scanner::Location ¶ms_loc)
V8_INLINE bool IsAsync(const PreParserIdentifier &identifier) const
PreParserLogger * logger()
V8_INLINE bool IsArguments(const PreParserIdentifier &identifier) const
V8_INLINE void SetFunctionNameFromPropertyName(const PreParserExpression &property, const PreParserIdentifier &name, const AstRawString *prefix=nullptr)
V8_INLINE void AddFormalParameter(PreParserFormalParameters *parameters, const PreParserExpression &pattern, const PreParserExpression &initializer, int initializer_end_position, bool is_rest)
V8_INLINE PreParserStatement DeclareNative(const PreParserIdentifier &name, int pos)
V8_INLINE void ReportVarRedeclarationIn(const AstRawString *name, Scope *scope)
V8_INLINE PreParserPropertyList NewClassStaticElementList(int size) const
V8_INLINE void DeclareFunctionNameVar(const AstRawString *function_name, FunctionSyntaxKind function_syntax_kind, DeclarationScope *function_scope)
V8_INLINE PreParserExpression NewTargetExpression(int pos)
V8_INLINE void InsertShadowingVarBindingInitializers(PreParserStatement block)
V8_INLINE PreParserExpression NewSuperCallReference(int pos)
V8_INLINE bool IsNative(const PreParserExpression &expr) const
V8_INLINE void AddTemplateSpan(TemplateLiteralState *state, bool should_cook, bool tail)
std::vector< void * > * preparse_data_builder_buffer()
PreParserIdentifier GetIdentifier() const
V8_INLINE PreParserIdentifier GetNextSymbol() const
static V8_INLINE PreParserBlock NullBlock()
static V8_INLINE PreParserExpression FailureExpression()
PreParserBlock BuildParameterInitializationBlock(const PreParserFormalParameters ¶meters)
V8_INLINE PreParserExpression RewriteClassLiteral(ClassScope *scope, const PreParserIdentifier &name, ClassInfo *class_info, int pos)
V8_INLINE PreParserExpression NewThrowReferenceError(MessageTemplate message, int pos)
V8_INLINE PreParserStatement NewThrowStatement(const PreParserExpression &exception, int pos)
V8_INLINE void SetAsmModule()
bool IdentifierEquals(const PreParserIdentifier &identifier, const AstRawString *other)
PreParserExpression InitializeObjectLiteral(PreParserExpression literal)
PreParserStatement AsIterationStatement(PreParserStatement s)
static bool IsPreParser()
V8_INLINE void PushPropertyName(const PreParserExpression &expression)
PreparseDataBuilder * preparse_data_builder() const
V8_INLINE PreParserStatementList NewStatementList(int size) const
V8_INLINE void CountUsage(v8::Isolate::UseCounterFeature feature)
V8_INLINE void AddClassStaticBlock(PreParserBlock block, ClassInfo *class_info)
bool parse_lazily() const
V8_INLINE bool IsEmptyIdentifier(PreParserIdentifier subject)
Variable * DeclarePrivateVariableName(const AstRawString *name, ClassScope *scope, VariableMode mode, IsStaticFlag is_static_flag, bool *was_added)
V8_INLINE PreParserIdentifier EmptyIdentifierString() const
V8_INLINE bool ParsingDynamicFunctionDeclaration() const
V8_INLINE bool IsPrivateReference(const PreParserExpression &expression)
V8_INLINE void DeclareIdentifier(const PreParserIdentifier &name, int start_position)
V8_INLINE void AddSyntheticFunctionDeclaration(FunctionKind kind, int pos)
static V8_INLINE PreParserStatementList NullStatementList()
static V8_INLINE PreParserExpression NullLiteralProperty()
V8_INLINE bool ShortcutLiteralBinaryExpression(PreParserExpression *x, const PreParserExpression &y, Token::Value op, int pos)
V8_INLINE FunctionLiteral::EagerCompileHint GetEmbedderCompileHint(FunctionLiteral::EagerCompileHint current_compile_hint, int position)
static V8_INLINE void PushLiteralName(const PreParserIdentifier &id)
V8_EXPORT_PRIVATE PreParseResult PreParseProgram()
V8_INLINE PreParserPropertyList NewClassPropertyList(int size) const
static V8_INLINE bool IsThisProperty(const PreParserExpression &expression)
PreParser(Zone *zone, Scanner *scanner, uintptr_t stack_limit, AstValueFactory *ast_value_factory, PendingCompilationErrorHandler *pending_error_handler, RuntimeCallStats *runtime_call_stats, V8FileLogger *v8_file_logger, UnoptimizedCompileFlags flags, bool parsing_on_main_thread=true)
static V8_INLINE void PushVariableName(const PreParserIdentifier &id)
V8_INLINE PreParserStatement RewriteSwitchStatement(PreParserStatement switch_statement, Scope *scope)
V8_INLINE void DesugarBindingInForEachStatement(ForInfo *for_info, PreParserStatement *body_block, PreParserExpression *each_variable)
V8_INLINE void ParseAsyncGeneratorFunctionBody(int pos, FunctionKind kind, PreParserScopedStatementList *body)
V8_INLINE bool CollapseConditionalChain(PreParserExpression *x, PreParserExpression cond, PreParserExpression then_expression, PreParserExpression else_expression, int pos, const SourceRange &then_range)
PreParseResult PreParseFunction(const AstRawString *function_name, FunctionKind kind, FunctionSyntaxKind function_syntax_kind, DeclarationScope *function_scope, int *use_counts, ProducedPreparseData **produced_preparser_scope_data)
static V8_INLINE bool IsIdentifier(const PreParserExpression &expression)
PreparseDataBuilder * preparse_data_builder_
V8_INLINE const AstRawString * PreParserIdentifierToAstRawString(const PreParserIdentifier &x)
V8_INLINE PreParserIdentifier GetNumberAsSymbol() const
V8_INLINE Variable * DeclareCatchVariableName(Scope *scope, const PreParserIdentifier &identifier)
V8_INLINE TemplateLiteralState OpenTemplateLiteral(int pos)
V8_INLINE void AppendConditionalChainElse(PreParserExpression *x, const SourceRange &else_range)
bool AllowsLazyParsingWithoutUnresolvedVariables() const
V8_INLINE void ReportUnexpectedTokenAt(Scanner::Location location, Token::Value token, MessageTemplate message=MessageTemplate::kUnexpectedToken)
V8_INLINE void ReportUnidentifiableError()
V8_INLINE void ParseGeneratorFunctionBody(int pos, FunctionKind kind, PreParserScopedStatementList *body)
V8_INLINE bool IsStringLiteral(PreParserStatement statement) const
const AstRawString * GetRawNameFromIdentifier(const PreParserIdentifier &arg)
V8_INLINE PreParserBlock RewriteCatchPattern(CatchInfo *catch_info)
V8_INLINE void SetLanguageMode(Scope *scope, LanguageMode mode)
V8_INLINE void InsertSloppyBlockFunctionVarBindings(DeclarationScope *scope)
V8_INLINE PreParserBlock RewriteForVarInLegacy(const ForInfo &for_info)
static V8_INLINE bool IsIterationStatement(PreParserStatement subject)
V8_INLINE PreParserExpression ThisExpression()
static V8_INLINE bool IsNull(T subject)
static V8_INLINE PreParserIdentifier AsIdentifier(const PreParserExpression &expression)
V8_INLINE void DeclareFunctionNameVar(const PreParserIdentifier &function_name, FunctionSyntaxKind function_syntax_kind, DeclarationScope *function_scope)
V8_INLINE void PrepareGeneratorVariables()
V8_INLINE void DeclareFormalParameters(const PreParserFormalParameters *parameters)
V8_INLINE bool CollapseNaryExpression(PreParserExpression *x, PreParserExpression y, Token::Value op, int pos, const SourceRange &range)
V8_INLINE PreParserExpression BuildUnaryExpression(const PreParserExpression &expression, Token::Value op, int pos)
PreParserIdentifier GetSymbol() const
static V8_INLINE bool IsArrayIndex(const PreParserIdentifier &string, uint32_t *index)
void set_preparse_data_builder(PreparseDataBuilder *preparse_data_builder)
V8_INLINE void ReindexArrowFunctionFormalParameters(PreParserFormalParameters *parameters)
PreParserIdentifier Identifier
V8_INLINE bool SkipFunction(const AstRawString *name, FunctionKind kind, FunctionSyntaxKind function_syntax_kind, DeclarationScope *function_scope, int *num_parameters, int *function_length, ProducedPreparseData **produced_preparse_data)
Expression ParseFunctionLiteral(Identifier name, Scanner::Location function_name_location, FunctionNameValidity function_name_validity, FunctionKind kind, int function_token_pos, FunctionSyntaxKind function_syntax_kind, LanguageMode language_mode, ZonePtrList< const AstRawString > *arguments_for_wrapped_function)
V8_INLINE PreParserStatement RewriteTryStatement(PreParserStatement try_block, PreParserStatement catch_block, const SourceRange &catch_range, PreParserStatement finally_block, const SourceRange &finally_range, const CatchInfo &catch_info, int pos)
@ kPreParseNotIdentifiableError
V8_INLINE void PushEnclosingName(const PreParserIdentifier &name)
void DeclareAndBindVariable(const VariableProxy *proxy, VariableKind kind, VariableMode mode, Scope *scope, bool *was_added, int initializer_position)
static V8_INLINE void InferFunctionName()
V8_INLINE bool IsConstructor(const PreParserIdentifier &identifier) const
V8_INLINE void DeclarePublicClassField(ClassScope *scope, const PreParserExpression &property, bool is_static, bool is_computed_name, ClassInfo *class_info)
std::vector< void * > preparse_data_builder_buffer_
V8_INLINE void DeclareClassVariable(ClassScope *scope, const PreParserIdentifier &name, ClassInfo *class_info, int class_token_pos)
V8_INLINE PreParserStatement DeclareClass(const PreParserIdentifier &variable_name, const PreParserExpression &value, ZonePtrList< const AstRawString > *names, int class_token_pos, int end_pos)
V8_INLINE PreParserExpression NewThisExpression(int pos)
V8_INLINE PreParserExpression ExpressionFromPrivateName(PrivateNameScopeIterator *private_name_scope, const PreParserIdentifier &name, int start_position)
V8_INLINE PreParserStatement DeclareFunction(const PreParserIdentifier &variable_name, const PreParserExpression &function, VariableMode mode, VariableKind kind, int beg_pos, int end_pos, ZonePtrList< const AstRawString > *names)
V8_INLINE PreParserStatement BuildInitializationBlock(DeclarationParsingResult *parsing_result)
V8_INLINE PreParserExpression ExpressionListToExpression(const PreParserExpressionList &args)
static V8_INLINE void GetDefaultStrings(PreParserIdentifier *default_string, PreParserIdentifier *dot_default_string)
static V8_INLINE PreParserExpression NullExpression()
static V8_INLINE void AddFunctionForNameInference(const PreParserExpression &expression)
V8_INLINE PreParserExpression NewV8Intrinsic(const PreParserIdentifier &name, const PreParserExpressionList &arguments, int pos)
V8_INLINE void SetFunctionNameFromIdentifierRef(const PreParserExpression &value, const PreParserExpression &identifier)
V8_INLINE bool IsEvalOrArguments(const PreParserIdentifier &identifier) const
V8_INLINE PreParserExpression ImportMetaExpression(int pos)
V8_INLINE StatementT DesugarLexicalBindingsInForStatement(PreParserStatement loop, PreParserStatement init, const PreParserExpression &cond, PreParserStatement next, PreParserStatement body, Scope *inner_scope, const ForInfo &for_info)
V8_INLINE PreParserExpression NewSuperPropertyReference(int pos)
static V8_INLINE bool IsBoilerplateProperty(const PreParserExpression &property)
V8_INLINE PreParserIdentifier GetBigIntAsSymbol() const
PreParserExpression ExpressionFromIdentifier(const PreParserIdentifier &name, int start_position, InferName infer=InferName::kYes)
V8_INLINE PreParserExpression ExpressionFromLiteral(Token::Value token, int pos)
V8_INLINE PreParserBlock CreateForEachStatementTDZ(PreParserBlock init_block, const ForInfo &for_info)
V8_INLINE bool ParsingExtension() const
V8_INLINE bool IsEval(const PreParserIdentifier &identifier) const
void ParseStatementListAndLogFunction(PreParserFormalParameters *formals)
PendingCompilationErrorHandler * pending_error_handler()
void AddUnresolvedPrivateName(VariableProxy *proxy)
V8_INLINE void set_parser_error()
void SetLanguageMode(LanguageMode language_mode)
void set_end_position(int statement_pos)
base::ThreadedList< Declaration > * declarations()
VariableProxy * NewUnresolved(AstNodeFactory *factory, const AstRawString *name, int start_pos, VariableKind kind=NORMAL_VARIABLE)
Variable * DeclareCatchVariableName(const AstRawString *name)
Variable * DeclareVariableName(const AstRawString *name, VariableMode mode, bool *was_added, VariableKind kind=NORMAL_VARIABLE)
void set_start_position(int statement_pos)
DeclarationScope * GetDeclarationScope()
Variable * LookupLocal(const AstRawString *name)
const AstRawString * raw_name() const
void set_initializer_position(int pos)
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
bool IsLexicalVariableMode(VariableMode mode)
@ SLOPPY_BLOCK_FUNCTION_VARIABLE
SharedFunctionInfo::HasStaticPrivateMethodsOrAccessorsBit SharedFunctionInfo::MaglevCompilationFailedBit SharedFunctionInfo::FunctionSyntaxKindBits has_duplicate_parameters
bool IsPrivateMethodOrAccessorVariableMode(VariableMode mode)
bool IsImmutableLexicalOrPrivateVariableMode(VariableMode mode)
@ kDefaultDerivedConstructor
@ kDefaultBaseConstructor
#define DEFINE_RECORD_SOURCE_RANGE(Name)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK_NE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
#define V8_EXPORT_PRIVATE