| OLD | NEW |
| 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 try { | 523 try { |
| 524 return "<error: " + e + ">"; | 524 return "<error: " + e + ">"; |
| 525 } catch (ee) { | 525 } catch (ee) { |
| 526 return "<error>"; | 526 return "<error>"; |
| 527 } | 527 } |
| 528 } | 528 } |
| 529 } | 529 } |
| 530 | 530 |
| 531 | 531 |
| 532 function GetStackFrames(raw_stack) { | 532 function GetStackFrames(raw_stack) { |
| 533 var internal_raw_stack = new InternalArray(); |
| 534 %MoveArrayContents(raw_stack, internal_raw_stack); |
| 533 var frames = new InternalArray(); | 535 var frames = new InternalArray(); |
| 534 var sloppy_frames = raw_stack[0]; | 536 var sloppy_frames = internal_raw_stack[0]; |
| 535 for (var i = 1; i < raw_stack.length; i += 4) { | 537 for (var i = 1; i < internal_raw_stack.length; i += 4) { |
| 536 var recv = raw_stack[i]; | 538 var recv = internal_raw_stack[i]; |
| 537 var fun = raw_stack[i + 1]; | 539 var fun = internal_raw_stack[i + 1]; |
| 538 var code = raw_stack[i + 2]; | 540 var code = internal_raw_stack[i + 2]; |
| 539 var pc = raw_stack[i + 3]; | 541 var pc = internal_raw_stack[i + 3]; |
| 540 // For traps in wasm, the bytecode offset is passed as (-1 - offset). | 542 // For traps in wasm, the bytecode offset is passed as (-1 - offset). |
| 541 // Otherwise, lookup the position from the pc. | 543 // Otherwise, lookup the position from the pc. |
| 542 var pos = IS_NUMBER(fun) && pc < 0 ? (-1 - pc) : | 544 var pos = IS_NUMBER(fun) && pc < 0 ? (-1 - pc) : |
| 543 %FunctionGetPositionForOffset(code, pc); | 545 %FunctionGetPositionForOffset(code, pc); |
| 544 sloppy_frames--; | 546 sloppy_frames--; |
| 545 frames.push(new CallSite(recv, fun, pos, (sloppy_frames < 0))); | 547 frames.push(new CallSite(recv, fun, pos, (sloppy_frames < 0))); |
| 546 } | 548 } |
| 547 return frames; | 549 return frames; |
| 548 } | 550 } |
| 549 | 551 |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 utils.Export(function(to) { | 758 utils.Export(function(to) { |
| 757 to.ErrorToString = ErrorToString; | 759 to.ErrorToString = ErrorToString; |
| 758 to.MakeError = MakeError; | 760 to.MakeError = MakeError; |
| 759 to.MakeRangeError = MakeRangeError; | 761 to.MakeRangeError = MakeRangeError; |
| 760 to.MakeSyntaxError = MakeSyntaxError; | 762 to.MakeSyntaxError = MakeSyntaxError; |
| 761 to.MakeTypeError = MakeTypeError; | 763 to.MakeTypeError = MakeTypeError; |
| 762 to.MakeURIError = MakeURIError; | 764 to.MakeURIError = MakeURIError; |
| 763 }); | 765 }); |
| 764 | 766 |
| 765 }); | 767 }); |
| OLD | NEW |