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

Side by Side 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: add TODO with tracking bug Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/runtime/runtime-internal.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // ------------------------------------------------------------------- 5 // -------------------------------------------------------------------
6 6
7 (function(global, utils) { 7 (function(global, utils) {
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 819
820 820
821 function GetStackFrames(raw_stack) { 821 function GetStackFrames(raw_stack) {
822 var frames = new InternalArray(); 822 var frames = new InternalArray();
823 var sloppy_frames = raw_stack[0]; 823 var sloppy_frames = raw_stack[0];
824 for (var i = 1; i < raw_stack.length; i += 4) { 824 for (var i = 1; i < raw_stack.length; i += 4) {
825 var recv = raw_stack[i]; 825 var recv = raw_stack[i];
826 var fun = raw_stack[i + 1]; 826 var fun = raw_stack[i + 1];
827 var code = raw_stack[i + 2]; 827 var code = raw_stack[i + 2];
828 var pc = raw_stack[i + 3]; 828 var pc = raw_stack[i + 3];
829 var pos = %FunctionGetPositionForOffset(code, pc); 829 // For traps in wasm, the bytecode offset is passed as (-1 - offset).
830 // Otherwise, lookup the position from the pc.
831 var pos = IS_NUMBER(fun) && pc < 0 ? (-1 - pc) :
832 %FunctionGetPositionForOffset(code, pc);
830 sloppy_frames--; 833 sloppy_frames--;
831 frames.push(new CallSite(recv, fun, pos, (sloppy_frames < 0))); 834 frames.push(new CallSite(recv, fun, pos, (sloppy_frames < 0)));
832 } 835 }
833 return frames; 836 return frames;
834 } 837 }
835 838
836 839
837 // Flag to prevent recursive call of Error.prepareStackTrace. 840 // Flag to prevent recursive call of Error.prepareStackTrace.
838 var formatting_custom_stack_trace = false; 841 var formatting_custom_stack_trace = false;
839 842
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 utils.Export(function(to) { 1045 utils.Export(function(to) {
1043 to.ErrorToString = ErrorToString; 1046 to.ErrorToString = ErrorToString;
1044 to.MakeError = MakeError; 1047 to.MakeError = MakeError;
1045 to.MakeRangeError = MakeRangeError; 1048 to.MakeRangeError = MakeRangeError;
1046 to.MakeSyntaxError = MakeSyntaxError; 1049 to.MakeSyntaxError = MakeSyntaxError;
1047 to.MakeTypeError = MakeTypeError; 1050 to.MakeTypeError = MakeTypeError;
1048 to.MakeURIError = MakeURIError; 1051 to.MakeURIError = MakeURIError;
1049 }); 1052 });
1050 1053
1051 }); 1054 });
OLDNEW
« no previous file with comments | « no previous file | src/runtime/runtime-internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698