| 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 #ifndef V8_DEBUG_H_ | 5 #ifndef V8_DEBUG_H_ |
| 6 #define V8_DEBUG_H_ | 6 #define V8_DEBUG_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 // Stores the way how LiveEdit has patched the stack. It is used when | 725 // Stores the way how LiveEdit has patched the stack. It is used when |
| 726 // debugger returns control back to user script. | 726 // debugger returns control back to user script. |
| 727 LiveEdit::FrameDropMode frame_drop_mode_; | 727 LiveEdit::FrameDropMode frame_drop_mode_; |
| 728 | 728 |
| 729 // When restarter frame is on stack, stores the address | 729 // When restarter frame is on stack, stores the address |
| 730 // of the pointer to function being restarted. Otherwise (most of the time) | 730 // of the pointer to function being restarted. Otherwise (most of the time) |
| 731 // stores NULL. This pointer is used with 'step in' implementation. | 731 // stores NULL. This pointer is used with 'step in' implementation. |
| 732 Object** restarter_frame_function_pointer_; | 732 Object** restarter_frame_function_pointer_; |
| 733 }; | 733 }; |
| 734 | 734 |
| 735 |
| 736 class PreserveDebugState { |
| 737 public: |
| 738 explicit PreserveDebugState(Debug* debug) : debug_(debug) { |
| 739 size_t size = sizeof(debug_->thread_local_); |
| 740 storage_ = NewArray<char>(size); |
| 741 MemCopy(storage_, &debug_->thread_local_, size); |
| 742 } |
| 743 |
| 744 ~PreserveDebugState() { |
| 745 size_t size = sizeof(debug_->thread_local_); |
| 746 MemCopy(&debug_->thread_local_, storage_, size); |
| 747 DeleteArray(storage_); |
| 748 } |
| 749 |
| 750 private: |
| 751 Debug* debug_; |
| 752 char* storage_; |
| 753 }; |
| 754 |
| 755 |
| 735 // Storage location for registers when handling debug break calls | 756 // Storage location for registers when handling debug break calls |
| 736 ThreadLocal thread_local_; | 757 ThreadLocal thread_local_; |
| 737 | 758 |
| 738 Isolate* isolate_; | 759 Isolate* isolate_; |
| 739 | 760 |
| 740 friend class Isolate; | 761 friend class Isolate; |
| 741 friend class DebugScope; | 762 friend class DebugScope; |
| 742 friend class DisableBreak; | 763 friend class DisableBreak; |
| 743 friend class LiveEdit; | 764 friend class LiveEdit; |
| 744 friend class SuppressDebug; | 765 friend class SuppressDebug; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 // several frames above. | 860 // several frames above. |
| 840 // There is no calling conventions here, because it never actually gets | 861 // There is no calling conventions here, because it never actually gets |
| 841 // called, it only gets returned to. | 862 // called, it only gets returned to. |
| 842 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); | 863 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); |
| 843 }; | 864 }; |
| 844 | 865 |
| 845 | 866 |
| 846 } } // namespace v8::internal | 867 } } // namespace v8::internal |
| 847 | 868 |
| 848 #endif // V8_DEBUG_H_ | 869 #endif // V8_DEBUG_H_ |
| OLD | NEW |