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

Unified Diff: src/wasm/wasm-objects.cc

Issue 2509323002: [wasm] Implement frame printing for debug (Closed)
Patch Set: What's wrong about constexpr?? Created 4 years, 1 month 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/frames.cc ('K') | « src/wasm/wasm-objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-objects.cc
diff --git a/src/wasm/wasm-objects.cc b/src/wasm/wasm-objects.cc
index 19d48aa04b3b2eec7cfc9df9e10c30f4f0b08ffe..9a6f1b01da7ea68191dd16c0eba08e3145032080 100644
--- a/src/wasm/wasm-objects.cc
+++ b/src/wasm/wasm-objects.cc
@@ -312,7 +312,7 @@ Handle<WasmCompiledModule> WasmCompiledModule::New(
}
wasm::WasmModule* WasmCompiledModule::module() const {
- return reinterpret_cast<WasmModuleWrapper*>(*module_wrapper())->get();
+ return reinterpret_cast<WasmModuleWrapper*>(ptr_to_module_wrapper())->get();
}
void WasmCompiledModule::InitId() {
@@ -365,3 +365,15 @@ uint32_t WasmCompiledModule::mem_size() const {
uint32_t WasmCompiledModule::default_mem_size() const {
return min_mem_pages() * WasmModule::kPageSize;
}
+
+Vector<const uint8_t> WasmCompiledModule::GetRawFunctionName(
+ uint32_t func_index) {
+ DCHECK_GT(module()->functions.size(), func_index);
+ WasmFunction& function = module()->functions[func_index];
+ SeqOneByteString* bytes = ptr_to_module_bytes();
+ DCHECK_GE(static_cast<size_t>(bytes->length()), function.name_offset);
+ DCHECK_GE(static_cast<size_t>(bytes->length() - function.name_offset),
+ function.name_length);
+ return Vector<const uint8_t>(bytes->GetCharsAddress() + function.name_offset,
+ function.name_length);
+}
« src/frames.cc ('K') | « src/wasm/wasm-objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698