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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 try { | 788 try { |
789 return "<error: " + e + ">"; | 789 return "<error: " + e + ">"; |
790 } catch (ee) { | 790 } catch (ee) { |
791 return "<error>"; | 791 return "<error>"; |
792 } | 792 } |
793 } | 793 } |
794 } | 794 } |
795 | 795 |
796 | 796 |
797 function GetStackFrames(raw_stack) { | 797 function GetStackFrames(raw_stack) { |
| 798 var internal_raw_stack = new InternalArray(); |
| 799 %MoveArrayContents(raw_stack, internal_raw_stack); |
798 var frames = new InternalArray(); | 800 var frames = new InternalArray(); |
799 var sloppy_frames = raw_stack[0]; | 801 var sloppy_frames = internal_raw_stack[0]; |
800 for (var i = 1; i < raw_stack.length; i += 4) { | 802 for (var i = 1; i < internal_raw_stack.length; i += 4) { |
801 var recv = raw_stack[i]; | 803 var recv = internal_raw_stack[i]; |
802 var fun = raw_stack[i + 1]; | 804 var fun = internal_raw_stack[i + 1]; |
803 var code = raw_stack[i + 2]; | 805 var code = internal_raw_stack[i + 2]; |
804 var pc = raw_stack[i + 3]; | 806 var pc = internal_raw_stack[i + 3]; |
805 var pos = %_IsSmi(code) ? code : %FunctionGetPositionForOffset(code, pc); | 807 var pos = %_IsSmi(code) ? code : %FunctionGetPositionForOffset(code, pc); |
806 sloppy_frames--; | 808 sloppy_frames--; |
807 frames.push(new CallSite(recv, fun, pos, (sloppy_frames < 0))); | 809 frames.push(new CallSite(recv, fun, pos, (sloppy_frames < 0))); |
808 } | 810 } |
809 return frames; | 811 return frames; |
810 } | 812 } |
811 | 813 |
812 | 814 |
813 // Flag to prevent recursive call of Error.prepareStackTrace. | 815 // Flag to prevent recursive call of Error.prepareStackTrace. |
814 var formatting_custom_stack_trace = false; | 816 var formatting_custom_stack_trace = false; |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 utils.Export(function(to) { | 1020 utils.Export(function(to) { |
1019 to.ErrorToString = ErrorToString; | 1021 to.ErrorToString = ErrorToString; |
1020 to.MakeError = MakeError; | 1022 to.MakeError = MakeError; |
1021 to.MakeRangeError = MakeRangeError; | 1023 to.MakeRangeError = MakeRangeError; |
1022 to.MakeSyntaxError = MakeSyntaxError; | 1024 to.MakeSyntaxError = MakeSyntaxError; |
1023 to.MakeTypeError = MakeTypeError; | 1025 to.MakeTypeError = MakeTypeError; |
1024 to.MakeURIError = MakeURIError; | 1026 to.MakeURIError = MakeURIError; |
1025 }); | 1027 }); |
1026 | 1028 |
1027 }); | 1029 }); |
OLD | NEW |