V8 Project
|
#include <parser.h>
Classes | |
class | Checkpoint |
struct | Type |
Public Member Functions | |
ParserTraits (Parser *parser) | |
bool | IsEvalOrArguments (const AstRawString *identifier) const |
bool | IsFutureStrictReserved (const AstRawString *identifier) const |
bool | IsPrototype (const AstRawString *identifier) const |
bool | IsConstructor (const AstRawString *identifier) const |
void | PushPropertyName (FuncNameInferrer *fni, Expression *expression) |
void | CheckPossibleEvalCall (Expression *expression, Scope *scope) |
bool | ShortcutNumericLiteralBinaryExpression (Expression **x, Expression *y, Token::Value op, int pos, AstNodeFactory< AstConstructionVisitor > *factory) |
Expression * | BuildUnaryExpression (Expression *expression, Token::Value op, int pos, AstNodeFactory< AstConstructionVisitor > *factory) |
Expression * | NewThrowReferenceError (const char *type, int pos) |
Expression * | NewThrowSyntaxError (const char *type, const AstRawString *arg, int pos) |
Expression * | NewThrowTypeError (const char *type, const AstRawString *arg, int pos) |
Expression * | NewThrowError (const AstRawString *constructor, const char *type, const AstRawString *arg, int pos) |
void | ReportMessageAt (Scanner::Location source_location, const char *message, const char *arg=NULL, bool is_reference_error=false) |
void | ReportMessage (const char *message, const char *arg=NULL, bool is_reference_error=false) |
void | ReportMessage (const char *message, const AstRawString *arg, bool is_reference_error=false) |
void | ReportMessageAt (Scanner::Location source_location, const char *message, const AstRawString *arg, bool is_reference_error=false) |
const AstRawString * | EmptyIdentifierString () |
Literal * | GetLiteralTheHole (int position, AstNodeFactory< AstConstructionVisitor > *factory) |
const AstRawString * | GetSymbol (Scanner *scanner) |
const AstRawString * | GetNextSymbol (Scanner *scanner) |
const AstRawString * | GetNumberAsSymbol (Scanner *scanner) |
Expression * | ThisExpression (Scope *scope, AstNodeFactory< AstConstructionVisitor > *factory, int pos=RelocInfo::kNoPosition) |
Expression * | SuperReference (Scope *scope, AstNodeFactory< AstConstructionVisitor > *factory, int pos=RelocInfo::kNoPosition) |
Expression * | ClassLiteral (const AstRawString *name, Expression *extends, Expression *constructor, ZoneList< ObjectLiteral::Property * > *properties, int pos, AstNodeFactory< AstConstructionVisitor > *factory) |
Literal * | ExpressionFromLiteral (Token::Value token, int pos, Scanner *scanner, AstNodeFactory< AstConstructionVisitor > *factory) |
Expression * | ExpressionFromIdentifier (const AstRawString *name, int pos, Scope *scope, AstNodeFactory< AstConstructionVisitor > *factory) |
Expression * | ExpressionFromString (int pos, Scanner *scanner, AstNodeFactory< AstConstructionVisitor > *factory) |
Expression * | GetIterator (Expression *iterable, AstNodeFactory< AstConstructionVisitor > *factory) |
ZoneList< v8::internal::Expression * > * | NewExpressionList (int size, Zone *zone) |
ZoneList< ObjectLiteral::Property * > * | NewPropertyList (int size, Zone *zone) |
ZoneList< v8::internal::Statement * > * | NewStatementList (int size, Zone *zone) |
Scope * | NewScope (Scope *parent_scope, ScopeType scope_type) |
int | DeclareArrowParametersFromExpression (Expression *expression, Scope *scope, Scanner::Location *dupe_loc, bool *ok) |
AstValueFactory * | ast_value_factory () |
Expression * | ParseV8Intrinsic (bool *ok) |
FunctionLiteral * | ParseFunctionLiteral (const AstRawString *name, Scanner::Location function_name_location, bool name_is_strict_reserved, FunctionKind kind, int function_token_position, FunctionLiteral::FunctionType type, FunctionLiteral::ArityRestriction arity_restriction, bool *ok) |
void | SkipLazyFunctionBody (const AstRawString *name, int *materialized_literal_count, int *expected_property_count, bool *ok) |
ZoneList< Statement * > * | ParseEagerFunctionBody (const AstRawString *name, int pos, Variable *fvar, Token::Value fvar_init_op, bool is_generator, bool *ok) |
void | CheckConflictingVarDeclarations (v8::internal::Scope *scope, bool *ok) |
Static Public Member Functions | |
template<typename FunctionState > | |
static void | SetUpFunctionState (FunctionState *function_state) |
template<typename FunctionState > | |
static void | TearDownFunctionState (FunctionState *function_state) |
static bool | IsThisProperty (Expression *expression) |
static bool | IsIdentifier (Expression *expression) |
static const AstRawString * | AsIdentifier (Expression *expression) |
static bool | IsBoilerplateProperty (ObjectLiteral::Property *property) |
static bool | IsArrayIndex (const AstRawString *string, uint32_t *index) |
static void | PushLiteralName (FuncNameInferrer *fni, const AstRawString *id) |
static void | InferFunctionName (FuncNameInferrer *fni, FunctionLiteral *func_to_infer) |
static void | CheckFunctionLiteralInsideTopLevelObjectLiteral (Scope *scope, ObjectLiteralProperty *property, bool *has_function) |
static void | CheckAssigningFunctionLiteralToProperty (Expression *left, Expression *right) |
static Expression * | MarkExpressionAsAssigned (Expression *expression) |
static const AstRawString * | EmptyIdentifier () |
static Expression * | EmptyExpression () |
static Expression * | EmptyArrowParamList () |
static Literal * | EmptyLiteral () |
static ObjectLiteralProperty * | EmptyObjectLiteralProperty () |
static FunctionLiteral * | EmptyFunctionLiteral () |
static ZoneList< Expression * > * | NullExpressionList () |
Private Attributes | |
Parser * | parser_ |
|
inlineexplicit |
|
inlinestatic |
Definition at line 409 of file parser.h.
References DCHECK, and IsIdentifier().
|
inline |
Definition at line 895 of file parser.h.
References v8::internal::Parser::ast_value_factory(), and parser_.
Referenced by GetNumberAsSymbol().
Expression * v8::internal::ParserTraits::BuildUnaryExpression | ( | Expression * | expression, |
Token::Value | op, | ||
int | pos, | ||
AstNodeFactory< AstConstructionVisitor > * | factory | ||
) |
Definition at line 494 of file parser.cc.
References v8::internal::ADD, v8::internal::AstValue::AsNumber(), v8::internal::AstValue::BooleanValue(), DCHECK, v8::internal::DoubleToInt32(), v8::internal::AstValue::IsNumber(), v8::internal::MUL, v8::internal::NOT, NULL, and v8::internal::SUB.
|
static |
|
inline |
Definition at line 889 of file parser.h.
References v8::internal::Parser::CheckConflictingVarDeclarations(), and parser_.
|
inlinestatic |
Definition at line 433 of file parser.h.
References v8::internal::Scope::DeclarationScope(), v8::internal::Scope::is_global_scope(), and NULL.
void v8::internal::ParserTraits::CheckPossibleEvalCall | ( | Expression * | expression, |
Scope * | scope | ||
) |
Definition at line 416 of file parser.cc.
References v8::internal::Parser::ast_value_factory(), v8::internal::Scope::DeclarationScope(), NULL, parser_, and v8::internal::Scope::RecordEvalCall().
Expression * v8::internal::ParserTraits::ClassLiteral | ( | const AstRawString * | name, |
Expression * | extends, | ||
Expression * | constructor, | ||
ZoneList< ObjectLiteral::Property * > * | properties, | ||
int | pos, | ||
AstNodeFactory< AstConstructionVisitor > * | factory | ||
) |
Definition at line 668 of file parser.cc.
References name.
int v8::internal::ParserTraits::DeclareArrowParametersFromExpression | ( | Expression * | expression, |
Scope * | scope, | ||
Scanner::Location * | dupe_loc, | ||
bool * | ok | ||
) |
Definition at line 3426 of file parser.cc.
References v8::internal::CheckAndDeclareArrowParameter().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
Definition at line 868 of file parser.h.
References v8::internal::Parser::ast_value_factory(), and parser_.
|
inlinestatic |
|
inlinestatic |
Expression * v8::internal::ParserTraits::ExpressionFromIdentifier | ( | const AstRawString * | name, |
int | pos, | ||
Scope * | scope, | ||
AstNodeFactory< AstConstructionVisitor > * | factory | ||
) |
Definition at line 697 of file parser.cc.
References v8::internal::ParserBase< Traits >::fni_, name, v8::internal::Interface::NewUnknown(), v8::internal::Scope::NewUnresolved(), NULL, parser_, v8::internal::PrintF(), and v8::internal::FuncNameInferrer::PushVariableName().
Literal * v8::internal::ParserTraits::ExpressionFromLiteral | ( | Token::Value | token, |
int | pos, | ||
Scanner * | scanner, | ||
AstNodeFactory< AstConstructionVisitor > * | factory | ||
) |
Definition at line 675 of file parser.cc.
References DCHECK, v8::internal::Scanner::DoubleValue(), and NULL.
Expression * v8::internal::ParserTraits::ExpressionFromString | ( | int | pos, |
Scanner * | scanner, | ||
AstNodeFactory< AstConstructionVisitor > * | factory | ||
) |
Definition at line 711 of file parser.cc.
References v8::internal::ParserBase< Traits >::fni_, GetSymbol(), NULL, parser_, and v8::internal::FuncNameInferrer::PushLiteralName().
Expression * v8::internal::ParserTraits::GetIterator | ( | Expression * | iterable, |
AstNodeFactory< AstConstructionVisitor > * | factory | ||
) |
Definition at line 720 of file parser.cc.
References v8::internal::RelocInfo::kNoPosition, parser_, v8::internal::AstNode::position(), and v8::internal::ParserBase< Traits >::zone().
Referenced by v8::internal::Parser::InitializeForEachStatement().
Literal * v8::internal::ParserTraits::GetLiteralTheHole | ( | int | position, |
AstNodeFactory< AstConstructionVisitor > * | factory | ||
) |
Definition at line 733 of file parser.cc.
References v8::internal::RelocInfo::kNoPosition.
const AstRawString * v8::internal::ParserTraits::GetNextSymbol | ( | Scanner * | scanner | ) |
Definition at line 651 of file parser.cc.
References v8::internal::Parser::ast_value_factory(), v8::internal::Scanner::NextSymbol(), parser_, and v8::internal::ParserBase< Traits >::scanner().
const AstRawString * v8::internal::ParserTraits::GetNumberAsSymbol | ( | Scanner * | scanner | ) |
Definition at line 642 of file parser.cc.
References arraysize, ast_value_factory(), v8::internal::DoubleToCString(), v8::internal::Scanner::DoubleValue(), v8::internal::AstValueFactory::GetOneByteString(), parser_, and v8::internal::ParserBase< Traits >::scanner().
const AstRawString * v8::internal::ParserTraits::GetSymbol | ( | Scanner * | scanner | ) |
Definition at line 634 of file parser.cc.
References v8::internal::Parser::ast_value_factory(), v8::internal::Scanner::CurrentSymbol(), DCHECK, NULL, parser_, and v8::internal::ParserBase< Traits >::scanner().
Referenced by ExpressionFromString(), and v8::internal::Parser::ParseModuleUrl().
|
inlinestatic |
Definition at line 428 of file parser.h.
References v8::internal::FuncNameInferrer::AddFunction().
|
inlinestatic |
|
inlinestatic |
bool v8::internal::ParserTraits::IsConstructor | ( | const AstRawString * | identifier | ) | const |
Definition at line 375 of file parser.cc.
References v8::internal::Parser::ast_value_factory(), and parser_.
bool v8::internal::ParserTraits::IsEvalOrArguments | ( | const AstRawString * | identifier | ) | const |
Definition at line 364 of file parser.cc.
References v8::internal::Parser::ast_value_factory(), and parser_.
Referenced by v8::internal::CheckAndDeclareArrowParameter(), and v8::internal::Parser::ParseFunctionLiteral().
|
inline |
Definition at line 856 of file parser.h.
References v8::internal::Scanner::IdentifierIsFutureStrictReserved(), v8::internal::AstRawString::IsOneByteEqualTo(), parser_, and v8::internal::ParserBase< Traits >::scanner().
Referenced by v8::internal::CheckAndDeclareArrowParameter().
|
static |
Definition at line 389 of file parser.cc.
References NULL.
Referenced by AsIdentifier().
bool v8::internal::ParserTraits::IsPrototype | ( | const AstRawString * | identifier | ) | const |
Definition at line 370 of file parser.cc.
References v8::internal::Parser::ast_value_factory(), and parser_.
|
static |
|
static |
|
inline |
Definition at line 863 of file parser.h.
References v8::internal::Parser::NewScope(), and parser_.
|
inline |
Expression * v8::internal::ParserTraits::NewThrowError | ( | const AstRawString * | constructor, |
const char * | type, | ||
const AstRawString * | arg, | ||
int | pos | ||
) |
Definition at line 559 of file parser.cc.
References v8::internal::List< T, AllocationPolicy >::Add(), v8::internal::Parser::ast_value_factory(), v8::internal::ParserBase< Traits >::factory(), v8::internal::AstValueFactory::GetOneByteString(), NULL, parser_, and v8::internal::ParserBase< Traits >::zone().
Referenced by NewThrowReferenceError(), NewThrowSyntaxError(), and NewThrowTypeError().
Expression * v8::internal::ParserTraits::NewThrowReferenceError | ( | const char * | type, |
int | pos | ||
) |
Definition at line 538 of file parser.cc.
References v8::internal::Parser::ast_value_factory(), NewThrowError(), NULL, and parser_.
Expression * v8::internal::ParserTraits::NewThrowSyntaxError | ( | const char * | type, |
const AstRawString * | arg, | ||
int | pos | ||
) |
Definition at line 545 of file parser.cc.
References v8::internal::Parser::ast_value_factory(), NewThrowError(), and parser_.
Expression * v8::internal::ParserTraits::NewThrowTypeError | ( | const char * | type, |
const AstRawString * | arg, | ||
int | pos | ||
) |
Definition at line 552 of file parser.cc.
References v8::internal::Parser::ast_value_factory(), NewThrowError(), and parser_.
Referenced by v8::internal::Parser::Declare().
|
inlinestatic |
|
inline |
Definition at line 882 of file parser.h.
References name, v8::internal::Parser::ParseEagerFunctionBody(), and parser_.
FunctionLiteral * v8::internal::ParserTraits::ParseFunctionLiteral | ( | const AstRawString * | name, |
Scanner::Location | function_name_location, | ||
bool | name_is_strict_reserved, | ||
FunctionKind | kind, | ||
int | function_token_position, | ||
FunctionLiteral::FunctionType | type, | ||
FunctionLiteral::ArityRestriction | arity_restriction, | ||
bool * | ok | ||
) |
Definition at line 744 of file parser.cc.
References v8::internal::function_token_position, name, v8::internal::Parser::ParseFunctionLiteral(), and parser_.
Expression * v8::internal::ParserTraits::ParseV8Intrinsic | ( | bool * | ok | ) |
Definition at line 739 of file parser.cc.
References parser_, and v8::internal::Parser::ParseV8Intrinsic().
|
inlinestatic |
Definition at line 424 of file parser.h.
References v8::internal::FuncNameInferrer::PushLiteralName().
void v8::internal::ParserTraits::PushPropertyName | ( | FuncNameInferrer * | fni, |
Expression * | expression | ||
) |
Definition at line 395 of file parser.cc.
References v8::internal::Parser::ast_value_factory(), v8::internal::Expression::IsPropertyName(), parser_, and v8::internal::FuncNameInferrer::PushLiteralName().
void v8::internal::ParserTraits::ReportMessage | ( | const char * | message, |
const AstRawString * | arg, | ||
bool | is_reference_error = false |
||
) |
Definition at line 607 of file parser.cc.
References v8::internal::Scanner::location(), parser_, ReportMessageAt(), and v8::internal::ParserBase< Traits >::scanner().
void v8::internal::ParserTraits::ReportMessage | ( | const char * | message, |
const char * | arg = NULL , |
||
bool | is_reference_error = false |
||
) |
Definition at line 599 of file parser.cc.
References v8::internal::Scanner::location(), parser_, ReportMessageAt(), and v8::internal::ParserBase< Traits >::scanner().
Referenced by v8::internal::Parser::Declare(), v8::internal::Parser::ParseBreakStatement(), v8::internal::Parser::ParseContinueStatement(), v8::internal::Parser::ParseExpressionOrLabelledStatement(), v8::internal::Parser::ParseImportDeclaration(), v8::internal::Parser::ParseModuleLiteral(), v8::internal::Parser::ParseModulePath(), and v8::internal::Parser::ParseV8Intrinsic().
void v8::internal::ParserTraits::ReportMessageAt | ( | Scanner::Location | source_location, |
const char * | message, | ||
const AstRawString * | arg, | ||
bool | is_reference_error = false |
||
) |
Definition at line 615 of file parser.cc.
References v8::internal::Parser::has_pending_error_, NULL, parser_, v8::internal::Parser::pending_error_arg_, v8::internal::Parser::pending_error_char_arg_, v8::internal::Parser::pending_error_is_reference_error_, v8::internal::Parser::pending_error_location_, v8::internal::Parser::pending_error_message_, and v8::internal::ParserBase< Traits >::stack_overflow().
void v8::internal::ParserTraits::ReportMessageAt | ( | Scanner::Location | source_location, |
const char * | message, | ||
const char * | arg = NULL , |
||
bool | is_reference_error = false |
||
) |
Definition at line 580 of file parser.cc.
References v8::internal::Parser::has_pending_error_, NULL, parser_, v8::internal::Parser::pending_error_arg_, v8::internal::Parser::pending_error_char_arg_, v8::internal::Parser::pending_error_is_reference_error_, v8::internal::Parser::pending_error_location_, v8::internal::Parser::pending_error_message_, and v8::internal::ParserBase< Traits >::stack_overflow().
Referenced by v8::internal::Parser::CheckConflictingVarDeclarations(), ReportMessage(), and v8::internal::Parser::SkipLazyFunctionBody().
|
inlinestatic |
Definition at line 383 of file parser.h.
References v8::internal::BailoutId::FirstUsable().
bool v8::internal::ParserTraits::ShortcutNumericLiteralBinaryExpression | ( | Expression ** | x, |
Expression * | y, | ||
Token::Value | op, | ||
int | pos, | ||
AstNodeFactory< AstConstructionVisitor > * | factory | ||
) |
Definition at line 434 of file parser.cc.
References v8::internal::ADD, v8::internal::ArithmeticShiftRight(), v8::internal::DIV, v8::internal::DoubleToInt32(), v8::internal::DoubleToUint32(), v8::internal::MUL, shift, v8::internal::SUB, and v8::base::internal::y.
|
inline |
Definition at line 873 of file parser.h.
References parser_, and v8::internal::Parser::SkipLazyFunctionBody().
Expression * v8::internal::ParserTraits::SuperReference | ( | Scope * | scope, |
AstNodeFactory< AstConstructionVisitor > * | factory, | ||
int | pos = RelocInfo::kNoPosition |
||
) |
Definition at line 661 of file parser.cc.
References ThisExpression().
|
inlinestatic |
Expression * v8::internal::ParserTraits::ThisExpression | ( | Scope * | scope, |
AstNodeFactory< AstConstructionVisitor > * | factory, | ||
int | pos = RelocInfo::kNoPosition |
||
) |
Definition at line 656 of file parser.cc.
References v8::internal::Scope::receiver().
Referenced by SuperReference().
|
private |
Definition at line 602 of file parser.h.
Referenced by ast_value_factory(), CheckConflictingVarDeclarations(), CheckPossibleEvalCall(), EmptyIdentifierString(), ExpressionFromIdentifier(), ExpressionFromString(), GetIterator(), GetNextSymbol(), GetNumberAsSymbol(), GetSymbol(), IsConstructor(), IsEvalOrArguments(), IsFutureStrictReserved(), IsPrototype(), NewScope(), NewThrowError(), NewThrowReferenceError(), NewThrowSyntaxError(), NewThrowTypeError(), ParseEagerFunctionBody(), ParseFunctionLiteral(), ParseV8Intrinsic(), PushPropertyName(), ReportMessage(), ReportMessageAt(), and SkipLazyFunctionBody().