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

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

Issue 2551053002: [wasm] Always provide a wasm instance object at runtime (Closed)
Patch Set: Rebase 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/messages.cc ('k') | src/vector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-debug.cc
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index ba520eb43b60c532d8d3e6d7e3cd9c272e38fbca..f587c8b0446bbff611c7a40e458e0c3f4d0b1d8b 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -526,11 +526,11 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
details->set(kFrameDetailsFrameIdIndex, *frame_id);
// Add the function name.
- Handle<Object> wasm_instance_or_undef(it.wasm_frame()->wasm_instance(),
- isolate);
+ Handle<WasmCompiledModule> compiled_module(
+ it.wasm_frame()->wasm_instance()->get_compiled_module(), isolate);
int func_index = it.wasm_frame()->function_index();
- Handle<String> func_name =
- wasm::GetWasmFunctionName(isolate, wasm_instance_or_undef, func_index);
+ Handle<String> func_name = WasmCompiledModule::GetFunctionName(
+ isolate, compiled_module, func_index);
details->set(kFrameDetailsFunctionIndex, *func_name);
// Add the script wrapper
@@ -549,14 +549,10 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
// position, such that together with the script it uniquely identifies the
// position.
Handle<Object> positionValue;
- if (position != kNoSourcePosition &&
- !wasm_instance_or_undef->IsUndefined(isolate)) {
+ if (position != kNoSourcePosition) {
int translated_position = position;
- if (!wasm::WasmIsAsmJs(*wasm_instance_or_undef, isolate)) {
- Handle<WasmCompiledModule> compiled_module(
- WasmInstanceObject::cast(*wasm_instance_or_undef)
- ->get_compiled_module(),
- isolate);
+ // No further translation needed for asm.js modules.
+ if (!compiled_module->is_asm_js()) {
translated_position +=
wasm::GetFunctionCodeOffset(compiled_module, func_index);
}
« no previous file with comments | « src/messages.cc ('k') | src/vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698