Index: src/debug/debug-frames.cc |
diff --git a/src/debug/debug-frames.cc b/src/debug/debug-frames.cc |
index 15d6ed5b4d161092f26f08e7a4d34e8710f5a420..d4899114c9c137fd036fae7cc1ccf02df37cf289 100644 |
--- a/src/debug/debug-frames.cc |
+++ b/src/debug/debug-frames.cc |
@@ -15,7 +15,6 @@ FrameInspector::FrameInspector(StandardFrame* frame, int inlined_frame_index, |
Isolate* isolate) |
: frame_(frame), |
frame_summary_(FrameSummary::Get(frame, inlined_frame_index)), |
- deoptimized_frame_(nullptr), |
isolate_(isolate) { |
JavaScriptFrame* js_frame = |
frame->is_java_script() ? javascript_frame() : nullptr; |
@@ -35,21 +34,28 @@ FrameInspector::FrameInspector(StandardFrame* frame, int inlined_frame_index, |
return; |
} |
- deoptimized_frame_ = Deoptimizer::DebuggerInspectableFrame( |
- js_frame, inlined_frame_index, isolate); |
+ deoptimized_frame_.reset(Deoptimizer::DebuggerInspectableFrame( |
+ js_frame, inlined_frame_index, isolate)); |
+ } else if (frame_->is_wasm_interpreter_entry()) { |
+ wasm_interpreted_frame_ = |
+ frame_summary_.AsWasm() |
+ .wasm_instance() |
+ ->debug_info() |
+ ->GetInterpretedFrame(frame_->fp(), inlined_frame_index); |
+ DCHECK(wasm_interpreted_frame_); |
} |
} |
FrameInspector::~FrameInspector() { |
- // Get rid of the calculated deoptimized frame if any. |
- if (deoptimized_frame_ != nullptr) { |
- delete deoptimized_frame_; |
- } |
+ // Destructor needs to be defined in the .cc file, because it instantiates |
+ // std::unique_ptr destructors but the types are not known in the header. |
} |
int FrameInspector::GetParametersCount() { |
- return is_optimized_ ? deoptimized_frame_->parameters_count() |
- : frame_->ComputeParametersCount(); |
+ if (is_optimized_) return deoptimized_frame_->parameters_count(); |
+ if (wasm_interpreted_frame_) |
+ return wasm_interpreted_frame_->GetParameterCount(); |
+ return frame_->ComputeParametersCount(); |
} |
Handle<Script> FrameInspector::GetScript() { |
@@ -61,8 +67,9 @@ Handle<JSFunction> FrameInspector::GetFunction() { |
} |
Handle<Object> FrameInspector::GetParameter(int index) { |
- return is_optimized_ ? deoptimized_frame_->GetParameter(index) |
- : handle(frame_->GetParameter(index), isolate_); |
+ if (is_optimized_) return deoptimized_frame_->GetParameter(index); |
+ // TODO(clemensh): Handle wasm_interpreted_frame_. |
+ return handle(frame_->GetParameter(index), isolate_); |
} |
Handle<Object> FrameInspector::GetExpression(int index) { |