Commit 6292fdb8 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Debug] Special case DebugBreakOnBytecode for cases where we restart the frame.

When restarting a frame on returning from a debug break, we are going
to drop the current function frame, therefore the return value and
next bytecode are not going to be used. Special case these situations
since with bytecode flushing it is possible the SFI for the
executing function might have been flushed (if edited by liveedit)
which causes failures when trying to read from the bytecode array.

BUG=v8:8395

Change-Id: I18adaa5d91c244e6d13e8703ed41c300f793681d
Reviewed-on: https://chromium-review.googlesource.com/c/1352270
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57875}
parent 8e80210f
......@@ -368,6 +368,9 @@ class Debug {
Address restart_fp_address() {
return reinterpret_cast<Address>(&thread_local_.restart_fp_);
}
bool will_restart() const {
return thread_local_.restart_fp_ != kNullAddress;
}
StepAction last_step_action() { return thread_local_.last_step_action_; }
bool break_on_next_function_call() const {
......
......@@ -41,6 +41,7 @@ RUNTIME_FUNCTION_RETURN_PAIR(Runtime_DebugBreakOnBytecode) {
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(Object, value, 0);
HandleScope scope(isolate);
// Return value can be changed by debugger. Last set value will be used as
// return value.
ReturnValueScope result_scope(isolate->debug());
......@@ -53,6 +54,13 @@ RUNTIME_FUNCTION_RETURN_PAIR(Runtime_DebugBreakOnBytecode) {
handle(it.frame()->function(), isolate));
}
// If we are dropping frames, there is no need to get a return value or
// bytecode, since we will be restarting execution at a different frame.
if (isolate->debug()->will_restart()) {
return MakePair(ReadOnlyRoots(isolate).undefined_value(),
Smi::FromInt(static_cast<uint8_t>(Bytecode::kIllegal)));
}
// Return the handler from the original bytecode array.
DCHECK(it.frame()->is_interpreted());
InterpretedFrame* interpreted_frame =
......
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