21 class CompilationInfo;
41 : backing_(backing) { }
45 int start_pos() {
return backing_[kStartPositionIndex]; }
46 int end_pos() {
return backing_[kEndPositionIndex]; }
51 backing_[kStrictModeIndex] ==
STRICT);
52 return static_cast<StrictMode>(backing_[kStrictModeIndex]);
55 bool is_valid() {
return !backing_.is_empty(); }
104 template <
typename T,
int initial_size>
143 if (
i ==
list_->length()) {
191 int min,
int max, RegExpQuantifier::QuantifierType type);
207 enum {ADD_NONE, ADD_CHAR, ADD_TERM, ADD_ASSERT, ADD_ATOM} last_added_;
208 #define LAST(x) last_added_ = x;
267 static const int kMaxCaptures = 1 << 16;
268 static const uc32 kEndMarker = (1 << 21);
283 int disjunction_capture_index,
285 : previous_state_(previous_state),
287 group_type_(group_type),
288 disjunction_capture_index_(disjunction_capture_index) {}
317 bool has_next() {
return next_pos_ < in()->length(); }
382 template <
typename FunctionState>
384 function_state->saved_id_gen_ = *function_state->ast_node_id_gen_;
385 *function_state->ast_node_id_gen_ =
389 template <
typename FunctionState>
391 if (function_state->outer_function_state_ !=
NULL) {
392 *function_state->ast_node_id_gen_ = function_state->saved_id_gen_;
411 return expression->AsVariableProxy()->raw_name();
415 return ObjectLiteral::IsBoilerplateProperty(property);
419 return string->AsArrayIndex(index);
429 FunctionLiteral* func_to_infer) {
434 Scope* scope, ObjectLiteralProperty* property,
bool* has_function) {
437 value->AsFunctionLiteral() !=
NULL) {
438 *has_function =
true;
439 value->AsFunctionLiteral()->set_pretenure();
501 const char* arg =
NULL,
502 bool is_reference_error =
false);
504 const char* arg =
NULL,
505 bool is_reference_error =
false);
508 bool is_reference_error =
false);
512 bool is_reference_error =
false);
591 FunctionLiteral::ArityRestriction arity_restriction,
bool* ok);
593 int* materialized_literal_count,
594 int* expected_property_count,
bool* ok);
597 Token::Value fvar_init_op,
bool is_generator,
bool* ok);
635 if (parser.
Parse()) {
688 Scope** ad_hoc_eval_scope);
706 bool is_eval,
bool is_global,
707 Scope** ad_hoc_eval_scope,
bool* ok);
776 FunctionLiteral::ArityRestriction arity_restriction,
bool* ok);
816 int* materialized_literal_count,
817 int* expected_property_count,
874 int* materialized_literal_count,
875 int* expected_property_count,
878 function_name, materialized_literal_count, expected_property_count, ok);
884 Token::Value fvar_init_op,
bool is_generator,
bool* ok) {
@ kUseCounterFeatureCount
bool IsOneByteEqualTo(const char *data) const
RegExpBuilder * builder()
SubexpressionType group_type()
RegExpParserState * previous_state()
SubexpressionType group_type_
int disjunction_capture_index_
RegExpParserState * previous_state_
RegExpParserState(RegExpParserState *previous_state, SubexpressionType group_type, int disjunction_capture_index, Zone *zone)
static bool ParseRegExp(FlatStringReader *input, bool multiline, RegExpCompileData *result, Zone *zone)
RegExpTree * ParseCharacterClass()
RegExpParser(FlatStringReader *in, Handle< String > *error, bool multiline_mode, Zone *zone)
RegExpTree * ParsePattern()
Handle< String > * error_
RegExpTree * ParseDisjunction()
uc32 ParseClassCharacterEscape()
RegExpTree * ParseGroup()
bool is_scanned_for_captures_
ZoneList< RegExpCapture * > * captures_
void set_contains_anchor()
CharacterRange ParseClassAtom(uc16 *char_class)
Vector< unsigned > backing_
bool ParseHexEscape(int length, uc32 *value)
FunctionEntry(Vector< unsigned > backing)
bool ParseBackReferenceIndex(int *index_out)
RegExpTree * ReportError(Vector< const char > message)
bool ParseIntervalQuantifier(int *min_out, int *max_out)
static BailoutId FirstUsable()
ZoneList< T * > * GetList(Zone *zone)
void Add(T *value, Zone *zone)
ScriptCompiler::CompileOptions compile_options() const
Handle< Script > script() const
AstValueFactory * ast_value_factory() const
void SetStrictMode(StrictMode strict_mode)
FunctionLiteral * function() const
Isolate * isolate() const
static Handle< FixedArray > GetElements(Handle< FixedArray > value)
static LiteralType GetLiteralType(Handle< FixedArray > value)
static bool IsCompileTimeValue(Expression *expression)
static const int kLiteralTypeSlot
@ OBJECT_LITERAL_SLOW_ELEMENTS
@ OBJECT_LITERAL_FAST_ELEMENTS
static const int kElementsSlot
DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue)
static Handle< FixedArray > GetValue(Isolate *isolate, Expression *expression)
void AddFunction(FunctionLiteral *func_to_infer)
void PushLiteralName(const AstRawString *name)
StackGuard * stack_guard()
UnicodeCache * unicode_cache()
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
DISALLOW_COPY_AND_ASSIGN(ParseData)
ScriptData * script_data_
FunctionEntry GetFunctionEntry(int start)
ParseData(ScriptData *script_data)
Traits::Type::Scope * scope_
void set_allow_lazy(bool allow)
bool is_generator() const
Scanner * scanner() const
static ZoneList< Expression * > * NullExpressionList()
ZoneList< Statement * > * ParseEagerFunctionBody(const AstRawString *name, int pos, Variable *fvar, Token::Value fvar_init_op, bool is_generator, bool *ok)
Scope * NewScope(Scope *parent_scope, ScopeType scope_type)
static void InferFunctionName(FuncNameInferrer *fni, FunctionLiteral *func_to_infer)
static bool IsThisProperty(Expression *expression)
static FunctionLiteral * EmptyFunctionLiteral()
static Expression * EmptyArrowParamList()
static const AstRawString * AsIdentifier(Expression *expression)
const AstRawString * GetSymbol(Scanner *scanner)
Expression * NewThrowReferenceError(const char *type, int pos)
static void CheckAssigningFunctionLiteralToProperty(Expression *left, Expression *right)
void ReportMessage(const char *message, const char *arg=NULL, bool is_reference_error=false)
ZoneList< ObjectLiteral::Property * > * NewPropertyList(int size, Zone *zone)
static void PushLiteralName(FuncNameInferrer *fni, const AstRawString *id)
void SkipLazyFunctionBody(const AstRawString *name, int *materialized_literal_count, int *expected_property_count, bool *ok)
void CheckConflictingVarDeclarations(v8::internal::Scope *scope, bool *ok)
Expression * ParseV8Intrinsic(bool *ok)
Expression * ExpressionFromString(int pos, Scanner *scanner, AstNodeFactory< AstConstructionVisitor > *factory)
static void TearDownFunctionState(FunctionState *function_state)
bool IsPrototype(const AstRawString *identifier) const
const AstRawString * GetNextSymbol(Scanner *scanner)
static bool IsBoilerplateProperty(ObjectLiteral::Property *property)
Expression * NewThrowSyntaxError(const char *type, const AstRawString *arg, int pos)
static void CheckFunctionLiteralInsideTopLevelObjectLiteral(Scope *scope, ObjectLiteralProperty *property, bool *has_function)
bool IsConstructor(const AstRawString *identifier) const
int DeclareArrowParametersFromExpression(Expression *expression, Scope *scope, Scanner::Location *dupe_loc, bool *ok)
bool IsEvalOrArguments(const AstRawString *identifier) const
Expression * NewThrowError(const AstRawString *constructor, const char *type, const AstRawString *arg, int pos)
Expression * NewThrowTypeError(const char *type, const AstRawString *arg, int pos)
static const AstRawString * EmptyIdentifier()
Expression * ThisExpression(Scope *scope, AstNodeFactory< AstConstructionVisitor > *factory, int pos=RelocInfo::kNoPosition)
static bool IsArrayIndex(const AstRawString *string, uint32_t *index)
static Expression * EmptyExpression()
void PushPropertyName(FuncNameInferrer *fni, Expression *expression)
void ReportMessageAt(Scanner::Location source_location, const char *message, const char *arg=NULL, bool is_reference_error=false)
AstValueFactory * ast_value_factory()
static void SetUpFunctionState(FunctionState *function_state)
Expression * ClassLiteral(const AstRawString *name, Expression *extends, Expression *constructor, ZoneList< ObjectLiteral::Property * > *properties, int pos, AstNodeFactory< AstConstructionVisitor > *factory)
static Expression * MarkExpressionAsAssigned(Expression *expression)
Literal * ExpressionFromLiteral(Token::Value token, int pos, Scanner *scanner, AstNodeFactory< AstConstructionVisitor > *factory)
ZoneList< v8::internal::Statement * > * NewStatementList(int size, Zone *zone)
Expression * ExpressionFromIdentifier(const AstRawString *name, int pos, Scope *scope, AstNodeFactory< AstConstructionVisitor > *factory)
const AstRawString * GetNumberAsSymbol(Scanner *scanner)
static ObjectLiteralProperty * EmptyObjectLiteralProperty()
Expression * BuildUnaryExpression(Expression *expression, Token::Value op, int pos, AstNodeFactory< AstConstructionVisitor > *factory)
bool ShortcutNumericLiteralBinaryExpression(Expression **x, Expression *y, Token::Value op, int pos, AstNodeFactory< AstConstructionVisitor > *factory)
void CheckPossibleEvalCall(Expression *expression, Scope *scope)
ParserTraits(Parser *parser)
Expression * SuperReference(Scope *scope, AstNodeFactory< AstConstructionVisitor > *factory, int pos=RelocInfo::kNoPosition)
Expression * GetIterator(Expression *iterable, AstNodeFactory< AstConstructionVisitor > *factory)
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)
ZoneList< v8::internal::Expression * > * NewExpressionList(int size, Zone *zone)
const AstRawString * EmptyIdentifierString()
Literal * GetLiteralTheHole(int position, AstNodeFactory< AstConstructionVisitor > *factory)
static Literal * EmptyLiteral()
bool IsFutureStrictReserved(const AstRawString *identifier) const
static bool IsIdentifier(Expression *expression)
ScriptCompiler::CompileOptions compile_options() const
VariableDeclarationContext
IterationStatement * LookupContinueTarget(const AstRawString *label, bool *ok)
Statement * ParseExpressionOrLabelledStatement(ZoneList< const AstRawString * > *labels, bool *ok)
Block * ParseScopedBlock(ZoneList< const AstRawString * > *labels, bool *ok)
Statement * ParseReturnStatement(bool *ok)
Block * ParseBlock(ZoneList< const AstRawString * > *labels, bool *ok)
Scope * DeclarationScope(VariableMode mode)
Statement * ParseBlockElement(ZoneList< const AstRawString * > *labels, bool *ok)
Scope * NewScope(Scope *parent, ScopeType type)
bool TargetStackContainsLabel(const AstRawString *label)
int use_counts_[v8::Isolate::kUseCounterFeatureCount]
IfStatement * ParseIfStatement(ZoneList< const AstRawString * > *labels, 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)
Statement * ParseModuleElement(ZoneList< const AstRawString * > *labels, bool *ok)
Statement * ParseContinueStatement(bool *ok)
void RegisterTargetUse(Label *target, Target *stop)
void CheckConflictingVarDeclarations(Scope *scope, bool *ok)
Block * ParseImportDeclaration(bool *ok)
Expression * ParseV8Intrinsic(bool *ok)
Statement * ParseNativeDeclaration(bool *ok)
Block * ParseVariableDeclarations(VariableDeclarationContext var_context, VariableDeclarationProperties *decl_props, ZoneList< const AstRawString * > *names, const AstRawString **out, bool *ok)
SwitchStatement * ParseSwitchStatement(ZoneList< const AstRawString * > *labels, bool *ok)
Statement * ParseExportDeclaration(bool *ok)
WhileStatement * ParseWhileStatement(ZoneList< const AstRawString * > *labels, bool *ok)
Module * ParseModulePath(bool *ok)
Block * ParseVariableStatement(VariableDeclarationContext var_context, ZoneList< const AstRawString * > *names, bool *ok)
BreakableStatement * LookupBreakTarget(const AstRawString *label, bool *ok)
VariableProxy * NewUnresolved(const AstRawString *name, VariableMode mode, Interface *interface)
Handle< Script > script() const
FunctionLiteral * ParseLazy()
void HandleSourceURLComments()
Literal * GetLiteralUndefined(int position)
void * ParseSourceElements(ZoneList< Statement * > *processor, int end_token, bool is_eval, bool is_global, Scope **ad_hoc_eval_scope, bool *ok)
bool pending_error_is_reference_error_
CaseClause * ParseCaseClause(bool *default_seen_ptr, bool *ok)
Module * ParseModuleVariable(bool *ok)
PreParser::PreParseResult ParseLazyFunctionBodyWithPreParser(SingletonLogger *logger)
const AstRawString * pending_error_arg_
void Declare(Declaration *declaration, bool resolve, bool *ok)
Statement * ParseStatement(ZoneList< const AstRawString * > *labels, bool *ok)
Statement * ParseForStatement(ZoneList< const AstRawString * > *labels, bool *ok)
Module * ParseModuleUrl(bool *ok)
Statement * ParseClassDeclaration(ZoneList< const AstRawString * > *names, bool *ok)
Statement * ParseWithStatement(ZoneList< const AstRawString * > *labels, bool *ok)
Expression * MakeCatchContext(Handle< String > id, VariableProxy *value)
ParseData * cached_parse_data_
FunctionLiteral * DoParseProgram(CompilationInfo *info, Scope **scope, Scope **ad_hoc_eval_scope)
FunctionLiteral * ParseProgram()
HistogramTimer * pre_parse_timer_
Statement * DesugarLetBindingsInForStatement(Scope *inner_scope, ZoneList< const AstRawString * > *names, ForStatement *loop, Statement *init, Expression *cond, Statement *next, Statement *body, bool *ok)
static bool Parse(CompilationInfo *info, bool allow_lazy=false)
const char * pending_error_char_arg_
CompilationInfo * info() const
void SkipLazyFunctionBody(const AstRawString *function_name, int *materialized_literal_count, int *expected_property_count, bool *ok)
bool CheckInOrOf(bool accept_OF, ForEachStatement::VisitMode *visit_mode)
VariableDeclarationProperties
DebuggerStatement * ParseDebuggerStatement(bool *ok)
ZoneList< Statement * > * ParseEagerFunctionBody(const AstRawString *function_name, int pos, Variable *fvar, Token::Value fvar_init_op, bool is_generator, bool *ok)
void InitializeForEachStatement(ForEachStatement *stmt, Expression *each, Expression *subject, Statement *body)
Statement * ParseBreakStatement(ZoneList< const AstRawString * > *labels, bool *ok)
DoWhileStatement * ParseDoWhileStatement(ZoneList< const AstRawString * > *labels, bool *ok)
static const int kMaxNumFunctionLocals
Scanner::Location pending_error_location_
Statement * ParseModuleDeclaration(ZoneList< const AstRawString * > *names, bool *ok)
Statement * ParseFunctionDeclaration(ZoneList< const AstRawString * > *names, bool *ok)
Module * ParseModuleLiteral(bool *ok)
Parser(CompilationInfo *info, ParseInfo *parse_info)
AstValueFactory * ast_value_factory() const
const char * pending_error_message_
Module * ParseModule(bool *ok)
int total_preparse_skipped_
Statement * ParseThrowStatement(bool *ok)
Module * ParseModuleSpecifier(bool *ok)
TryStatement * ParseTryStatement(bool *ok)
PreParser * reusable_preparser_
void AddCharacter(uc16 character)
void AddAtom(RegExpTree *tree)
ZoneList< uc16 > * characters_
BufferedZoneList< RegExpTree, 2 > alternatives_
void AddAssertion(RegExpTree *tree)
RegExpBuilder(Zone *zone)
BufferedZoneList< RegExpTree, 2 > text_
BufferedZoneList< RegExpTree, 2 > terms_
void AddQuantifierToAtom(int min, int max, RegExpQuantifier::QuantifierType type)
static const int kNoPosition
bool IdentifierIsFutureStrictReserved(const AstRawString *string) const
bool is_global_scope() const
Scope * DeclarationScope()
const byte * data() const
enable harmony numeric enable harmony object literal extensions Optimize object size
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)
static int min(int a, int b)
bool IsLexicalVariableMode(VariableMode mode)
kExpectedNofPropertiesOffset function_token_position
bool IsAligned(T value, U alignment)
Debugger support for the V8 JavaScript engine.
v8::internal::Literal * Literal
const AstRawString * Identifier
ZoneList< v8::internal::Expression * > * ExpressionList
ObjectLiteral::Property * ObjectLiteralProperty
v8::internal::FunctionLiteral * FunctionLiteral
v8::internal::Parser * Parser
Vector< VariableProxy * > ParameterIdentifierVector
v8::internal::Expression * Expression
v8::internal::ClassLiteral * ClassLiteral
v8::internal::Scope * ScopePtr
Variable GeneratorVariable
v8::internal::AstProperties AstProperties
ZoneList< ObjectLiteral::Property * > * PropertyList
AstNodeFactory< AstConstructionVisitor > Factory
ZoneList< v8::internal::Statement * > * StatementList
v8::internal::Scope Scope
UnicodeCache * unicode_cache
#define T(name, string, precedence)