| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 // Just continue if breaks are disabled. | 813 // Just continue if breaks are disabled. |
| 814 if (isolate->debug()->disable_break()) { | 814 if (isolate->debug()->disable_break()) { |
| 815 return isolate->heap()->undefined_value(); | 815 return isolate->heap()->undefined_value(); |
| 816 } | 816 } |
| 817 | 817 |
| 818 // Ignore debug break during bootstrapping. | 818 // Ignore debug break during bootstrapping. |
| 819 if (isolate->bootstrapper()->IsActive()) { | 819 if (isolate->bootstrapper()->IsActive()) { |
| 820 return isolate->heap()->undefined_value(); | 820 return isolate->heap()->undefined_value(); |
| 821 } | 821 } |
| 822 | 822 |
| 823 StackLimitCheck check(isolate); |
| 824 if (check.HasOverflowed()) { |
| 825 return isolate->heap()->undefined_value(); |
| 826 } |
| 827 |
| 823 { | 828 { |
| 824 JavaScriptFrameIterator it(isolate); | 829 JavaScriptFrameIterator it(isolate); |
| 825 ASSERT(!it.done()); | 830 ASSERT(!it.done()); |
| 826 Object* fun = it.frame()->function(); | 831 Object* fun = it.frame()->function(); |
| 827 if (fun && fun->IsJSFunction()) { | 832 if (fun && fun->IsJSFunction()) { |
| 828 // Don't stop in builtin functions. | 833 // Don't stop in builtin functions. |
| 829 if (JSFunction::cast(fun)->IsBuiltin()) { | 834 if (JSFunction::cast(fun)->IsBuiltin()) { |
| 830 return isolate->heap()->undefined_value(); | 835 return isolate->heap()->undefined_value(); |
| 831 } | 836 } |
| 832 GlobalObject* global = JSFunction::cast(fun)->context()->global(); | 837 GlobalObject* global = JSFunction::cast(fun)->context()->global(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 849 | 854 |
| 850 // Return to continue execution. | 855 // Return to continue execution. |
| 851 return isolate->heap()->undefined_value(); | 856 return isolate->heap()->undefined_value(); |
| 852 } | 857 } |
| 853 | 858 |
| 854 void Execution::ProcessDebugMessages(bool debug_command_only) { | 859 void Execution::ProcessDebugMessages(bool debug_command_only) { |
| 855 Isolate* isolate = Isolate::Current(); | 860 Isolate* isolate = Isolate::Current(); |
| 856 // Clear the debug command request flag. | 861 // Clear the debug command request flag. |
| 857 isolate->stack_guard()->Continue(DEBUGCOMMAND); | 862 isolate->stack_guard()->Continue(DEBUGCOMMAND); |
| 858 | 863 |
| 864 StackLimitCheck check(isolate); |
| 865 if (check.HasOverflowed()) { |
| 866 return; |
| 867 } |
| 868 |
| 859 HandleScope scope(isolate); | 869 HandleScope scope(isolate); |
| 860 // Enter the debugger. Just continue if we fail to enter the debugger. | 870 // Enter the debugger. Just continue if we fail to enter the debugger. |
| 861 EnterDebugger debugger; | 871 EnterDebugger debugger; |
| 862 if (debugger.FailedToEnter()) { | 872 if (debugger.FailedToEnter()) { |
| 863 return; | 873 return; |
| 864 } | 874 } |
| 865 | 875 |
| 866 // Notify the debug event listeners. Indicate auto continue if the break was | 876 // Notify the debug event listeners. Indicate auto continue if the break was |
| 867 // a debug command break. | 877 // a debug command break. |
| 868 isolate->debugger()->OnDebugBreak(isolate->factory()->undefined_value(), | 878 isolate->debugger()->OnDebugBreak(isolate->factory()->undefined_value(), |
| (...skipping 29 matching lines...) Expand all Loading... |
| 898 return isolate->TerminateExecution(); | 908 return isolate->TerminateExecution(); |
| 899 } | 909 } |
| 900 if (stack_guard->IsInterrupted()) { | 910 if (stack_guard->IsInterrupted()) { |
| 901 stack_guard->Continue(INTERRUPT); | 911 stack_guard->Continue(INTERRUPT); |
| 902 return isolate->StackOverflow(); | 912 return isolate->StackOverflow(); |
| 903 } | 913 } |
| 904 return isolate->heap()->undefined_value(); | 914 return isolate->heap()->undefined_value(); |
| 905 } | 915 } |
| 906 | 916 |
| 907 } } // namespace v8::internal | 917 } } // namespace v8::internal |
| OLD | NEW |