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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 // Determine the code for the frame. | 617 // Determine the code for the frame. |
618 Code* unchecked_code() const override; | 618 Code* unchecked_code() const override; |
619 | 619 |
620 // Return a list with JSFunctions of this frame. | 620 // Return a list with JSFunctions of this frame. |
621 virtual void GetFunctions(List<JSFunction*>* functions) const; | 621 virtual void GetFunctions(List<JSFunction*>* functions) const; |
622 | 622 |
623 // Build a list with summaries for this frame including all inlined frames. | 623 // Build a list with summaries for this frame including all inlined frames. |
624 virtual void Summarize(List<FrameSummary>* frames); | 624 virtual void Summarize(List<FrameSummary>* frames); |
625 | 625 |
626 // Lookup exception handler for current {pc}, returns -1 if none found. Also | 626 // Lookup exception handler for current {pc}, returns -1 if none found. Also |
627 // returns the expected number of stack slots at the handler site. | 627 // returns data associated with the handler site specific to the frame type: |
| 628 // - JavaScriptFrame : Data is the stack depth at entry of the try-block. |
| 629 // - OptimizedFrame : Data is the stack slot count of the entire frame. |
| 630 // - InterpretedFrame: Data is the register index holding the context. |
628 virtual int LookupExceptionHandlerInTable( | 631 virtual int LookupExceptionHandlerInTable( |
629 int* stack_slots, HandlerTable::CatchPrediction* prediction); | 632 int* data, HandlerTable::CatchPrediction* prediction); |
630 | 633 |
631 // Architecture-specific register description. | 634 // Architecture-specific register description. |
632 static Register fp_register(); | 635 static Register fp_register(); |
633 static Register context_register(); | 636 static Register context_register(); |
634 static Register constant_pool_pointer_register(); | 637 static Register constant_pool_pointer_register(); |
635 | 638 |
636 static JavaScriptFrame* cast(StackFrame* frame) { | 639 static JavaScriptFrame* cast(StackFrame* frame) { |
637 DCHECK(frame->is_java_script()); | 640 DCHECK(frame->is_java_script()); |
638 return static_cast<JavaScriptFrame*>(frame); | 641 return static_cast<JavaScriptFrame*>(frame); |
639 } | 642 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 // GC support. | 694 // GC support. |
692 void Iterate(ObjectVisitor* v) const override; | 695 void Iterate(ObjectVisitor* v) const override; |
693 | 696 |
694 // Return a list with JSFunctions of this frame. | 697 // Return a list with JSFunctions of this frame. |
695 // The functions are ordered bottom-to-top (i.e. functions.last() | 698 // The functions are ordered bottom-to-top (i.e. functions.last() |
696 // is the top-most activation) | 699 // is the top-most activation) |
697 void GetFunctions(List<JSFunction*>* functions) const override; | 700 void GetFunctions(List<JSFunction*>* functions) const override; |
698 | 701 |
699 void Summarize(List<FrameSummary>* frames) override; | 702 void Summarize(List<FrameSummary>* frames) override; |
700 | 703 |
701 // Lookup exception handler for current {pc}, returns -1 if none found. Also | 704 // Lookup exception handler for current {pc}, returns -1 if none found. |
702 // returns the expected number of stack slots at the handler site. | |
703 int LookupExceptionHandlerInTable( | 705 int LookupExceptionHandlerInTable( |
704 int* stack_slots, HandlerTable::CatchPrediction* prediction) override; | 706 int* data, HandlerTable::CatchPrediction* prediction) override; |
705 | 707 |
706 DeoptimizationInputData* GetDeoptimizationData(int* deopt_index) const; | 708 DeoptimizationInputData* GetDeoptimizationData(int* deopt_index) const; |
707 | 709 |
708 static int StackSlotOffsetRelativeToFp(int slot_index); | 710 static int StackSlotOffsetRelativeToFp(int slot_index); |
709 | 711 |
710 protected: | 712 protected: |
711 inline explicit OptimizedFrame(StackFrameIteratorBase* iterator); | 713 inline explicit OptimizedFrame(StackFrameIteratorBase* iterator); |
712 | 714 |
713 private: | 715 private: |
714 friend class StackFrameIteratorBase; | 716 friend class StackFrameIteratorBase; |
715 | 717 |
716 Object* StackSlotAt(int index) const; | 718 Object* StackSlotAt(int index) const; |
717 }; | 719 }; |
718 | 720 |
719 | 721 |
720 class InterpretedFrame : public JavaScriptFrame { | 722 class InterpretedFrame : public JavaScriptFrame { |
721 public: | 723 public: |
722 Type type() const override { return INTERPRETED; } | 724 Type type() const override { return INTERPRETED; } |
723 | 725 |
724 // Lookup exception handler for current {pc}, returns -1 if none found. Also | 726 // Lookup exception handler for current {pc}, returns -1 if none found. |
725 // returns the expected number of stack slots at the handler site. | |
726 int LookupExceptionHandlerInTable( | 727 int LookupExceptionHandlerInTable( |
727 int* stack_slots, HandlerTable::CatchPrediction* prediction) override; | 728 int* data, HandlerTable::CatchPrediction* prediction) override; |
728 | 729 |
729 // Returns the current offset into the bytecode stream. | 730 // Returns the current offset into the bytecode stream. |
730 int GetBytecodeOffset() const; | 731 int GetBytecodeOffset() const; |
731 | 732 |
732 // Updates the current offset into the bytecode stream, mainly used for stack | 733 // Updates the current offset into the bytecode stream, mainly used for stack |
733 // unwinding to continue execution at a different bytecode offset. | 734 // unwinding to continue execution at a different bytecode offset. |
734 void PatchBytecodeOffset(int new_offset); | 735 void PatchBytecodeOffset(int new_offset); |
735 | 736 |
736 // Access to the interpreter register file for this frame. | 737 // Access to the interpreter register file for this frame. |
737 Object* GetInterpreterRegister(int register_index) const; | 738 Object* GetInterpreterRegister(int register_index) const; |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 | 992 |
992 | 993 |
993 // Reads all frames on the current stack and copies them into the current | 994 // Reads all frames on the current stack and copies them into the current |
994 // zone memory. | 995 // zone memory. |
995 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 996 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
996 | 997 |
997 } // namespace internal | 998 } // namespace internal |
998 } // namespace v8 | 999 } // namespace v8 |
999 | 1000 |
1000 #endif // V8_FRAMES_H_ | 1001 #endif // V8_FRAMES_H_ |
OLD | NEW |