Commit bc7eb04d authored by kozyatinskiy's avatar kozyatinskiy Committed by Commit bot

[debug] remove StepFrame

This action was used by inspector for blackboxing and isn't needed with new blackboxing implementation inside V8.

BUG=none
R=yangguo@chromium.org,clemensh@chromium.org
TBR=bmeurer@chromium.org

Review-Url: https://codereview.chromium.org/2650943011
Cr-Commit-Position: refs/heads/master@{#42670}
parent f7a3ede0
......@@ -467,7 +467,6 @@ void Builtins::Generate_ResumeGeneratorTrampoline(MacroAssembler* masm) {
ExternalReference debug_hook =
ExternalReference::debug_hook_on_function_call_address(masm->isolate());
Operand debug_hook_operand = masm->ExternalOperand(debug_hook);
STATIC_ASSERT(StepFrame > StepIn);
__ cmpb(debug_hook_operand, Immediate(0));
__ j(not_equal, &prepare_step_in_if_stepping);
......
......@@ -561,9 +561,6 @@ void Debug::Break(JavaScriptFrame* frame) {
summary.SourceStatementPosition();
break;
}
case StepFrame:
step_break = current_fp != last_fp;
break;
}
// Clear all current stepping setup.
......@@ -1082,12 +1079,6 @@ void Debug::PrepareStep(StepAction step_action) {
// TODO(clemensh): Implement stepping from JS into WASM.
FloodWithOneShot(function);
break;
case StepFrame:
// TODO(clemensh): Implement stepping from JS into WASM or vice versa.
// No point in setting one-shot breaks at places where we are not about
// to leave the current frame.
FloodWithOneShot(function, CALLS_AND_RETURNS);
break;
}
}
......@@ -2153,9 +2144,8 @@ void Debug::UpdateState() {
}
void Debug::UpdateHookOnFunctionCall() {
STATIC_ASSERT(StepFrame > StepIn);
STATIC_ASSERT(LastStepAction == StepFrame);
hook_on_function_call_ = thread_local_.last_step_action_ >= StepIn ||
STATIC_ASSERT(LastStepAction == StepIn);
hook_on_function_call_ = thread_local_.last_step_action_ == StepIn ||
isolate_->needs_side_effect_check();
}
......
......@@ -40,9 +40,7 @@ enum StepAction : int8_t {
StepNext = 1, // Step to the next statement in the current function.
StepIn = 2, // Step into new functions invoked or the next statement
// in the current function.
StepFrame = 3, // Step into a new frame or return to previous frame.
LastStepAction = StepFrame
LastStepAction = StepIn
};
// Type of exception break. NOTE: These values are in macros.py as well.
......
......@@ -51,8 +51,7 @@ Debug.ExceptionBreak = { Caught : 0,
// The different types of steps.
Debug.StepAction = { StepOut: 0,
StepNext: 1,
StepIn: 2,
StepFrame: 3 };
StepIn: 2 };
// The different types of scripts matching enum ScriptType in objects.h.
Debug.ScriptType = { Native: 0,
......@@ -828,8 +827,7 @@ function ExecutionState(break_id) {
ExecutionState.prototype.prepareStep = function(action) {
if (action === Debug.StepAction.StepIn ||
action === Debug.StepAction.StepOut ||
action === Debug.StepAction.StepNext ||
action === Debug.StepAction.StepFrame) {
action === Debug.StepAction.StepNext) {
return %PrepareStep(this.break_id, action);
}
throw %make_type_error(kDebuggerType);
......
......@@ -86,18 +86,6 @@ const BreakPositionAlignment = {
};
Debug.BreakPositionAlignment = BreakPositionAlignment;
/** @enum */
Debug.StepAction = { StepOut: 0,
StepNext: 1,
StepIn: 2,
StepFrame: 3 };
/** @enum */
const ScriptCompilationType = { Host: 0,
Eval: 1,
JSON: 2 };
Debug.ScriptCompilationType = ScriptCompilationType;
/** @interface */
function DebuggerFlag() {}
......
......@@ -3252,8 +3252,7 @@ void Interpreter::DoSuspendGenerator(InterpreterAssembler* assembler) {
ExternalReference::debug_last_step_action_address(isolate_));
Node* step_action = __ Load(MachineType::Int8(), step_action_address);
STATIC_ASSERT(StepIn > StepNext);
STATIC_ASSERT(StepFrame > StepNext);
STATIC_ASSERT(LastStepAction == StepFrame);
STATIC_ASSERT(LastStepAction == StepIn);
Node* step_next = __ Int32Constant(StepNext);
__ Branch(__ Int32LessThanOrEqual(step_next, step_action), &if_stepping, &ok);
__ Bind(&ok);
......
......@@ -1182,7 +1182,7 @@ RUNTIME_FUNCTION(Runtime_PrepareStep) {
// Get the step action and check validity.
StepAction step_action = static_cast<StepAction>(NumberToInt32(args[1]));
if (step_action != StepIn && step_action != StepNext &&
step_action != StepOut && step_action != StepFrame) {
step_action != StepOut) {
return isolate->Throw(isolate->heap()->illegal_argument_string());
}
......@@ -1194,19 +1194,6 @@ RUNTIME_FUNCTION(Runtime_PrepareStep) {
return isolate->heap()->undefined_value();
}
RUNTIME_FUNCTION(Runtime_PrepareStepFrame) {
HandleScope scope(isolate);
DCHECK_EQ(0, args.length());
CHECK(isolate->debug()->CheckExecutionState());
// Clear all current stepping setup.
isolate->debug()->ClearStepping();
// Prepare step.
isolate->debug()->PrepareStep(StepFrame);
return isolate->heap()->undefined_value();
}
// Clear all stepping set by PrepareStep.
RUNTIME_FUNCTION(Runtime_ClearStepping) {
HandleScope scope(isolate);
......
......@@ -171,7 +171,6 @@ namespace internal {
F(ChangeBreakOnException, 2, 1) \
F(IsBreakOnException, 1, 1) \
F(PrepareStep, 2, 1) \
F(PrepareStepFrame, 0, 1) \
F(ClearStepping, 0, 1) \
F(DebugEvaluate, 4, 1) \
F(DebugEvaluateGlobal, 2, 1) \
......
......@@ -174,10 +174,6 @@ class InterpreterHandle {
: WasmInterpreter::BreakFlag::AfterCall);
return thread->Run();
}
case StepFrame:
thread->AddBreakFlags(WasmInterpreter::BreakFlag::AfterCall |
WasmInterpreter::BreakFlag::AfterReturn);
return thread->Run();
default:
UNREACHABLE();
return WasmInterpreter::STOPPED;
......@@ -233,9 +229,6 @@ class InterpreterHandle {
hit_step = thread->GetFrameCount() == last_step_stack_depth_;
break;
}
case StepFrame:
hit_step = thread->GetFrameCount() != last_step_stack_depth_;
break;
default:
UNREACHABLE();
}
......
......@@ -59,8 +59,7 @@ class BreakHandler {
Continue = StepAction::LastStepAction + 1,
StepNext = StepAction::StepNext,
StepIn = StepAction::StepIn,
StepOut = StepAction::StepOut,
StepFrame = StepAction::StepFrame
StepOut = StepAction::StepOut
};
struct BreakPoint {
int position;
......@@ -111,7 +110,6 @@ class BreakHandler {
case StepNext:
case StepIn:
case StepOut:
case StepFrame:
isolate_->debug()->PrepareStep(static_cast<StepAction>(next_action));
break;
default:
......
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This test ensures that IC learning doesn't interfere with stepping into
// property accessor. f1()'s ICs are allowed to learn to a monomorphic state,
// and the breakpoints flooding get() are allowed to expire, then we ensure
// that we can step into get() again later (when k == 1).
function f1() {
for (var k = 0; k < 2; k++) { // Break 1
var v10 = 0; // Line 2
for (var i = 0; i < 10; i++) { // Line 3
var v12 = o.slappy; // Line 4
var v13 = 3 // Line 5
} // Line 6
print("break here"); // Break 3
} // Line 8
print("exiting f1"); // Line 9 (dummy break)
}
function get() {
var g0 = 0; // Break 2
var g1 = 1;
return 3;
}
var o = {};
Object.defineProperty(o, "slappy", { get : get });
Debug = debug.Debug;
var break_count = 0
var exception = null;
var bp_f1_line7;
var bp_f1_line9;
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
var line = exec_state.frame(0).sourceLineText();
print(line);
var match = line.match(/\/\/ Break (\d+)$/);
assertEquals(2, match.length);
var match_value = parseInt(match[1]);
if (break_count >= 0 && break_count < 2) {
// 0, 1: Keep stepping through frames.
assertEquals(break_count, match_value);
exec_state.prepareStep(Debug.StepAction.StepFrame);
} else if (break_count === 2) {
// 2: let the code run to a breakpoint we set. The load should
// go monomorphic.
assertEquals(break_count, match_value);
} else if (break_count === 3) {
// 3: back to frame stepping. Does the monomorphic slappy accessor
// call still have the ability to break like before?
assertEquals(break_count, match_value);
Debug.clearBreakPoint(bp_f1_line7);
exec_state.prepareStep(Debug.StepAction.StepFrame);
} else {
assertEquals(4, break_count);
assertEquals(2, match_value);
// Apparently we can still stop in the accessor even though we cleared
// breakpoints earlier and there was a monomorphic step.
// Allow running to completion now.
Debug.clearBreakPoint(bp_f1_line9);
}
break_count++;
} catch (e) {
print(e + e.stack);
exception = e;
}
}
for (var j = 1; j < 3; j++) {
break_count = 0;
Debug.setListener(listener);
// Breakpoints are added here rather than in the listener because their
// addition causes a full (clearing) gc that clears type feedback when we
// want to let it build up. Also, bp_f1_line9 is set simply because if we
// handled then deleted bp_f1_line7, then the debugger clears DebugInfo from
// f1 while we are still using it, again, resetting type feedback which is
// undesirable.
bp_f1_line7 = Debug.setBreakPoint(f1, 7);
bp_f1_line9 = Debug.setBreakPoint(f1, 9);
debugger; // Break 0
f1();
Debug.setListener(null);
assertTrue(break_count === 5);
}
assertNull(exception);
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function f0() {
var v00 = 0; // Break 1
var v01 = 1;
// Normal function call in a catch scope.
try {
throw 1;
} catch (e) {
try {
f1();
} catch (e) {
var v02 = 2; // Break 13
}
}
var v03 = 3;
var v04 = 4;
eval('var v05 = 5; // Break 14');
var v06 = 6; // Break 15
}
function f1() {
var v10 = 0; // Break 2
var v11 = 1;
// Getter call.
var v12 = o.get;
var v13 = 3 // Break 4
// Setter call.
o.set = 2;
var v14 = 4; // Break 6
// Function.prototype.call.
f2.call();
var v15 = 5; // Break 12
var v16 = 6;
// Exit function by throw.
throw 1;
var v17 = 7;
}
function get() {
var g0 = 0; // Break 3
var g1 = 1;
return 3;
}
function set() {
var s0 = 0; // Break 5
return 3;
}
function f2() {
var v20 = 0; // Break 7
// Construct call.
var v21 = new c0();
var v22 = 2; // Break 9
// Bound function.
b0();
return 2; // Break 11
}
function c0() {
this.v0 = 0; // Break 8
this.v1 = 1;
}
function f3() {
var v30 = 0; // Break 10
var v31 = 1;
return 3;
}
var b0 = f3.bind(o);
var o = {};
Object.defineProperty(o, "get", { get : get });
Object.defineProperty(o, "set", { set : set });
Debug = debug.Debug;
var break_count = 0
var exception = null;
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
try {
var line = exec_state.frame(0).sourceLineText();
print(line);
var match = line.match(/\/\/ Break (\d+)$/);
assertEquals(2, match.length);
assertEquals(break_count, parseInt(match[1]));
break_count ++;
exec_state.prepareStep(Debug.StepAction.StepFrame);
} catch (e) {
print(e + e.stack);
exception = e;
}
}
break_count = 0;
Debug.setListener(listener);
debugger; // Break 0
f0();
Debug.setListener(null); // Break 16
assertTrue(break_count > 14);
assertNull(exception);
......@@ -38,7 +38,6 @@ class DebugWrapper {
this.StepAction = { StepOut: 0,
StepNext: 1,
StepIn: 2,
StepFrame: 3,
};
// The different types of scripts matching enum ScriptType in objects.h.
......@@ -418,7 +417,6 @@ class DebugWrapper {
case this.StepAction.StepOut: this.stepOut(); break;
case this.StepAction.StepNext: this.stepOver(); break;
case this.StepAction.StepIn: this.stepInto(); break;
case this.StepAction.StepFrame: %PrepareStepFrame(); break;
default: %AbortJS("Unsupported StepAction"); break;
}
}
......
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