Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/debug/debug.h

Issue 1818873003: [Interpreter] Adds support to fetch return value on break at return. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed the bugs in earlier implementation. Changed full-codegen to match ignition for fetching the r… Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 inline bool is_loaded() const { return !debug_context_.is_null(); } 517 inline bool is_loaded() const { return !debug_context_.is_null(); }
518 inline bool in_debug_scope() const { 518 inline bool in_debug_scope() const {
519 return !!base::NoBarrier_Load(&thread_local_.current_debug_scope_); 519 return !!base::NoBarrier_Load(&thread_local_.current_debug_scope_);
520 } 520 }
521 void set_break_points_active(bool v) { break_points_active_ = v; } 521 void set_break_points_active(bool v) { break_points_active_ = v; }
522 bool break_points_active() const { return break_points_active_; } 522 bool break_points_active() const { return break_points_active_; }
523 523
524 StackFrame::Id break_frame_id() { return thread_local_.break_frame_id_; } 524 StackFrame::Id break_frame_id() { return thread_local_.break_frame_id_; }
525 int break_id() { return thread_local_.break_id_; } 525 int break_id() { return thread_local_.break_id_; }
526 526
527 Handle<Object> get_return_value() { return thread_local_.return_value_; }
528
527 // Support for embedding into generated code. 529 // Support for embedding into generated code.
528 Address is_active_address() { 530 Address is_active_address() {
529 return reinterpret_cast<Address>(&is_active_); 531 return reinterpret_cast<Address>(&is_active_);
530 } 532 }
531 533
532 Address after_break_target_address() { 534 Address after_break_target_address() {
533 return reinterpret_cast<Address>(&after_break_target_); 535 return reinterpret_cast<Address>(&after_break_target_);
534 } 536 }
535 537
536 Address step_in_enabled_address() { 538 Address step_in_enabled_address() {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 Address target_fp_; 673 Address target_fp_;
672 674
673 // Whether functions are flooded on entry for step-in and step-frame. 675 // Whether functions are flooded on entry for step-in and step-frame.
674 // If we stepped out to the embedder, disable flooding to spill stepping 676 // If we stepped out to the embedder, disable flooding to spill stepping
675 // to the next call that the embedder makes. 677 // to the next call that the embedder makes.
676 bool step_in_enabled_; 678 bool step_in_enabled_;
677 679
678 // Stores the way how LiveEdit has patched the stack. It is used when 680 // Stores the way how LiveEdit has patched the stack. It is used when
679 // debugger returns control back to user script. 681 // debugger returns control back to user script.
680 LiveEdit::FrameDropMode frame_drop_mode_; 682 LiveEdit::FrameDropMode frame_drop_mode_;
683
684 // Value of accumulator in interpreter frames. In non-interpreter frames
685 // this value will be a hole.
rmcilroy 2016/03/22 11:32:34 /s/a hole/the hole/
mythria 2016/03/22 12:08:09 Done.
686 Handle<Object> return_value_;
681 }; 687 };
682 688
683 // Storage location for registers when handling debug break calls 689 // Storage location for registers when handling debug break calls
684 ThreadLocal thread_local_; 690 ThreadLocal thread_local_;
685 691
686 Isolate* isolate_; 692 Isolate* isolate_;
687 693
688 friend class Isolate; 694 friend class Isolate;
689 friend class DebugScope; 695 friend class DebugScope;
690 friend class DisableBreak; 696 friend class DisableBreak;
(...skipping 21 matching lines...) Expand all
712 // Get the active context from before entering the debugger. 718 // Get the active context from before entering the debugger.
713 inline Handle<Context> GetContext() { return save_.context(); } 719 inline Handle<Context> GetContext() { return save_.context(); }
714 720
715 private: 721 private:
716 Isolate* isolate() { return debug_->isolate_; } 722 Isolate* isolate() { return debug_->isolate_; }
717 723
718 Debug* debug_; 724 Debug* debug_;
719 DebugScope* prev_; // Previous scope if entered recursively. 725 DebugScope* prev_; // Previous scope if entered recursively.
720 StackFrame::Id break_frame_id_; // Previous break frame id. 726 StackFrame::Id break_frame_id_; // Previous break frame id.
721 int break_id_; // Previous break id. 727 int break_id_; // Previous break id.
728 Handle<Object> return_value_; // Previous result.
722 bool failed_; // Did the debug context fail to load? 729 bool failed_; // Did the debug context fail to load?
723 SaveContext save_; // Saves previous context. 730 SaveContext save_; // Saves previous context.
724 PostponeInterruptsScope no_termination_exceptons_; 731 PostponeInterruptsScope no_termination_exceptons_;
725 }; 732 };
726 733
727 734
728 // Stack allocated class for disabling break. 735 // Stack allocated class for disabling break.
729 class DisableBreak BASE_EMBEDDED { 736 class DisableBreak BASE_EMBEDDED {
730 public: 737 public:
731 explicit DisableBreak(Debug* debug, bool disable_break) 738 explicit DisableBreak(Debug* debug, bool disable_break)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 Handle<Code> code); 794 Handle<Code> code);
788 static bool DebugBreakSlotIsPatched(Address pc); 795 static bool DebugBreakSlotIsPatched(Address pc);
789 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); 796 static void ClearDebugBreakSlot(Isolate* isolate, Address pc);
790 }; 797 };
791 798
792 799
793 } // namespace internal 800 } // namespace internal
794 } // namespace v8 801 } // namespace v8
795 802
796 #endif // V8_DEBUG_DEBUG_H_ 803 #endif // V8_DEBUG_DEBUG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698