| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 if (Debug::IsDebugGlobal(global)) { | 631 if (Debug::IsDebugGlobal(global)) { |
| 632 return Heap::undefined_value(); | 632 return Heap::undefined_value(); |
| 633 } | 633 } |
| 634 } | 634 } |
| 635 } | 635 } |
| 636 | 636 |
| 637 // Collect the break state before clearing the flags. | 637 // Collect the break state before clearing the flags. |
| 638 bool debug_command_only = | 638 bool debug_command_only = |
| 639 StackGuard::IsDebugCommand() && !StackGuard::IsDebugBreak(); | 639 StackGuard::IsDebugCommand() && !StackGuard::IsDebugBreak(); |
| 640 | 640 |
| 641 // Clear the debug request flags. | 641 // Clear the debug break request flag. |
| 642 StackGuard::Continue(DEBUGBREAK); | 642 StackGuard::Continue(DEBUGBREAK); |
| 643 |
| 644 ProcessDebugMesssages(debug_command_only); |
| 645 |
| 646 // Return to continue execution. |
| 647 return Heap::undefined_value(); |
| 648 } |
| 649 |
| 650 void Execution::ProcessDebugMesssages(bool debug_command_only) { |
| 651 // Clear the debug command request flag. |
| 643 StackGuard::Continue(DEBUGCOMMAND); | 652 StackGuard::Continue(DEBUGCOMMAND); |
| 644 | 653 |
| 645 HandleScope scope; | 654 HandleScope scope; |
| 646 // Enter the debugger. Just continue if we fail to enter the debugger. | 655 // Enter the debugger. Just continue if we fail to enter the debugger. |
| 647 EnterDebugger debugger; | 656 EnterDebugger debugger; |
| 648 if (debugger.FailedToEnter()) { | 657 if (debugger.FailedToEnter()) { |
| 649 return Heap::undefined_value(); | 658 return; |
| 650 } | 659 } |
| 651 | 660 |
| 652 // Notify the debug event listeners. Indicate auto continue if the break was | 661 // Notify the debug event listeners. Indicate auto continue if the break was |
| 653 // a debug command break. | 662 // a debug command break. |
| 654 Debugger::OnDebugBreak(Factory::undefined_value(), debug_command_only); | 663 Debugger::OnDebugBreak(Factory::undefined_value(), debug_command_only); |
| 664 } |
| 655 | 665 |
| 656 // Return to continue execution. | 666 |
| 657 return Heap::undefined_value(); | |
| 658 } | |
| 659 #endif | 667 #endif |
| 660 | 668 |
| 661 Object* Execution::HandleStackGuardInterrupt() { | 669 Object* Execution::HandleStackGuardInterrupt() { |
| 662 #ifdef ENABLE_DEBUGGER_SUPPORT | 670 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 663 if (StackGuard::IsDebugBreak() || StackGuard::IsDebugCommand()) { | 671 if (StackGuard::IsDebugBreak() || StackGuard::IsDebugCommand()) { |
| 664 DebugBreakHelper(); | 672 DebugBreakHelper(); |
| 665 } | 673 } |
| 666 #endif | 674 #endif |
| 667 if (StackGuard::IsPreempted()) RuntimePreempt(); | 675 if (StackGuard::IsPreempted()) RuntimePreempt(); |
| 668 if (StackGuard::IsTerminateExecution()) { | 676 if (StackGuard::IsTerminateExecution()) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 692 // All allocation spaces other than NEW_SPACE have the same effect. | 700 // All allocation spaces other than NEW_SPACE have the same effect. |
| 693 Heap::CollectAllGarbage(false); | 701 Heap::CollectAllGarbage(false); |
| 694 return v8::Undefined(); | 702 return v8::Undefined(); |
| 695 } | 703 } |
| 696 | 704 |
| 697 | 705 |
| 698 static GCExtension kGCExtension; | 706 static GCExtension kGCExtension; |
| 699 v8::DeclareExtension kGCExtensionDeclaration(&kGCExtension); | 707 v8::DeclareExtension kGCExtensionDeclaration(&kGCExtension); |
| 700 | 708 |
| 701 } } // namespace v8::internal | 709 } } // namespace v8::internal |
| OLD | NEW |