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

Unified Diff: src/frames.cc

Issue 2069823003: [wasm] Enable wasm frame inspection for debugging (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@split-wasm-debug
Patch Set: fix gcmole reports Created 4 years, 6 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
« src/debug/mirrors.js ('K') | « src/frames.h ('k') | src/frames-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index ba9ec7913a519d7317c2500a83cc4d31c677318a..4c9c3a487f9be7fd410aba24b72f2a01c299ad5c 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -16,6 +16,7 @@
#include "src/safepoint-table.h"
#include "src/string-stream.h"
#include "src/vm-state-inl.h"
+#include "src/wasm/wasm-module.h"
namespace v8 {
namespace internal {
@@ -63,19 +64,14 @@ StackFrameIteratorBase::StackFrameIteratorBase(Isolate* isolate,
}
#undef INITIALIZE_SINGLETON
-
StackFrameIterator::StackFrameIterator(Isolate* isolate)
- : StackFrameIteratorBase(isolate, true) {
- Reset(isolate->thread_local_top());
-}
-
+ : StackFrameIterator(isolate, isolate->thread_local_top()) {}
StackFrameIterator::StackFrameIterator(Isolate* isolate, ThreadLocalTop* t)
: StackFrameIteratorBase(isolate, true) {
Reset(t);
}
-
void StackFrameIterator::Advance() {
DCHECK(!done());
// Compute the state of the calling frame before restoring
@@ -165,6 +161,11 @@ StackTraceFrameIterator::StackTraceFrameIterator(Isolate* isolate)
if (!done() && !IsValidFrame(iterator_.frame())) Advance();
}
+StackTraceFrameIterator::StackTraceFrameIterator(Isolate* isolate,
+ StackFrame::Id id)
+ : StackTraceFrameIterator(isolate) {
+ while (!done() && frame()->id() != id) Advance();
+}
void StackTraceFrameIterator::Advance() {
do {
@@ -185,6 +186,11 @@ bool StackTraceFrameIterator::IsValidFrame(StackFrame* frame) const {
return frame->is_wasm();
}
+void StackTraceFrameIterator::AdvanceToArgumentsFrame() {
+ if (!is_javascript() || !javascript_frame()->has_adapted_arguments()) return;
+ iterator_.Advance();
+ DCHECK(iterator_.frame()->is_arguments_adaptor());
+}
// -------------------------------------------------------------------------
@@ -1339,23 +1345,16 @@ Address WasmFrame::GetCallerStackPointer() const {
return fp() + ExitFrameConstants::kCallerSPOffset;
}
-Object* WasmFrame::wasm_obj() {
+Object* WasmFrame::wasm_obj() const {
FixedArray* deopt_data = LookupCode()->deoptimization_data();
DCHECK(deopt_data->length() == 2);
return deopt_data->get(0);
}
-uint32_t WasmFrame::function_index() {
+uint32_t WasmFrame::function_index() const {
FixedArray* deopt_data = LookupCode()->deoptimization_data();
DCHECK(deopt_data->length() == 2);
- Object* func_index_obj = deopt_data->get(1);
- if (func_index_obj->IsUndefined(isolate())) return static_cast<uint32_t>(-1);
- if (func_index_obj->IsSmi()) return Smi::cast(func_index_obj)->value();
- DCHECK(func_index_obj->IsHeapNumber());
- uint32_t val = static_cast<uint32_t>(-1);
- func_index_obj->ToUint32(&val);
- DCHECK(val != static_cast<uint32_t>(-1));
- return val;
+ return Smi::cast(deopt_data->get(1))->value();
}
namespace {
« src/debug/mirrors.js ('K') | « src/frames.h ('k') | src/frames-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698