| Index: src/interpreter/bytecode-generator.cc
|
| diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
|
| index c4026b59ec1659c024f231fca7d6a561b6c39a72..ee7da67db2ed4ad56c3666dabd405c6268cbe1b0 100644
|
| --- a/src/interpreter/bytecode-generator.cc
|
| +++ b/src/interpreter/bytecode-generator.cc
|
| @@ -871,11 +871,13 @@ void BytecodeGenerator::VisitSloppyBlockFunctionStatement(
|
|
|
|
|
| void BytecodeGenerator::VisitContinueStatement(ContinueStatement* stmt) {
|
| + builder()->SetStatementPosition(stmt);
|
| execution_control()->Continue(stmt->target());
|
| }
|
|
|
|
|
| void BytecodeGenerator::VisitBreakStatement(BreakStatement* stmt) {
|
| + builder()->SetStatementPosition(stmt);
|
| execution_control()->Break(stmt->target());
|
| }
|
|
|
| @@ -888,6 +890,7 @@ void BytecodeGenerator::VisitReturnStatement(ReturnStatement* stmt) {
|
|
|
|
|
| void BytecodeGenerator::VisitWithStatement(WithStatement* stmt) {
|
| + builder()->SetStatementPosition(stmt);
|
| VisitForAccumulatorValue(stmt->expression());
|
| builder()->CastAccumulatorToJSObject();
|
| VisitNewLocalWithContext();
|
| @@ -903,6 +906,8 @@ void BytecodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
|
| ControlScopeForBreakable scope(this, stmt, &switch_builder);
|
| int default_index = -1;
|
|
|
| + builder()->SetStatementPosition(stmt);
|
| +
|
| // Keep the switch value in a register until a case matches.
|
| Register tag = VisitForRegisterValue(stmt->tag());
|
|
|
| @@ -957,6 +962,7 @@ void BytecodeGenerator::VisitIterationBody(IterationStatement* stmt,
|
| }
|
|
|
| void BytecodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) {
|
| + builder()->SetStatementPosition(stmt);
|
| LoopBuilder loop_builder(builder());
|
| loop_builder.LoopHeader();
|
| if (stmt->cond()->ToBooleanIsFalse()) {
|
| @@ -969,6 +975,7 @@ void BytecodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) {
|
| } else {
|
| VisitIterationBody(stmt, &loop_builder);
|
| loop_builder.Condition();
|
| + builder()->SetExpressionAsStatementPosition(stmt->cond());
|
| VisitForAccumulatorValue(stmt->cond());
|
| loop_builder.JumpToHeaderIfTrue();
|
| }
|
| @@ -985,6 +992,7 @@ void BytecodeGenerator::VisitWhileStatement(WhileStatement* stmt) {
|
| loop_builder.LoopHeader();
|
| loop_builder.Condition();
|
| if (!stmt->cond()->ToBooleanIsTrue()) {
|
| + builder()->SetExpressionAsStatementPosition(stmt->cond());
|
| VisitForAccumulatorValue(stmt->cond());
|
| loop_builder.BreakIfFalse();
|
| }
|
| @@ -996,6 +1004,7 @@ void BytecodeGenerator::VisitWhileStatement(WhileStatement* stmt) {
|
|
|
| void BytecodeGenerator::VisitForStatement(ForStatement* stmt) {
|
| if (stmt->init() != nullptr) {
|
| + builder()->SetStatementPosition(stmt->init());
|
| Visit(stmt->init());
|
| }
|
| if (stmt->cond() && stmt->cond()->ToBooleanIsFalse()) {
|
| @@ -1008,12 +1017,14 @@ void BytecodeGenerator::VisitForStatement(ForStatement* stmt) {
|
| loop_builder.LoopHeader();
|
| loop_builder.Condition();
|
| if (stmt->cond() && !stmt->cond()->ToBooleanIsTrue()) {
|
| + builder()->SetExpressionAsStatementPosition(stmt->cond());
|
| VisitForAccumulatorValue(stmt->cond());
|
| loop_builder.BreakIfFalse();
|
| }
|
| VisitIterationBody(stmt, &loop_builder);
|
| if (stmt->next() != nullptr) {
|
| loop_builder.Next();
|
| + builder()->SetStatementPosition(stmt->next());
|
| Visit(stmt->next());
|
| }
|
| loop_builder.JumpToHeader();
|
| @@ -1106,6 +1117,7 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
| BytecodeLabel subject_null_label, subject_undefined_label;
|
|
|
| // Prepare the state for executing ForIn.
|
| + builder()->SetExpressionAsStatementPosition(stmt->subject());
|
| VisitForAccumulatorValue(stmt->subject());
|
| builder()->JumpIfUndefined(&subject_undefined_label);
|
| builder()->JumpIfNull(&subject_null_label);
|
| @@ -1135,6 +1147,7 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
| FeedbackVectorSlot slot = stmt->ForInFeedbackSlot();
|
| builder()->ForInNext(receiver, index, cache_type, feedback_index(slot));
|
| loop_builder.ContinueIfUndefined();
|
| + builder()->SetExpressionAsStatementPosition(stmt->each());
|
| VisitForInAssignment(stmt->each(), stmt->EachFeedbackSlot());
|
| VisitIterationBody(stmt, &loop_builder);
|
| loop_builder.Next();
|
| @@ -1155,6 +1168,7 @@ void BytecodeGenerator::VisitForOfStatement(ForOfStatement* stmt) {
|
|
|
| loop_builder.LoopHeader();
|
| loop_builder.Next();
|
| + builder()->SetExpressionAsStatementPosition(stmt->next_result());
|
| VisitForEffect(stmt->next_result());
|
| VisitForAccumulatorValue(stmt->result_done());
|
| loop_builder.BreakIfTrue();
|
|
|