Commit 97bad6be authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

Make {StackFrame::unchecked_code} fail gracefully.

This makes sure that all overrides of {StackFrame::unchecked_code}
return a value, even if there is no {Code} object associated with the
frame. This ensures debug functions like {StackTraceFailureMessage}
continue working for all stack traces.

R=neis@chromium.org
BUG=chromium:952761

Change-Id: Ie42b301e4d43ebf67acc80e6c1b7bcb4cdc7c947
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1566515Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60844}
parent c7b43ae5
...@@ -620,7 +620,7 @@ Code ConstructEntryFrame::unchecked_code() const { ...@@ -620,7 +620,7 @@ Code ConstructEntryFrame::unchecked_code() const {
return isolate()->heap()->builtin(Builtins::kJSConstructEntry); return isolate()->heap()->builtin(Builtins::kJSConstructEntry);
} }
Code ExitFrame::unchecked_code() const { UNREACHABLE(); } Code ExitFrame::unchecked_code() const { return Code(); }
void ExitFrame::ComputeCallerState(State* state) const { void ExitFrame::ComputeCallerState(State* state) const {
// Set up the caller state. // Set up the caller state.
...@@ -1793,7 +1793,7 @@ Address InternalFrame::GetCallerStackPointer() const { ...@@ -1793,7 +1793,7 @@ Address InternalFrame::GetCallerStackPointer() const {
return fp() + StandardFrameConstants::kCallerSPOffset; return fp() + StandardFrameConstants::kCallerSPOffset;
} }
Code InternalFrame::unchecked_code() const { UNREACHABLE(); } Code InternalFrame::unchecked_code() const { return Code(); }
void WasmCompiledFrame::Print(StringStream* accumulator, PrintMode mode, void WasmCompiledFrame::Print(StringStream* accumulator, PrintMode mode,
int index) const { int index) const {
...@@ -1928,7 +1928,7 @@ void WasmInterpreterEntryFrame::Summarize( ...@@ -1928,7 +1928,7 @@ void WasmInterpreterEntryFrame::Summarize(
} }
} }
Code WasmInterpreterEntryFrame::unchecked_code() const { UNREACHABLE(); } Code WasmInterpreterEntryFrame::unchecked_code() const { return Code(); }
WasmInstanceObject WasmInterpreterEntryFrame::wasm_instance() const { WasmInstanceObject WasmInterpreterEntryFrame::wasm_instance() const {
const int offset = WasmCompiledFrameConstants::kWasmInstanceOffset; const int offset = WasmCompiledFrameConstants::kWasmInstanceOffset;
......
...@@ -530,7 +530,6 @@ StackTraceFailureMessage::StackTraceFailureMessage(Isolate* isolate, void* ptr1, ...@@ -530,7 +530,6 @@ StackTraceFailureMessage::StackTraceFailureMessage(Isolate* isolate, void* ptr1,
size_t i = 0; size_t i = 0;
StackFrameIterator it(isolate); StackFrameIterator it(isolate);
for (; !it.done() && i < code_objects_length; it.Advance()) { for (; !it.done() && i < code_objects_length; it.Advance()) {
if (it.frame()->type() == StackFrame::INTERNAL) continue;
code_objects_[i++] = code_objects_[i++] =
reinterpret_cast<void*>(it.frame()->unchecked_code().ptr()); reinterpret_cast<void*>(it.frame()->unchecked_code().ptr());
} }
......
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