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

Unified Diff: src/isolate.cc

Issue 2548323002: [wasm] Implement location from stack trace for asm.js frames (Closed)
Patch Set: Add comment 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/isolate.h ('k') | test/mjsunit/regress/regress-670808.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 42a5a55b9d622a39ecf8cea37bcf555a7329b47f..84e1601f63c0448e2c93787da58f0b8533ba8279 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -47,6 +47,7 @@
#include "src/version.h"
#include "src/vm-state-inl.h"
#include "src/wasm/wasm-module.h"
+#include "src/wasm/wasm-objects.h"
#include "src/zone/accounting-allocator.h"
namespace v8 {
@@ -1546,8 +1547,23 @@ bool Isolate::ComputeLocationFromStackTrace(MessageLocation* target,
const int frame_count = elements->FrameCount();
for (int i = 0; i < frame_count; i++) {
if (elements->IsWasmFrame(i)) {
- // TODO(clemensh): handle wasm frames
- return false;
+ // TODO(clemensh): Handle wasm frames if they ever need handling here.
+ continue;
+ }
+
+ if (elements->IsAsmJsWasmFrame(i)) {
+ Handle<WasmCompiledModule> compiled_module(
+ WasmInstanceObject::cast(elements->WasmInstance(i))
+ ->get_compiled_module());
+ int func_index = elements->WasmFunctionIndex(i)->value();
+ int code_offset = elements->Offset(i)->value();
+ int byte_pos = elements->Code(i)->SourcePosition(code_offset);
+ int source_pos = WasmCompiledModule::GetAsmJsSourcePosition(
+ compiled_module, func_index, byte_pos);
+ Handle<Script> script = compiled_module->script();
+
+ *target = MessageLocation(script, source_pos, source_pos + 1);
+ return true;
}
Handle<JSFunction> fun = handle(elements->Function(i), this);
« no previous file with comments | « src/isolate.h ('k') | test/mjsunit/regress/regress-670808.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698