Commit d1e6dcd9 authored by Clemens Backes's avatar Clemens Backes Committed by Commit Bot

[frame] Remove redundant unchecked_code implementations

1) Wasm code is not associated with a Code object, hence
   WasmFrame::unchecked_code will always return a null object. Hence we
   can use the default implementation from TypedFrame and avoid the
   lookup on the heap which will always fail.
2) InternalFrame inherits from TypedFrame, hence can also reuse the
   unchecked_code implementation from TypedFrame.
3) Use "{}" instead of "Code()" to return "nothing".

R=jkummerow@chromium.org

Bug: v8:11074
Change-Id: I142d2f21c05bf87cafa5ba6e7f463510be6c70bb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2653229Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72410}
parent 81549898
...@@ -1778,8 +1778,6 @@ int BuiltinFrame::ComputeParametersCount() const { ...@@ -1778,8 +1778,6 @@ int BuiltinFrame::ComputeParametersCount() const {
return Smi::ToInt(Object(base::Memory<Address>(fp() + offset))); return Smi::ToInt(Object(base::Memory<Address>(fp() + offset)));
} }
Code InternalFrame::unchecked_code() const { return Code(); }
void WasmFrame::Print(StringStream* accumulator, PrintMode mode, void WasmFrame::Print(StringStream* accumulator, PrintMode mode,
int index) const { int index) const {
PrintIndex(accumulator, mode, index); PrintIndex(accumulator, mode, index);
...@@ -1808,10 +1806,6 @@ void WasmFrame::Print(StringStream* accumulator, PrintMode mode, ...@@ -1808,10 +1806,6 @@ void WasmFrame::Print(StringStream* accumulator, PrintMode mode,
if (mode != OVERVIEW) accumulator->Add("\n"); if (mode != OVERVIEW) accumulator->Add("\n");
} }
Code WasmFrame::unchecked_code() const {
return isolate()->FindCodeObject(pc());
}
wasm::WasmCode* WasmFrame::wasm_code() const { wasm::WasmCode* WasmFrame::wasm_code() const {
return isolate()->wasm_engine()->code_manager()->LookupCode(pc()); return isolate()->wasm_engine()->code_manager()->LookupCode(pc());
} }
......
...@@ -516,7 +516,7 @@ class CommonFrame : public StackFrame { ...@@ -516,7 +516,7 @@ class CommonFrame : public StackFrame {
class TypedFrame : public CommonFrame { class TypedFrame : public CommonFrame {
public: public:
Code unchecked_code() const override { return Code(); } Code unchecked_code() const override { return {}; }
void Iterate(RootVisitor* v) const override { IterateCompiledFrame(v); } void Iterate(RootVisitor* v) const override { IterateCompiledFrame(v); }
protected: protected:
...@@ -897,9 +897,6 @@ class WasmFrame : public TypedFrame { ...@@ -897,9 +897,6 @@ class WasmFrame : public TypedFrame {
// Lookup exception handler for current {pc}, returns -1 if none found. // Lookup exception handler for current {pc}, returns -1 if none found.
int LookupExceptionHandlerInTable(); int LookupExceptionHandlerInTable();
// Determine the code for the frame.
Code unchecked_code() const override;
// Accessors. // Accessors.
V8_EXPORT_PRIVATE WasmInstanceObject wasm_instance() const; V8_EXPORT_PRIVATE WasmInstanceObject wasm_instance() const;
V8_EXPORT_PRIVATE wasm::NativeModule* native_module() const; V8_EXPORT_PRIVATE wasm::NativeModule* native_module() const;
...@@ -1028,9 +1025,6 @@ class InternalFrame : public TypedFrame { ...@@ -1028,9 +1025,6 @@ class InternalFrame : public TypedFrame {
// Garbage collection support. // Garbage collection support.
void Iterate(RootVisitor* v) const override; void Iterate(RootVisitor* v) const override;
// Determine the code for the frame.
Code unchecked_code() const override;
static InternalFrame* cast(StackFrame* frame) { static InternalFrame* cast(StackFrame* frame) {
DCHECK(frame->is_internal()); DCHECK(frame->is_internal());
return static_cast<InternalFrame*>(frame); return static_cast<InternalFrame*>(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