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_FRAMES_H_ | 5 #ifndef V8_FRAMES_H_ |
6 #define V8_FRAMES_H_ | 6 #define V8_FRAMES_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 #include "src/safepoint-table.h" | 10 #include "src/safepoint-table.h" |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 inline explicit ExitFrame(StackFrameIteratorBase* iterator); | 633 inline explicit ExitFrame(StackFrameIteratorBase* iterator); |
634 | 634 |
635 Address GetCallerStackPointer() const override; | 635 Address GetCallerStackPointer() const override; |
636 | 636 |
637 private: | 637 private: |
638 void ComputeCallerState(State* state) const override; | 638 void ComputeCallerState(State* state) const override; |
639 | 639 |
640 friend class StackFrameIteratorBase; | 640 friend class StackFrameIteratorBase; |
641 }; | 641 }; |
642 | 642 |
643 class JavaScriptFrame; | |
644 | |
645 class FrameSummary BASE_EMBEDDED { | 643 class FrameSummary BASE_EMBEDDED { |
646 public: | 644 public: |
647 FrameSummary(Object* receiver, JSFunction* function, | 645 FrameSummary(Object* receiver, JSFunction* function, |
648 AbstractCode* abstract_code, int code_offset, | 646 AbstractCode* abstract_code, int code_offset, |
649 bool is_constructor); | 647 bool is_constructor); |
650 | 648 |
651 static FrameSummary GetFirst(JavaScriptFrame* frame); | |
652 | |
653 Handle<Object> receiver() { return receiver_; } | 649 Handle<Object> receiver() { return receiver_; } |
654 Handle<JSFunction> function() { return function_; } | 650 Handle<JSFunction> function() { return function_; } |
655 Handle<AbstractCode> abstract_code() { return abstract_code_; } | 651 Handle<AbstractCode> abstract_code() { return abstract_code_; } |
656 int code_offset() { return code_offset_; } | 652 int code_offset() { return code_offset_; } |
657 bool is_constructor() { return is_constructor_; } | 653 bool is_constructor() { return is_constructor_; } |
658 | 654 |
659 void Print(); | 655 void Print(); |
660 | 656 |
661 private: | 657 private: |
662 Handle<Object> receiver_; | 658 Handle<Object> receiver_; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 static inline bool IsConstructFrame(Address fp); | 722 static inline bool IsConstructFrame(Address fp); |
727 | 723 |
728 // Used by OptimizedFrames and StubFrames. | 724 // Used by OptimizedFrames and StubFrames. |
729 void IterateCompiledFrame(ObjectVisitor* v) const; | 725 void IterateCompiledFrame(ObjectVisitor* v) const; |
730 | 726 |
731 private: | 727 private: |
732 friend class StackFrame; | 728 friend class StackFrame; |
733 friend class SafeStackFrameIterator; | 729 friend class SafeStackFrameIterator; |
734 }; | 730 }; |
735 | 731 |
| 732 |
736 class JavaScriptFrame : public StandardFrame { | 733 class JavaScriptFrame : public StandardFrame { |
737 public: | 734 public: |
738 Type type() const override { return JAVA_SCRIPT; } | 735 Type type() const override { return JAVA_SCRIPT; } |
739 | 736 |
740 JSFunction* function() const override; | 737 JSFunction* function() const override; |
741 Object* receiver() const override; | 738 Object* receiver() const override; |
742 | 739 |
743 inline void set_receiver(Object* value); | 740 inline void set_receiver(Object* value); |
744 | 741 |
745 // Access the parameters. | 742 // Access the parameters. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 int* data, HandlerTable::CatchPrediction* prediction) override; | 890 int* data, HandlerTable::CatchPrediction* prediction) override; |
894 | 891 |
895 // Returns the current offset into the bytecode stream. | 892 // Returns the current offset into the bytecode stream. |
896 int GetBytecodeOffset() const; | 893 int GetBytecodeOffset() const; |
897 | 894 |
898 // Updates the current offset into the bytecode stream, mainly used for stack | 895 // Updates the current offset into the bytecode stream, mainly used for stack |
899 // unwinding to continue execution at a different bytecode offset. | 896 // unwinding to continue execution at a different bytecode offset. |
900 void PatchBytecodeOffset(int new_offset); | 897 void PatchBytecodeOffset(int new_offset); |
901 | 898 |
902 // Returns the frame's current bytecode array. | 899 // Returns the frame's current bytecode array. |
903 BytecodeArray* GetBytecodeArray() const; | 900 Object* GetBytecodeArray() const; |
904 | 901 |
905 // Updates the frame's BytecodeArray with |bytecode_array|. Used by the | 902 // Updates the frame's BytecodeArray with |bytecode_array|. Used by the |
906 // debugger to swap execution onto a BytecodeArray patched with breakpoints. | 903 // debugger to swap execution onto a BytecodeArray patched with breakpoints. |
907 void PatchBytecodeArray(BytecodeArray* bytecode_array); | 904 void PatchBytecodeArray(Object* bytecode_array); |
908 | 905 |
909 // Access to the interpreter register file for this frame. | 906 // Access to the interpreter register file for this frame. |
910 Object* GetInterpreterRegister(int register_index) const; | 907 Object* GetInterpreterRegister(int register_index) const; |
911 | 908 |
912 // Build a list with summaries for this frame including all inlined frames. | 909 // Build a list with summaries for this frame including all inlined frames. |
913 void Summarize(List<FrameSummary>* frames) const override; | 910 void Summarize(List<FrameSummary>* frames) const override; |
914 | 911 |
915 protected: | 912 protected: |
916 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator); | 913 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator); |
917 | 914 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 | 1214 |
1218 | 1215 |
1219 // Reads all frames on the current stack and copies them into the current | 1216 // Reads all frames on the current stack and copies them into the current |
1220 // zone memory. | 1217 // zone memory. |
1221 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 1218 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
1222 | 1219 |
1223 } // namespace internal | 1220 } // namespace internal |
1224 } // namespace v8 | 1221 } // namespace v8 |
1225 | 1222 |
1226 #endif // V8_FRAMES_H_ | 1223 #endif // V8_FRAMES_H_ |
OLD | NEW |