22 #if V8_LIBC_MSVCRT && (_MSC_VER < 1800)
36 :
public ParserBase<PreParserTraits>::CheckpointBase {
45 bool is_reference_error) {
58 bool is_reference_error) {
65 if (scanner->
current_token() == Token::FUTURE_RESERVED_WORD) {
68 Token::FUTURE_STRICT_RESERVED_WORD) {
114 FunctionLiteral::ArityRestriction arity_restriction,
bool* ok) {
116 name, function_name_location, name_is_strict_reserved, kind,
128 scope_->SetStrictMode(strict_mode);
165 #define CHECK_OK ok); \
166 if (!*ok) return kUnknownSourceElements; \
185 case Token::FUNCTION:
208 bool directive_prologue =
true;
209 while (peek() != end_token) {
211 directive_prologue =
false;
214 if (directive_prologue) {
218 directive_prologue =
false;
227 #define CHECK_OK ok); \
228 if (!*ok) return Statement::Default(); \
264 case Token::SEMICOLON:
280 case Token::CONTINUE:
301 case Token::FUNCTION: {
319 case Token::DEBUGGER:
347 bool is_strict_reserved =
false;
353 pos, FunctionLiteral::DECLARATION,
354 FunctionLiteral::NORMAL_ARITY,
CHECK_OK);
362 bool is_strict_reserved =
false;
379 while (peek() != Token::RBRACE) {
386 Expect(Token::RBRACE, ok);
429 bool require_initializer =
false;
451 require_initializer =
true;
481 if (peek() == Token::ASSIGN || require_initializer) {
488 if (num_decl !=
NULL) *num_decl = nvars;
503 if (starts_with_identifier && expr.
IsIdentifier() && peek() == Token::COLON) {
531 if (peek() == Token::ELSE) {
545 if (!
scanner()->HasAnyLineTerminatorBeforeNext() &&
546 tok != Token::SEMICOLON &&
547 tok != Token::RBRACE &&
563 if (!
scanner()->HasAnyLineTerminatorBeforeNext() &&
564 tok != Token::SEMICOLON &&
565 tok != Token::RBRACE &&
590 if (!
scanner()->HasAnyLineTerminatorBeforeNext() &&
591 tok != Token::SEMICOLON &&
592 tok != Token::RBRACE &&
615 BlockState block_state(&
scope_, &with_scope);
632 while (token != Token::RBRACE) {
643 token != Token::RBRACE) {
648 Expect(Token::RBRACE, ok);
662 Expect(Token::RPAREN, ok);
663 if (peek() == Token::SEMICOLON)
Consume(Token::SEMICOLON);
696 if (peek() != Token::SEMICOLON) {
705 bool accept_IN = decl_count == 1 && !(is_let && has_initializers);
706 bool accept_OF = !has_initializers;
729 if (peek() != Token::SEMICOLON) {
734 if (peek() != Token::RPAREN) {
749 if (
scanner()->HasAnyLineTerminatorBeforeNext()) {
777 if (tok != Token::CATCH && tok != Token::FINALLY) {
782 if (tok == Token::CATCH) {
789 BlockState block_state(&
scope_, &with_scope);
794 if (tok == Token::FINALLY) {
816 #define CHECK_OK ok); \
817 if (!*ok) return Expression::Default(); \
825 bool name_is_strict_reserved,
FunctionKind kind,
int function_token_pos,
826 FunctionLiteral::FunctionType function_type,
827 FunctionLiteral::ArityRestriction arity_restriction,
bool* ok) {
849 bool done = arity_restriction == FunctionLiteral::GETTER_ARITY ||
850 (peek() == Token::RPAREN &&
851 arity_restriction != FunctionLiteral::SETTER_ARITY);
853 bool is_strict_reserved =
false;
859 if (!reserved_error_loc.
IsValid() && is_strict_reserved) {
865 if (!dupe_error_loc.
IsValid() && prev_value != 0) {
869 if (arity_restriction == FunctionLiteral::SETTER_ARITY)
break;
870 done = (peek() == Token::RPAREN);
882 if (is_lazily_parsed) {
898 if (name_is_strict_reserved) {
903 if (eval_args_error_loc.
IsValid()) {
908 if (dupe_error_loc.
IsValid()) {
913 if (reserved_error_loc.
IsValid()) {
bool allow_harmony_scoping() const
ExpressionT ParseClassLiteral(IdentifierT name, Scanner::Location function_name_location, bool name_is_strict_reserved, int pos, bool *ok)
bool Check(Token::Value token)
IdentifierT ParseIdentifierOrStrictReservedWord(bool *is_strict_reserved, bool *ok)
bool peek_any_identifier()
Traits::Type::Scope * scope_
void Expect(Token::Value token, bool *ok)
void ReportMessageAt(Scanner::Location location, const char *message, bool is_reference_error=false)
bool allow_natives_syntax() const
IdentifierT ParseIdentifier(AllowEvalOrArgumentsAsIdentifier, bool *ok)
Traits::Type::ExpressionList ParseArguments(bool *ok)
void CheckOctalLiteral(int beg_pos, int end_pos, bool *ok)
bool is_generator() const
bool CheckContextualKeyword(Vector< const char > keyword)
ExpressionT ParseAssignmentExpression(bool accept_IN, bool *ok)
bool stack_overflow() const
void ExpectSemicolon(bool *ok)
ExpressionT ParseExpression(bool accept_IN, bool *ok)
Scanner * scanner() const
FunctionState * function_state_
bool parenthesized_function_
void Consume(Token::Value token)
void ReportUnexpectedToken(Token::Value token)
@ kDontAllowEvalOrArguments
virtual void LogFunction(int start, int end, int literals, int properties, StrictMode strict_mode)=0
virtual void LogMessage(int start, int end, const char *message, const char *argument_opt, bool is_reference_error)=0
static PreParserExpression UseStrictStringLiteral()
bool IsIdentifier() const
static PreParserExpression Default()
static PreParserExpression StringLiteral()
PreParserIdentifier AsIdentifier() const
static PreParserIdentifier Eval()
static PreParserIdentifier Arguments()
static PreParserIdentifier Prototype()
static PreParserIdentifier FutureStrictReserved()
static PreParserIdentifier FutureReserved()
bool IsFutureReserved() const
bool IsEvalOrArguments() const
static PreParserIdentifier Let()
static PreParserIdentifier Default()
static PreParserIdentifier Constructor()
bool IsFutureStrictReserved() const
static PreParserIdentifier Yield()
bool IsUseStrictLiteral()
static PreParserStatement FunctionDeclaration()
static PreParserStatement Default()
static PreParserStatement ExpressionStatement(PreParserExpression expression)
Checkpoint(ParserBase< PreParserTraits > *parser)
PreParserIdentifier GetNumberAsSymbol(Scanner *scanner)
PreParserExpression ExpressionFromString(int pos, Scanner *scanner, PreParserFactory *factory=NULL)
PreParserExpression ParseV8Intrinsic(bool *ok)
static AstValueFactory * ast_value_factory()
PreParserExpression ParseFunctionLiteral(PreParserIdentifier 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)
PreParserIdentifier GetSymbol(Scanner *scanner)
void ReportMessageAt(Scanner::Location location, const char *message, const char *arg=NULL, bool is_reference_error=false)
Statement ParseReturnStatement(bool *ok)
Statement ParseTryStatement(bool *ok)
Statement ParseContinueStatement(bool *ok)
void ParseLazyFunctionLiteralBody(bool *ok)
Statement ParseVariableStatement(VariableDeclarationContext var_context, bool *ok)
PreParseResult PreParseLazyFunction(StrictMode strict_mode, bool is_generator, ParserRecorder *log)
Statement ParseFunctionDeclaration(bool *ok)
Statement ParseWithStatement(bool *ok)
Statement ParseStatement(bool *ok)
VariableDeclarationProperties
Statement ParseWhileStatement(bool *ok)
Expression ParseV8Intrinsic(bool *ok)
Statement ParseSourceElement(bool *ok)
bool CheckInOrOf(bool accept_OF)
Statement ParseSwitchStatement(bool *ok)
Statement ParseForStatement(bool *ok)
VariableDeclarationContext
Statement ParseClassDeclaration(bool *ok)
Statement ParseExpressionOrLabelledStatement(bool *ok)
Statement ParseVariableDeclarations(VariableDeclarationContext var_context, VariableDeclarationProperties *decl_props, int *num_decl, bool *ok)
SourceElements ParseSourceElements(int end_token, bool *ok)
Statement ParseDoWhileStatement(bool *ok)
Expression ParseFunctionLiteral(Identifier name, Scanner::Location function_name_location, bool name_is_strict_reserved, FunctionKind kind, int function_token_pos, FunctionLiteral::FunctionType function_type, FunctionLiteral::ArityRestriction arity_restriction, bool *ok)
Statement ParseThrowStatement(bool *ok)
Statement ParseBlock(bool *ok)
Statement ParseDebuggerStatement(bool *ok)
Statement ParseIfStatement(bool *ok)
Statement ParseBreakStatement(bool *ok)
int FindSymbol(DuplicateFinder *finder, int value)
bool UnescapedLiteralMatches(const char *data, int length)
Location peek_location() const
Token::Value current_token()
Location location() const
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
Vector< const char > CStrVector(const char *data)
kExpectedNofPropertiesOffset function_token_position
bool IsGeneratorFunction(FunctionKind kind)
bool IsConciseMethod(FunctionKind kind)
Debugger support for the V8 JavaScript engine.
static Location invalid()
Definitions and convenience functions for working with unicode.