| 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_DEBUG_H_ | 5 #ifndef V8_DEBUG_DEBUG_H_ |
| 6 #define V8_DEBUG_DEBUG_H_ | 6 #define V8_DEBUG_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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 BreakPositionAlignment position_aligment); | 448 BreakPositionAlignment position_aligment); |
| 449 | 449 |
| 450 // Check whether a global object is the debug global object. | 450 // Check whether a global object is the debug global object. |
| 451 bool IsDebugGlobal(JSGlobalObject* global); | 451 bool IsDebugGlobal(JSGlobalObject* global); |
| 452 | 452 |
| 453 // Check whether this frame is just about to return. | 453 // Check whether this frame is just about to return. |
| 454 bool IsBreakAtReturn(JavaScriptFrame* frame); | 454 bool IsBreakAtReturn(JavaScriptFrame* frame); |
| 455 | 455 |
| 456 // Support for LiveEdit | 456 // Support for LiveEdit |
| 457 void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id, | 457 void FramesHaveBeenDropped(StackFrame::Id new_break_frame_id, |
| 458 LiveEdit::FrameDropMode mode); | 458 LiveEdit::FrameDropMode mode, |
| 459 Object** restarter_frame_function_pointer); |
| 459 | 460 |
| 460 // Threading support. | 461 // Threading support. |
| 461 char* ArchiveDebug(char* to); | 462 char* ArchiveDebug(char* to); |
| 462 char* RestoreDebug(char* from); | 463 char* RestoreDebug(char* from); |
| 463 static int ArchiveSpacePerThread(); | 464 static int ArchiveSpacePerThread(); |
| 464 void FreeThreadResources() { } | 465 void FreeThreadResources() { } |
| 465 | 466 |
| 466 // Record function from which eval was called. | 467 // Record function from which eval was called. |
| 467 static void RecordEvalCaller(Handle<Script> script); | 468 static void RecordEvalCaller(Handle<Script> script); |
| 468 | 469 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 495 | 496 |
| 496 // Support for embedding into generated code. | 497 // Support for embedding into generated code. |
| 497 Address is_active_address() { | 498 Address is_active_address() { |
| 498 return reinterpret_cast<Address>(&is_active_); | 499 return reinterpret_cast<Address>(&is_active_); |
| 499 } | 500 } |
| 500 | 501 |
| 501 Address after_break_target_address() { | 502 Address after_break_target_address() { |
| 502 return reinterpret_cast<Address>(&after_break_target_); | 503 return reinterpret_cast<Address>(&after_break_target_); |
| 503 } | 504 } |
| 504 | 505 |
| 506 Address restarter_frame_function_pointer_address() { |
| 507 Object*** address = &thread_local_.restarter_frame_function_pointer_; |
| 508 return reinterpret_cast<Address>(address); |
| 509 } |
| 510 |
| 505 Address step_in_enabled_address() { | 511 Address step_in_enabled_address() { |
| 506 return reinterpret_cast<Address>(&thread_local_.step_in_enabled_); | 512 return reinterpret_cast<Address>(&thread_local_.step_in_enabled_); |
| 507 } | 513 } |
| 508 | 514 |
| 509 StepAction last_step_action() { return thread_local_.last_step_action_; } | 515 StepAction last_step_action() { return thread_local_.last_step_action_; } |
| 510 | 516 |
| 511 DebugFeatureTracker* feature_tracker() { return &feature_tracker_; } | 517 DebugFeatureTracker* feature_tracker() { return &feature_tracker_; } |
| 512 | 518 |
| 513 private: | 519 private: |
| 514 explicit Debug(Isolate* isolate); | 520 explicit Debug(Isolate* isolate); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 Address step_out_fp_; | 649 Address step_out_fp_; |
| 644 | 650 |
| 645 // Whether functions are flooded on entry for step-in and step-frame. | 651 // Whether functions are flooded on entry for step-in and step-frame. |
| 646 // If we stepped out to the embedder, disable flooding to spill stepping | 652 // If we stepped out to the embedder, disable flooding to spill stepping |
| 647 // to the next call that the embedder makes. | 653 // to the next call that the embedder makes. |
| 648 bool step_in_enabled_; | 654 bool step_in_enabled_; |
| 649 | 655 |
| 650 // Stores the way how LiveEdit has patched the stack. It is used when | 656 // Stores the way how LiveEdit has patched the stack. It is used when |
| 651 // debugger returns control back to user script. | 657 // debugger returns control back to user script. |
| 652 LiveEdit::FrameDropMode frame_drop_mode_; | 658 LiveEdit::FrameDropMode frame_drop_mode_; |
| 659 |
| 660 // When restarter frame is on stack, stores the address |
| 661 // of the pointer to function being restarted. Otherwise (most of the time) |
| 662 // stores NULL. This pointer is used with 'step in' implementation. |
| 663 Object** restarter_frame_function_pointer_; |
| 653 }; | 664 }; |
| 654 | 665 |
| 655 // Storage location for registers when handling debug break calls | 666 // Storage location for registers when handling debug break calls |
| 656 ThreadLocal thread_local_; | 667 ThreadLocal thread_local_; |
| 657 | 668 |
| 658 Isolate* isolate_; | 669 Isolate* isolate_; |
| 659 | 670 |
| 660 friend class Isolate; | 671 friend class Isolate; |
| 661 friend class DebugScope; | 672 friend class DebugScope; |
| 662 friend class DisableBreak; | 673 friend class DisableBreak; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 class DebugCodegen : public AllStatic { | 750 class DebugCodegen : public AllStatic { |
| 740 public: | 751 public: |
| 741 enum DebugBreakCallHelperMode { | 752 enum DebugBreakCallHelperMode { |
| 742 SAVE_RESULT_REGISTER, | 753 SAVE_RESULT_REGISTER, |
| 743 IGNORE_RESULT_REGISTER | 754 IGNORE_RESULT_REGISTER |
| 744 }; | 755 }; |
| 745 | 756 |
| 746 static void GenerateDebugBreakStub(MacroAssembler* masm, | 757 static void GenerateDebugBreakStub(MacroAssembler* masm, |
| 747 DebugBreakCallHelperMode mode); | 758 DebugBreakCallHelperMode mode); |
| 748 | 759 |
| 760 static void GeneratePlainReturnLiveEdit(MacroAssembler* masm); |
| 761 |
| 749 // FrameDropper is a code replacement for a JavaScript frame with possibly | 762 // FrameDropper is a code replacement for a JavaScript frame with possibly |
| 750 // several frames above. | 763 // several frames above. |
| 751 // There is no calling conventions here, because it never actually gets | 764 // There is no calling conventions here, because it never actually gets |
| 752 // called, it only gets returned to. | 765 // called, it only gets returned to. |
| 753 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); | 766 static void GenerateFrameDropperLiveEdit(MacroAssembler* masm); |
| 754 | 767 |
| 755 | 768 |
| 756 static void GenerateSlot(MacroAssembler* masm, RelocInfo::Mode mode); | 769 static void GenerateSlot(MacroAssembler* masm, RelocInfo::Mode mode); |
| 757 | 770 |
| 758 static void PatchDebugBreakSlot(Isolate* isolate, Address pc, | 771 static void PatchDebugBreakSlot(Isolate* isolate, Address pc, |
| 759 Handle<Code> code); | 772 Handle<Code> code); |
| 760 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); | 773 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); |
| 761 }; | 774 }; |
| 762 | 775 |
| 763 | 776 |
| 764 } // namespace internal | 777 } // namespace internal |
| 765 } // namespace v8 | 778 } // namespace v8 |
| 766 | 779 |
| 767 #endif // V8_DEBUG_DEBUG_H_ | 780 #endif // V8_DEBUG_DEBUG_H_ |
| OLD | NEW |