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

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

Issue 2536373007: [wasm] Make DisassembleFunction a method of WasmCompiledModule (Closed)
Patch Set: Created 4 years 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/wasm/wasm-module.h ('k') | src/wasm/wasm-objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 21fc75775160b84f99fe49a8acdc5395312e903a..f0598556b4838f9606108e7f4298b6968da72d50 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -20,7 +20,6 @@
#include "src/wasm/wasm-module.h"
#include "src/wasm/wasm-objects.h"
#include "src/wasm/wasm-result.h"
-#include "src/wasm/wasm-text.h"
#include "src/compiler/wasm-compiler.h"
@@ -1999,31 +1998,6 @@ Handle<Script> wasm::GetScript(Handle<JSObject> instance) {
return compiled_module->script();
}
-// TODO(clemensh): Make this a non-static method of WasmCompiledModule.
-std::pair<std::string, std::vector<std::tuple<uint32_t, int, int>>>
-wasm::DisassembleFunction(Handle<WasmCompiledModule> compiled_module,
- int func_index) {
- DisallowHeapAllocation no_gc;
-
- if (func_index < 0 ||
- static_cast<uint32_t>(func_index) >=
- compiled_module->module()->functions.size())
- return {};
-
- SeqOneByteString* module_bytes_str = compiled_module->ptr_to_module_bytes();
- Vector<const byte> module_bytes(module_bytes_str->GetChars(),
- module_bytes_str->length());
-
- std::ostringstream disassembly_os;
- std::vector<std::tuple<uint32_t, int, int>> offset_table;
-
- PrintWasmText(compiled_module->module(), module_bytes,
- static_cast<uint32_t>(func_index), disassembly_os,
- &offset_table);
-
- return {disassembly_os.str(), std::move(offset_table)};
-}
-
Handle<WasmDebugInfo> wasm::GetDebugInfo(Handle<JSObject> object) {
auto instance = Handle<WasmInstanceObject>::cast(object);
if (instance->has_debug_info()) {
« no previous file with comments | « src/wasm/wasm-module.h ('k') | src/wasm/wasm-objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698