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

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: 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') | src/runtime/runtime-internal.cc » ('J')
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 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 829
830 830
831 function GetStackFrames(raw_stack) { 831 function GetStackFrames(raw_stack) {
832 var frames = new InternalArray(); 832 var frames = new InternalArray();
833 var sloppy_frames = raw_stack[0]; 833 var sloppy_frames = raw_stack[0];
834 for (var i = 1; i < raw_stack.length; i += 4) { 834 for (var i = 1; i < raw_stack.length; i += 4) {
835 var recv = raw_stack[i]; 835 var recv = raw_stack[i];
836 var fun = raw_stack[i + 1]; 836 var fun = raw_stack[i + 1];
837 var code = raw_stack[i + 2]; 837 var code = raw_stack[i + 2];
838 var pc = raw_stack[i + 3]; 838 var pc = raw_stack[i + 3];
839 var pos = %FunctionGetPositionForOffset(code, pc); 839 // For traps in wasm, the bytecode offset is passed as (-1 - offset).
840 // Otherwise, lookup the position from the pc.
841 var pos = IS_NUMBER(fun) && pc < 0 ? (-1 - pc) :
842 %FunctionGetPositionForOffset(code, pc);
840 sloppy_frames--; 843 sloppy_frames--;
841 frames.push(new CallSite(recv, fun, pos, (sloppy_frames < 0))); 844 frames.push(new CallSite(recv, fun, pos, (sloppy_frames < 0)));
842 } 845 }
843 return frames; 846 return frames;
844 } 847 }
845 848
846 849
847 // Flag to prevent recursive call of Error.prepareStackTrace. 850 // Flag to prevent recursive call of Error.prepareStackTrace.
848 var formatting_custom_stack_trace = false; 851 var formatting_custom_stack_trace = false;
849 852
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 utils.Export(function(to) { 1055 utils.Export(function(to) {
1053 to.ErrorToString = ErrorToString; 1056 to.ErrorToString = ErrorToString;
1054 to.MakeError = MakeError; 1057 to.MakeError = MakeError;
1055 to.MakeRangeError = MakeRangeError; 1058 to.MakeRangeError = MakeRangeError;
1056 to.MakeSyntaxError = MakeSyntaxError; 1059 to.MakeSyntaxError = MakeSyntaxError;
1057 to.MakeTypeError = MakeTypeError; 1060 to.MakeTypeError = MakeTypeError;
1058 to.MakeURIError = MakeURIError; 1061 to.MakeURIError = MakeURIError;
1059 }); 1062 });
1060 1063
1061 }); 1064 });
OLDNEW
« 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