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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 } | 580 } |
581 | 581 |
582 | 582 |
583 #ifdef ENABLE_DEBUGGER_SUPPORT | 583 #ifdef ENABLE_DEBUGGER_SUPPORT |
584 Object* Execution::DebugBreakHelper() { | 584 Object* Execution::DebugBreakHelper() { |
585 // Just continue if breaks are disabled. | 585 // Just continue if breaks are disabled. |
586 if (Debug::disable_break()) { | 586 if (Debug::disable_break()) { |
587 return Heap::undefined_value(); | 587 return Heap::undefined_value(); |
588 } | 588 } |
589 | 589 |
| 590 { |
| 591 JavaScriptFrameIterator it; |
| 592 ASSERT(!it.done()); |
| 593 Object* fun = it.frame()->function(); |
| 594 if (fun && fun->IsJSFunction()) { |
| 595 GlobalObject* global = JSFunction::cast(fun)->context()->global(); |
| 596 // Don't stop in builtin functions. |
| 597 if (global == Top::context()->builtins()) { |
| 598 return Heap::undefined_value(); |
| 599 } |
| 600 // Don't stop in debugger functions. |
| 601 if (Debug::IsDebugGlobal(global)) { |
| 602 return Heap::undefined_value(); |
| 603 } |
| 604 } |
| 605 } |
| 606 |
590 // Collect the break state before clearing the flags. | 607 // Collect the break state before clearing the flags. |
591 bool debug_command_only = | 608 bool debug_command_only = |
592 StackGuard::IsDebugCommand() && !StackGuard::IsDebugBreak(); | 609 StackGuard::IsDebugCommand() && !StackGuard::IsDebugBreak(); |
593 | 610 |
594 // Clear the debug request flags. | 611 // Clear the debug request flags. |
595 StackGuard::Continue(DEBUGBREAK); | 612 StackGuard::Continue(DEBUGBREAK); |
596 StackGuard::Continue(DEBUGCOMMAND); | 613 StackGuard::Continue(DEBUGCOMMAND); |
597 | 614 |
598 HandleScope scope; | 615 HandleScope scope; |
599 // Enter the debugger. Just continue if we fail to enter the debugger. | 616 // Enter the debugger. Just continue if we fail to enter the debugger. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 // All allocation spaces other than NEW_SPACE have the same effect. | 658 // All allocation spaces other than NEW_SPACE have the same effect. |
642 Heap::CollectAllGarbage(); | 659 Heap::CollectAllGarbage(); |
643 return v8::Undefined(); | 660 return v8::Undefined(); |
644 } | 661 } |
645 | 662 |
646 | 663 |
647 static GCExtension kGCExtension; | 664 static GCExtension kGCExtension; |
648 v8::DeclareExtension kGCExtensionDeclaration(&kGCExtension); | 665 v8::DeclareExtension kGCExtensionDeclaration(&kGCExtension); |
649 | 666 |
650 } } // namespace v8::internal | 667 } } // namespace v8::internal |
OLD | NEW |