Commit 4a7722c9 authored by yangguo's avatar yangguo Committed by Commit bot

[interpreter, debugger] add some missing statement positions.

R=rmcilroy@chromium.org, vogelheim@chromium.org
BUG=v8:4690
LOG=N

Review URL: https://codereview.chromium.org/1770773002

Cr-Commit-Position: refs/heads/master@{#34569}
parent 3293c486
......@@ -879,7 +879,6 @@ void FullCodeGenerator::VisitExpressionStatement(ExpressionStatement* stmt) {
void FullCodeGenerator::VisitEmptyStatement(EmptyStatement* stmt) {
Comment cmnt(masm_, "[ EmptyStatement");
SetStatementPosition(stmt);
}
......
......@@ -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();
......
......@@ -514,20 +514,10 @@
##############################################################################
['ignition == True', {
# TODO(yangguo,4690): Test failures in debugger tests.
'test-debug/DebugStepKeyedLoadLoop': [FAIL],
'test-debug/DebugStepKeyedStoreLoop': [FAIL],
'test-debug/DebugStepNamedLoadLoop': [FAIL],
'test-debug/BreakPointConstructCallWithGC': [PASS, FAIL],
'test-debug/DebugStepNamedStoreLoop': [FAIL],
'test-debug/DebugStepSwitch': [FAIL],
'test-debug/DebugStepWhile': [FAIL],
'test-debug/DebugStepFor': [FAIL],
'test-debug/DebugStepForContinue': [FAIL],
'test-debug/DebugStepForIn': [FAIL],
'test-debug/DebugStepDoWhile': [FAIL],
'test-debug/DebugConditional': [FAIL],
'test-debug/DebugStepForBreak': [FAIL],
'test-debug/DebugStepWith': [FAIL],
# BUG(4333). Function name inferrer does not work for ES6 clases.
'test-func-name-inference/UpperCaseClass': [TIMEOUT],
......
......@@ -796,15 +796,12 @@
# TODO(yangguo,4690): assertion failures in debugger tests.
'debug-allscopes-on-debugger': [FAIL],
'debug-return-value': [FAIL],
'debug-stepin-accessor-ic': [FAIL],
'debug-stepnext-do-while': [FAIL],
'es6/debug-stepnext-for': [FAIL],
'es6/debug-stepin-generators': [FAIL],
'es6/debug-stepin-string-template': [FAIL],
'es6/debug-promises/stepin-constructor': [FAIL],
'harmony/debug-stepin-proxies': [FAIL],
'regress/regress-crbug-119800': [FAIL],
'regress/regress-crbug-467180': [FAIL],
'regress/regress-opt-after-debug-deopt': [FAIL],
'regress/regress-crbug-568477-2': [FAIL],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment