32 void BreakableStatementChecker::VisitVariableDeclaration(
33 VariableDeclaration* decl) {
37 void BreakableStatementChecker::VisitFunctionDeclaration(
38 FunctionDeclaration* decl) {
42 void BreakableStatementChecker::VisitModuleDeclaration(
43 ModuleDeclaration* decl) {
47 void BreakableStatementChecker::VisitImportDeclaration(
48 ImportDeclaration* decl) {
52 void BreakableStatementChecker::VisitExportDeclaration(
53 ExportDeclaration* decl) {
57 void BreakableStatementChecker::VisitModuleLiteral(ModuleLiteral* module) {
61 void BreakableStatementChecker::VisitModuleVariable(ModuleVariable* module) {
65 void BreakableStatementChecker::VisitModulePath(ModulePath* module) {
69 void BreakableStatementChecker::VisitModuleUrl(ModuleUrl* module) {
73 void BreakableStatementChecker::VisitModuleStatement(ModuleStatement* stmt) {
77 void BreakableStatementChecker::VisitBlock(Block* stmt) {
81 void BreakableStatementChecker::VisitExpressionStatement(
82 ExpressionStatement* stmt) {
84 Visit(stmt->expression());
88 void BreakableStatementChecker::VisitEmptyStatement(EmptyStatement* stmt) {
92 void BreakableStatementChecker::VisitIfStatement(IfStatement* stmt) {
94 Visit(stmt->condition());
98 void BreakableStatementChecker::VisitContinueStatement(
99 ContinueStatement* stmt) {
103 void BreakableStatementChecker::VisitBreakStatement(BreakStatement* stmt) {
107 void BreakableStatementChecker::VisitReturnStatement(ReturnStatement* stmt) {
109 Visit(stmt->expression());
113 void BreakableStatementChecker::VisitWithStatement(WithStatement* stmt) {
114 Visit(stmt->expression());
118 void BreakableStatementChecker::VisitSwitchStatement(SwitchStatement* stmt) {
124 void BreakableStatementChecker::VisitDoWhileStatement(DoWhileStatement* stmt) {
130 void BreakableStatementChecker::VisitWhileStatement(WhileStatement* stmt) {
136 void BreakableStatementChecker::VisitForStatement(ForStatement* stmt) {
138 if (stmt->cond() !=
NULL) {
144 void BreakableStatementChecker::VisitForInStatement(ForInStatement* stmt) {
146 Visit(stmt->enumerable());
150 void BreakableStatementChecker::VisitForOfStatement(ForOfStatement* stmt) {
156 void BreakableStatementChecker::VisitTryCatchStatement(
157 TryCatchStatement* stmt) {
163 void BreakableStatementChecker::VisitTryFinallyStatement(
164 TryFinallyStatement* stmt) {
170 void BreakableStatementChecker::VisitDebuggerStatement(
171 DebuggerStatement* stmt) {
177 void BreakableStatementChecker::VisitCaseClause(CaseClause* clause) {
181 void BreakableStatementChecker::VisitFunctionLiteral(FunctionLiteral* expr) {
185 void BreakableStatementChecker::VisitClassLiteral(ClassLiteral* expr) {
186 if (expr->extends() !=
NULL) {
187 Visit(expr->extends());
192 void BreakableStatementChecker::VisitNativeFunctionLiteral(
193 NativeFunctionLiteral* expr) {
197 void BreakableStatementChecker::VisitConditional(Conditional* expr) {
201 void BreakableStatementChecker::VisitVariableProxy(VariableProxy* expr) {
205 void BreakableStatementChecker::VisitLiteral(Literal* expr) {
209 void BreakableStatementChecker::VisitRegExpLiteral(RegExpLiteral* expr) {
213 void BreakableStatementChecker::VisitObjectLiteral(ObjectLiteral* expr) {
217 void BreakableStatementChecker::VisitArrayLiteral(ArrayLiteral* expr) {
221 void BreakableStatementChecker::VisitAssignment(Assignment* expr) {
224 VariableProxy* proxy = expr->target()->AsVariableProxy();
225 Property* prop = expr->target()->AsProperty();
226 if (prop !=
NULL || (proxy !=
NULL && proxy->var()->IsUnallocated())) {
232 Visit(expr->value());
236 void BreakableStatementChecker::VisitYield(Yield* expr) {
238 Visit(expr->expression());
242 void BreakableStatementChecker::VisitThrow(
Throw* expr) {
244 Visit(expr->exception());
248 void BreakableStatementChecker::VisitProperty(Property* expr) {
254 void BreakableStatementChecker::VisitCall(Call* expr) {
260 void BreakableStatementChecker::VisitCallNew(CallNew* expr) {
266 void BreakableStatementChecker::VisitCallRuntime(CallRuntime* expr) {
270 void BreakableStatementChecker::VisitUnaryOperation(UnaryOperation* expr) {
271 Visit(expr->expression());
275 void BreakableStatementChecker::VisitCountOperation(CountOperation* expr) {
276 Visit(expr->expression());
280 void BreakableStatementChecker::VisitBinaryOperation(BinaryOperation* expr) {
284 Visit(expr->right());
289 void BreakableStatementChecker::VisitCompareOperation(CompareOperation* expr) {
291 Visit(expr->right());
295 void BreakableStatementChecker::VisitThisFunction(ThisFunction* expr) {
299 void BreakableStatementChecker::VisitSuperReference(SuperReference* expr) {}
302 #define __ ACCESS_MASM(masm())
310 if (!
script->IsUndefined() && !
script->source()->IsUndefined()) {
311 int len = String::cast(
script->source())->length();
312 isolate->
counters()->total_full_codegen_source_size()->Increment(len);
315 const int kInitialBufferSize = 4 *
KB;
324 if (cgen.HasStackOverflow()) {
333 !info->
function()->dont_optimize() &&
334 info->
function()->scope()->AllowsLazyCompilation());
340 code->set_allow_osr_at_loop_nesting_level(0);
341 code->set_profiler_ticks(0);
342 code->set_back_edge_table_offset(table_offset);
346 LOG_CODE_EVENT(isolate, CodeEndLinePosInfoRecordEvent(*code, line_info));
359 for (
unsigned i = 0;
i < length; ++
i) {
370 if (!vector->get(slot)->IsAllocationSite()) {
372 isolate()->factory()->NewAllocationSite();
373 vector->set(slot, *allocation_site);
385 for (
int i = 0;
i < length;
i++) {
389 code->set_deoptimization_data(*data);
396 DCHECK(!isolate()->heap()->InNewSpace(*info));
397 code->set_type_feedback_info(*info);
423 Handle<Code> ic = CodeFactory::LoadIC(isolate(), contextual_mode).code();
445 DCHECK(!call->return_is_recorded_);
446 call->return_is_recorded_ =
true;
455 unsigned pc_and_state =
482 if (op ==
Token::DIV ||op == Token::MOD)
return false;
483 if (FLAG_always_inline_smi_code)
return true;
505 codegen()->PrepareForBailoutBeforeSplit(condition(),
false,
NULL,
NULL);
506 codegen()->DoTest(
this);
527 codegen()->PrepareForBailoutBeforeSplit(condition(),
false,
NULL,
NULL);
528 codegen()->DoTest(
this);
533 Label* materialize_true,
534 Label* materialize_false,
537 Label** fall_through)
const {
540 *if_true = *if_false = *fall_through = materialize_true;
545 Label* materialize_true,
546 Label* materialize_false,
549 Label** fall_through)
const {
550 *if_true = *fall_through = materialize_true;
551 *if_false = materialize_false;
556 Label* materialize_true,
557 Label* materialize_false,
560 Label** fall_through)
const {
561 *if_true = *fall_through = materialize_true;
562 *if_false = materialize_false;
567 Label* materialize_true,
568 Label* materialize_false,
571 Label** fall_through)
const {
572 *if_true = true_label_;
573 *if_false = false_label_;
574 *fall_through = fall_through_;
589 for (
int i = 0;
i < declarations->length();
i++) {
590 ModuleDeclaration* declaration = declarations->
at(
i)->AsModuleDeclaration();
591 if (declaration !=
NULL) {
592 ModuleLiteral* module = declaration->module()->AsModuleLiteral();
593 if (module !=
NULL) {
597 DCHECK(interface->IsModule() && interface->IsFrozen());
605 __ CallRuntime(Runtime::kPushModuleContext, 2);
704 AstVisitor::VisitDeclarations(declarations);
728 void FullCodeGenerator::VisitModuleLiteral(ModuleLiteral* module) {
729 Block* block = module->body();
738 DCHECK(module_index_ < modules_->length());
742 DCHECK(interface->Index() >= 0);
745 __ CallRuntime(Runtime::kPushModuleContext, 2);
766 void FullCodeGenerator::VisitModuleVariable(ModuleVariable* module) {
772 void FullCodeGenerator::VisitModulePath(ModulePath* module) {
778 void FullCodeGenerator::VisitModuleUrl(ModuleUrl* module) {
780 Scope*
scope = module->body()->scope();
781 Interface*
interface =
scope_->interface();
783 DCHECK(interface->IsModule() && interface->IsFrozen());
785 DCHECK(module_index_ < modules_->length());
789 Handle<ModuleInfo> description =
828 if (position_recorded) {
835 void FullCodeGenerator::VisitSuperReference(SuperReference* super) {
836 __ CallRuntime(Runtime::kThrowUnsupportedSuperError, 0);
859 if (position_recorded) {
875 #define INLINE_FUNCTION_GENERATOR_ADDRESS(Name, argc, ressize) \
876 &FullCodeGenerator::Emit##Name,
882 #undef INLINE_FUNCTION_GENERATOR_ADDRESS
889 DCHECK(lookup_index >= 0);
890 DCHECK(
static_cast<size_t>(lookup_index) <
902 ((*this).*(generator))(expr);
906 void FullCodeGenerator::EmitGeneratorNext(CallRuntime* expr) {
908 DCHECK(args->length() == 2);
913 void FullCodeGenerator::EmitGeneratorThrow(CallRuntime* expr) {
914 ZoneList<Expression*>* args = expr->arguments();
915 DCHECK(args->length() == 2);
920 void FullCodeGenerator::EmitDebugBreakInOptimizedCode(CallRuntime* expr) {
925 void FullCodeGenerator::VisitBinaryOperation(BinaryOperation* expr) {
926 switch (expr->op()) {
941 }
else if (
context()->IsAccumulatorValue()) {
943 }
else if (
context()->IsStackValue()) {
945 }
else if (
context()->IsTest()) {
961 bool is_logical_and = expr->op() ==
Token::AND;
962 Comment cmnt(
masm_, is_logical_and ?
"[ Logical AND" :
"[ Logical OR");
971 if (is_logical_and) {
977 __ bind(&eval_right);
979 }
else if (
context()->IsAccumulatorValue()) {
984 Label discard, restore;
985 if (is_logical_and) {
986 DoTest(left, &discard, &restore, &restore);
988 DoTest(left, &restore, &discard, &restore);
997 }
else if (
context()->IsStackValue()) {
1003 if (is_logical_and) {
1004 DoTest(left, &discard, &done, &discard);
1006 DoTest(left, &done, &discard, &discard);
1015 if (is_logical_and) {
1021 __ bind(&eval_right);
1051 void FullCodeGenerator::VisitBlock(Block* stmt) {
1053 NestedBlock nested_block(
this, stmt);
1058 if (stmt->scope() ==
NULL) {
1063 { Comment cmnt(
masm_,
"[ Extend block context");
1066 __ CallRuntime(Runtime::kPushBlockContext, 2);
1073 { Comment cmnt(
masm_,
"[ Declarations");
1079 VisitStatements(stmt->statements());
1081 __ bind(nested_block.break_label());
1084 if (stmt->scope() !=
NULL) {
1094 void FullCodeGenerator::VisitModuleStatement(ModuleStatement* stmt) {
1095 Comment cmnt(
masm_,
"[ Module context");
1099 __ CallRuntime(Runtime::kPushModuleContext, 2);
1103 Scope* saved_scope =
scope_;
1104 scope_ = stmt->body()->scope();
1105 VisitStatements(stmt->body()->statements());
1114 void FullCodeGenerator::VisitExpressionStatement(ExpressionStatement* stmt) {
1115 Comment cmnt(
masm_,
"[ ExpressionStatement");
1121 void FullCodeGenerator::VisitEmptyStatement(EmptyStatement* stmt) {
1122 Comment cmnt(
masm_,
"[ EmptyStatement");
1127 void FullCodeGenerator::VisitIfStatement(IfStatement* stmt) {
1128 Comment cmnt(
masm_,
"[ IfStatement");
1130 Label then_part, else_part, done;
1132 if (stmt->HasElseStatement()) {
1133 VisitForControl(stmt->condition(), &then_part, &else_part, &then_part);
1135 __ bind(&then_part);
1136 Visit(stmt->then_statement());
1140 __ bind(&else_part);
1141 Visit(stmt->else_statement());
1145 __ bind(&then_part);
1146 Visit(stmt->then_statement());
1155 void FullCodeGenerator::VisitContinueStatement(ContinueStatement* stmt) {
1156 Comment cmnt(
masm_,
"[ ContinueStatement");
1159 int stack_depth = 0;
1160 int context_length = 0;
1166 while (!current->IsContinueTarget(stmt->target())) {
1167 current = current->Exit(&stack_depth, &context_length);
1169 __ Drop(stack_depth);
1170 if (context_length > 0) {
1171 while (context_length > 0) {
1179 __ jmp(current->AsIteration()->continue_label());
1183 void FullCodeGenerator::VisitBreakStatement(BreakStatement* stmt) {
1184 Comment cmnt(
masm_,
"[ BreakStatement");
1187 int stack_depth = 0;
1188 int context_length = 0;
1194 while (!current->IsBreakTarget(stmt->target())) {
1195 current = current->Exit(&stack_depth, &context_length);
1197 __ Drop(stack_depth);
1198 if (context_length > 0) {
1199 while (context_length > 0) {
1207 __ jmp(current->AsBreakable()->break_label());
1213 int stack_depth = 0;
1214 int context_length = 0;
1215 while (current !=
NULL) {
1216 current = current->Exit(&stack_depth, &context_length);
1218 __ Drop(stack_depth);
1222 void FullCodeGenerator::VisitReturnStatement(ReturnStatement* stmt) {
1232 void FullCodeGenerator::VisitWithStatement(WithStatement* stmt) {
1233 Comment cmnt(
masm_,
"[ WithStatement");
1238 __ CallRuntime(Runtime::kPushWithContext, 2);
1241 Scope* saved_scope =
scope();
1243 { WithOrCatch body(
this);
1244 Visit(stmt->statement());
1255 void FullCodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) {
1256 Comment cmnt(
masm_,
"[ DoWhileStatement");
1258 Label body, book_keeping;
1260 Iteration loop_statement(
this, stmt);
1264 Visit(stmt->body());
1268 __ bind(loop_statement.continue_label());
1273 loop_statement.break_label(),
1278 __ bind(&book_keeping);
1283 __ bind(loop_statement.break_label());
1288 void FullCodeGenerator::VisitWhileStatement(WhileStatement* stmt) {
1289 Comment cmnt(
masm_,
"[ WhileStatement");
1292 Iteration loop_statement(
this, stmt);
1300 loop_statement.break_label(),
1305 Visit(stmt->body());
1307 __ bind(loop_statement.continue_label());
1314 __ bind(loop_statement.break_label());
1319 void FullCodeGenerator::VisitForStatement(ForStatement* stmt) {
1320 Comment cmnt(
masm_,
"[ ForStatement");
1323 Iteration loop_statement(
this, stmt);
1328 if (stmt->init() !=
NULL) {
1329 Visit(stmt->init());
1338 Visit(stmt->body());
1341 __ bind(loop_statement.continue_label());
1342 if (stmt->next() !=
NULL) {
1343 Visit(stmt->next());
1354 if (stmt->cond() !=
NULL) {
1357 loop_statement.break_label(),
1358 loop_statement.break_label());
1364 __ bind(loop_statement.break_label());
1369 void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
1370 Comment cmnt(
masm_,
"[ TryCatchStatement");
1378 Label try_entry, handler_entry, exit;
1380 __ bind(&handler_entry);
1384 { Comment cmnt(
masm_,
"[ Extend catch context");
1385 __ Push(stmt->variable()->name());
1388 __ CallRuntime(Runtime::kPushCatchContext, 3);
1393 Scope* saved_scope =
scope();
1396 { WithOrCatch catch_body(
this);
1397 Visit(stmt->catch_block());
1406 __ bind(&try_entry);
1407 __ PushTryHandler(StackHandler::CATCH, stmt->index());
1408 { TryCatch try_body(
this);
1409 Visit(stmt->try_block());
1416 void FullCodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
1417 Comment cmnt(
masm_,
"[ TryFinallyStatement");
1440 Label try_entry, handler_entry, finally_entry;
1444 __ bind(&handler_entry);
1450 __ Call(&finally_entry);
1452 __ CallRuntime(Runtime::kReThrow, 1);
1455 __ bind(&finally_entry);
1457 { Finally finally_body(
this);
1458 Visit(stmt->finally_block());
1463 __ bind(&try_entry);
1464 __ PushTryHandler(StackHandler::FINALLY, stmt->index());
1465 { TryFinally try_body(
this, &finally_entry);
1466 Visit(stmt->try_block());
1474 __ Call(&finally_entry);
1478 void FullCodeGenerator::VisitDebuggerStatement(DebuggerStatement* stmt) {
1479 Comment cmnt(
masm_,
"[ DebuggerStatement");
1489 void FullCodeGenerator::VisitCaseClause(CaseClause* clause) {
1494 void FullCodeGenerator::VisitConditional(Conditional* expr) {
1495 Comment cmnt(
masm_,
"[ Conditional");
1496 Label true_case, false_case, done;
1497 VisitForControl(expr->condition(), &true_case, &false_case, &true_case);
1500 __ bind(&true_case);
1505 for_test->true_label(),
1506 for_test->false_label(),
1514 __ bind(&false_case);
1524 void FullCodeGenerator::VisitLiteral(Literal* expr) {
1525 Comment cmnt(
masm_,
"[ Literal");
1526 context()->Plug(expr->value());
1530 void FullCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
1531 Comment cmnt(
masm_,
"[ FunctionLiteral");
1534 Handle<SharedFunctionInfo> function_info =
1536 if (function_info.is_null()) {
1544 void FullCodeGenerator::VisitClassLiteral(ClassLiteral* expr) {
1546 Comment cmnt(
masm_,
"[ ClassLiteral");
1547 if (expr->extends() !=
NULL) {
1550 context()->Plug(isolate()->factory()->undefined_value());
1554 void FullCodeGenerator::VisitNativeFunctionLiteral(
1555 NativeFunctionLiteral* expr) {
1556 Comment cmnt(
masm_,
"[ NativeFunctionLiteral");
1559 Handle<String>
name = expr->name();
1561 expr->extension()->GetNativeFunctionTemplate(
1567 const int literals = fun->NumberOfLiterals();
1568 Handle<Code> code = Handle<Code>(fun->shared()->code());
1569 Handle<Code> construct_stub = Handle<Code>(fun->shared()->construct_stub());
1570 Handle<SharedFunctionInfo> shared =
1571 isolate()->factory()->NewSharedFunctionInfo(
1573 Handle<ScopeInfo>(fun->shared()->scope_info()),
1574 Handle<TypeFeedbackVector>(fun->shared()->feedback_vector()));
1575 shared->set_construct_stub(*construct_stub);
1578 shared->set_function_data(fun->shared()->function_data());
1579 int parameters = fun->shared()->formal_parameter_count();
1580 shared->set_formal_parameter_count(parameters);
1586 void FullCodeGenerator::VisitThrow(
Throw* expr) {
1587 Comment cmnt(
masm_,
"[ Throw");
1589 __ CallRuntime(Runtime::kThrow, 1);
1596 int* context_length) {
1598 __ Drop(*stack_depth);
1608 if (expr->IsLiteralCompareTypeof(&sub_expr, &check)) {
1613 if (expr->IsLiteralCompareUndefined(&sub_expr, isolate())) {
1618 if (expr->IsLiteralCompareNull(&sub_expr)) {
1639 if (
static_cast<int>(back_edges.
loop_depth(
i)) == loop_nesting_level) {
1640 DCHECK_EQ(INTERRUPT, GetBackEdgeState(isolate,
1643 PatchAt(unoptimized, back_edges.
pc(
i), ON_STACK_REPLACEMENT, patch);
1648 DCHECK(Verify(isolate, unoptimized));
1661 if (
static_cast<int>(back_edges.
loop_depth(
i)) <= loop_nesting_level) {
1662 DCHECK_NE(INTERRUPT, GetBackEdgeState(isolate,
1665 PatchAt(unoptimized, back_edges.
pc(
i), INTERRUPT, patch);
1671 DCHECK(Verify(isolate, unoptimized));
1677 Isolate* isolate = code->GetIsolate();
1678 Address pc = code->instruction_start() + pc_offset;
1680 PatchAt(*code,
pc, OSR_AFTER_STACK_CHECK, patch);
1686 Isolate* isolate = code->GetIsolate();
1687 Address pc = code->instruction_start() + pc_offset;
1689 if (OSR_AFTER_STACK_CHECK == GetBackEdgeState(isolate, *code,
pc)) {
1691 PatchAt(*code,
pc, ON_STACK_REPLACEMENT, patch);
1697 bool BackEdgeTable::Verify(
Isolate* isolate,
Code* unoptimized) {
1701 for (
uint32_t i = 0;
i < back_edges.length();
i++) {
1707 GetBackEdgeState(isolate,
1709 back_edges.pc(
i)) != INTERRUPT);
An object reference managed by the v8 garbage collector.
bool IsEmpty() const
Returns true if the handle is empty.
Isolate represents an isolated instance of the V8 engine.
static Local< Context > ToLocal(v8::internal::Handle< v8::internal::Context > obj)
static v8::internal::Handle< To > OpenHandle(v8::Local< From > handle)
void set_emit_debug_code(bool value)
void set_predictable_code_size(bool value)
bool serializer_enabled() const
PositionsRecorder * positions_recorder()
static void RemoveStackCheck(Handle< Code > code, uint32_t pc_offset)
uint32_t loop_depth(uint32_t index)
static void Patch(Isolate *isolate, Code *unoptimized_code)
static void Revert(Isolate *isolate, Code *unoptimized_code)
static void AddStackCheck(Handle< Code > code, uint32_t pc_offset)
Address pc(uint32_t index)
static bool is_valid(T value)
void Check(Statement *stmt)
Code * builtin(Name name)
static void PrintCode(Handle< Code > code, CompilationInfo *info)
static bool RecordPositions(MacroAssembler *masm, int pos, bool right_here=false)
static void MakeCodePrologue(CompilationInfo *info, const char *kind)
static Handle< Code > MakeCodeEpilogue(MacroAssembler *masm, Code::Flags flags, CompilationInfo *info)
void set_allow_osr_at_loop_nesting_level(int level)
int allow_osr_at_loop_nesting_level()
static Flags ComputeFlags(Kind kind, InlineCacheState ic_state=UNINITIALIZED, ExtraICState extra_ic_state=kNoExtraICState, StubType type=NORMAL, CacheHolderFlag holder=kCacheOnReceiver)
static const int kMaxLoopNestingMarker
void SetCode(Handle< Code > code)
bool IsOptimizable() const
Handle< Script > script() const
bool HasDeoptimizationSupport() const
bool will_serialize() const
FunctionLiteral * function() const
Isolate * isolate() const
static Handle< SharedFunctionInfo > BuildFunctionInfo(FunctionLiteral *node, Handle< Script > script, CompilationInfo *outer)
static void GenerateSlot(MacroAssembler *masm)
static Handle< DeoptimizationOutputData > New(Isolate *isolate, int number_of_deopt_points, PretenureFlag pretenure)
virtual bool ResultOverwriteAllowed() const
virtual void PlugTOS() const
virtual void PrepareTest(Label *materialize_true, Label *materialize_false, Label **if_true, Label **if_false, Label **fall_through) const
virtual void Plug(bool flag) const
virtual void PrepareTest(Label *materialize_true, Label *materialize_false, Label **if_true, Label **if_false, Label **fall_through) const
virtual void PlugTOS() const
virtual void Plug(bool flag) const
virtual void PrepareTest(Label *materialize_true, Label *materialize_false, Label **if_true, Label **if_false, Label **fall_through) const
virtual void PlugTOS() const
virtual void Plug(bool flag) const
Label * true_label() const
virtual void PrepareTest(Label *materialize_true, Label *materialize_false, Label **if_true, Label **if_false, Label **fall_through) const
static const TestContext * cast(const ExpressionContext *context)
Label * false_label() const
virtual void Plug(bool flag) const
virtual void PlugTOS() const
Label * fall_through() const
virtual NestedStatement * Exit(int *stack_depth, int *context_length)
void(FullCodeGenerator::* InlineFunctionGenerator)(CallRuntime *expr)
ZoneList< BailoutEntry > bailout_entries_
void VisitArithmeticExpression(BinaryOperation *expr)
void EmitBinaryOp(BinaryOperation *expr, Token::Value op, OverwriteMode mode)
void EmitLiteralCompareTypeof(Expression *expr, Expression *sub_expr, Handle< String > check)
void VisitDeclarations(ZoneList< Declaration * > *declarations)
void PrepareForBailoutForId(BailoutId id, State state)
void EmitNewClosure(Handle< SharedFunctionInfo > info, bool pretenure)
static Register context_register()
ZoneList< Handle< Object > > * globals_
void VisitForControl(Expression *expr, Label *if_true, Label *if_false, Label *fall_through)
void PushFunctionArgumentForContextAllocation()
void CallLoadIC(ContextualMode mode, TypeFeedbackId id=TypeFeedbackId::None())
bool generate_debug_code_
void RecordBackEdge(BailoutId osr_ast_id)
void VisitLogicalExpression(BinaryOperation *expr)
static bool MakeCode(CompilationInfo *info)
friend class NestedStatement
void EmitReturnSequence()
void DeclareGlobals(Handle< FixedArray > pairs)
void VisitForStackValue(Expression *expr)
void AllocateModules(ZoneList< Declaration * > *declarations)
void PopulateDeoptimizationData(Handle< Code > code)
void EmitUnwindBeforeReturn()
NestedStatement * nesting_stack_
FunctionLiteral * function()
bool TryLiteralCompare(CompareOperation *compare)
void increment_loop_depth()
void SetStatementPosition(Statement *stmt)
Handle< FixedArray > FeedbackVector()
void StoreToFrameField(int frame_offset, Register value)
void LoadContextField(Register dst, int context_index)
const ExpressionContext * context()
void EmitBackEdgeBookkeeping(IterationStatement *stmt, Label *back_edge_target)
void DoTest(Expression *condition, Label *if_true, Label *if_false, Label *fall_through)
void PopulateTypeFeedbackInfo(Handle< Code > code)
void VisitForAccumulatorValue(Expression *expr)
void PrepareForBailout(Expression *node, State state)
void CallStoreIC(TypeFeedbackId id=TypeFeedbackId::None())
void DeclareModules(Handle< FixedArray > descriptions)
void EmitGeneratorResume(Expression *generator, Expression *value, JSGeneratorObject::ResumeMode resume_mode)
void VisitForEffect(Expression *expr)
void SetFunctionPosition(FunctionLiteral *fun)
int DeclareGlobalsFlags()
void VisitComma(BinaryOperation *expr)
void SetExpressionPosition(Expression *expr)
void decrement_loop_depth()
void EmitInlineSmiBinaryOp(BinaryOperation *expr, Token::Value op, OverwriteMode mode, Expression *left, Expression *right)
void EmitLiteralCompareNil(CompareOperation *expr, Expression *sub_expr, NilValue nil)
void CallIC(Handle< Code > code, TypeFeedbackId id=TypeFeedbackId::None())
ZoneList< BackEdgeEntry > back_edges_
void EnsureSlotContainsAllocationSite(int slot)
Handle< FixedArray > modules_
Handle< Script > script()
unsigned EmitBackEdgeTable()
void EmitInlineRuntimeCall(CallRuntime *expr)
void SetSourcePosition(int pos)
InlineFunctionGenerator FindInlineFunctionGenerator(Runtime::FunctionId id)
static const InlineFunctionGenerator kInlineFunctionGenerators[]
void RecordJSReturnSite(Call *call)
static Register result_register()
bool ShouldInlineSmiCase(Token::Value op)
Handle< FixedArray > handler_table()
void SetReturnPosition(FunctionLiteral *fun)
void VisitInDuplicateContext(Expression *expr)
bool has_pending_exception()
static Handle< ModuleInfo > Create(Isolate *isolate, Interface *interface, Scope *scope)
static const int kNoPosition
Variable * module_var() const
bool is_global_scope() const
ZoneList< Declaration * > * declarations()
Interface * interface() const
Handle< ScopeInfo > GetScopeInfo()
bool is_module_scope() const
static Smi * FromInt(int value)
static bool IsValid(intptr_t value)
static bool HaveASnapshotToStartFrom()
static const int kContextOffset
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 literals(0o77, 0b11)") DEFINE_BOOL(harmony_object_literals
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 mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
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 INLINE_FUNCTION_GENERATOR_ADDRESS(Name, argc, ressize)
#define LOG_CODE_EVENT(isolate, Call)
#define CHECK_EQ(expected, value)
#define DCHECK_NE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
static int Push(SpecialRPOStackFrame *stack, int depth, BasicBlock *child, int unvisited)
static LifetimePosition Min(LifetimePosition a, LifetimePosition b)
Handle< T > handle(T *t, Isolate *isolate)
Debugger support for the V8 JavaScript engine.
static Handle< Value > Throw(Isolate *isolate, const char *message)
#define INLINE_FUNCTION_LIST(F)