Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: src/debug/debug-frames.cc

Issue 2629823003: [wasm] Implement frame inspection for interpreted frames (Closed)
Patch Set: Rebase after Yangs revert ಠ益ಠ Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug/debug-frames.h ('k') | src/frames.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/debug/debug-frames.h ('k') | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698