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

Unified Diff: src/api.cc

Issue 2493773003: [inspector] Introduce translation of wasm frames (Closed)
Patch Set: More signed/unsigned 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
« no previous file with comments | « no previous file | src/debug/debug-interface.h » ('j') | src/debug/debug-interface.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index a414f00f297b6c61ade4339532ea03c6f9d66173..ff5acf05aa8c158b796cbc88fb8bd0c9a45e1966 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -9083,6 +9083,25 @@ void DebugInterface::GetLoadedScripts(
}
}
+std::pair<std::string, std::vector<std::tuple<uint32_t, int, int>>>
+DebugInterface::DisassembleWasmFunction(Isolate* v8_isolate,
+ Local<Object> v8_script,
+ int function_index) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
+ if (v8_script.IsEmpty()) return {};
+ i::Handle<i::Object> script_wrapper = Utils::OpenHandle(*v8_script);
+ if (!script_wrapper->IsJSValue()) return {};
+ i::Handle<i::Object> script_obj(
+ i::Handle<i::JSValue>::cast(script_wrapper)->value(), isolate);
+ if (!script_obj->IsScript()) return {};
+ i::Handle<i::Script> script = i::Handle<i::Script>::cast(script_obj);
+ if (script->type() != i::Script::TYPE_WASM) return {};
+ i::Handle<i::wasm::WasmCompiledModule> compiled_module(
+ i::wasm::WasmCompiledModule::cast(script->wasm_compiled_module()),
+ isolate);
+ return i::wasm::DisassembleFunction(compiled_module, function_index);
+}
+
Local<String> CpuProfileNode::GetFunctionName() const {
const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);
i::Isolate* isolate = node->isolate();
« no previous file with comments | « no previous file | src/debug/debug-interface.h » ('j') | src/debug/debug-interface.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698