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

Unified Diff: src/js/messages.js

Issue 1924253002: [wasm] Patch trapping position into stack trace (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@pass-wasm-position-to-runtime
Patch Set: Created 4 years, 8 months 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/runtime/runtime-internal.cc » ('j') | src/runtime/runtime-internal.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/messages.js
diff --git a/src/js/messages.js b/src/js/messages.js
index d99b920815d622ec84f4738ab95f32b809fecc49..4d683e76a384c44b579471c521bba701256dffdb 100644
--- a/src/js/messages.js
+++ b/src/js/messages.js
@@ -836,7 +836,10 @@ function GetStackFrames(raw_stack) {
var fun = raw_stack[i + 1];
var code = raw_stack[i + 2];
var pc = raw_stack[i + 3];
- var pos = %FunctionGetPositionForOffset(code, pc);
+ // For traps in wasm, the bytecode offset is passed as (-1 - offset).
+ // Otherwise, lookup the position from the pc.
+ var pos = IS_NUMBER(fun) && pc < 0 ? (-1 - pc) :
+ %FunctionGetPositionForOffset(code, pc);
sloppy_frames--;
frames.push(new CallSite(recv, fun, pos, (sloppy_frames < 0)));
}
« no previous file with comments | « no previous file | src/runtime/runtime-internal.cc » ('j') | src/runtime/runtime-internal.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698