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

Side by Side Diff: src/frames.h

Issue 1907443002: Introduce approximate mode for StandardFrame::Summarize. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed review feedback Created 4 years, 8 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
« no previous file with comments | « src/deoptimizer.cc ('k') | src/frames.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 private: 628 private:
629 void ComputeCallerState(State* state) const override; 629 void ComputeCallerState(State* state) const override;
630 630
631 friend class StackFrameIteratorBase; 631 friend class StackFrameIteratorBase;
632 }; 632 };
633 633
634 class JavaScriptFrame; 634 class JavaScriptFrame;
635 635
636 class FrameSummary BASE_EMBEDDED { 636 class FrameSummary BASE_EMBEDDED {
637 public: 637 public:
638 // Mode for StandardFrame::Summarize. Exact summary is required to produce an
639 // exact stack trace. It will trigger an assertion failure if that is not
640 // possible, e.g., because of missing deoptimization information. The
641 // approximate mode should produce a summary even without deoptimization
642 // information, but it might miss frames.
643 enum Mode { kExactSummary, kApproximateSummary };
644
638 FrameSummary(Object* receiver, JSFunction* function, 645 FrameSummary(Object* receiver, JSFunction* function,
639 AbstractCode* abstract_code, int code_offset, 646 AbstractCode* abstract_code, int code_offset,
640 bool is_constructor); 647 bool is_constructor, Mode mode = kExactSummary);
641 648
642 static FrameSummary GetFirst(JavaScriptFrame* frame); 649 static FrameSummary GetFirst(JavaScriptFrame* frame);
643 650
644 Handle<Object> receiver() { return receiver_; } 651 Handle<Object> receiver() { return receiver_; }
645 Handle<JSFunction> function() { return function_; } 652 Handle<JSFunction> function() { return function_; }
646 Handle<AbstractCode> abstract_code() { return abstract_code_; } 653 Handle<AbstractCode> abstract_code() { return abstract_code_; }
647 int code_offset() { return code_offset_; } 654 int code_offset() { return code_offset_; }
648 bool is_constructor() { return is_constructor_; } 655 bool is_constructor() { return is_constructor_; }
649 656
650 void Print(); 657 void Print();
(...skipping 20 matching lines...) Expand all
671 int ComputeExpressionsCount() const; 678 int ComputeExpressionsCount() const;
672 679
673 void SetCallerFp(Address caller_fp) override; 680 void SetCallerFp(Address caller_fp) override;
674 681
675 static StandardFrame* cast(StackFrame* frame) { 682 static StandardFrame* cast(StackFrame* frame) {
676 DCHECK(frame->is_standard()); 683 DCHECK(frame->is_standard());
677 return static_cast<StandardFrame*>(frame); 684 return static_cast<StandardFrame*>(frame);
678 } 685 }
679 686
680 // Build a list with summaries for this frame including all inlined frames. 687 // Build a list with summaries for this frame including all inlined frames.
681 virtual void Summarize(List<FrameSummary>* frames) const; 688 virtual void Summarize(
689 List<FrameSummary>* frames,
690 FrameSummary::Mode mode = FrameSummary::kExactSummary) const;
682 691
683 // Accessors. 692 // Accessors.
684 virtual JSFunction* function() const; 693 virtual JSFunction* function() const;
685 virtual Object* receiver() const; 694 virtual Object* receiver() const;
686 695
687 protected: 696 protected:
688 inline explicit StandardFrame(StackFrameIteratorBase* iterator); 697 inline explicit StandardFrame(StackFrameIteratorBase* iterator);
689 698
690 void ComputeCallerState(State* state) const override; 699 void ComputeCallerState(State* state) const override;
691 700
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 // Printing support. 779 // Printing support.
771 void Print(StringStream* accumulator, PrintMode mode, 780 void Print(StringStream* accumulator, PrintMode mode,
772 int index) const override; 781 int index) const override;
773 782
774 // Determine the code for the frame. 783 // Determine the code for the frame.
775 Code* unchecked_code() const override; 784 Code* unchecked_code() const override;
776 785
777 // Return a list with JSFunctions of this frame. 786 // Return a list with JSFunctions of this frame.
778 virtual void GetFunctions(List<JSFunction*>* functions) const; 787 virtual void GetFunctions(List<JSFunction*>* functions) const;
779 788
780 void Summarize(List<FrameSummary>* frames) const override; 789 void Summarize(
790 List<FrameSummary>* frames,
791 FrameSummary::Mode mode = FrameSummary::kExactSummary) const override;
781 792
782 // Lookup exception handler for current {pc}, returns -1 if none found. Also 793 // Lookup exception handler for current {pc}, returns -1 if none found. Also
783 // returns data associated with the handler site specific to the frame type: 794 // returns data associated with the handler site specific to the frame type:
784 // - JavaScriptFrame : Data is the stack depth at entry of the try-block. 795 // - JavaScriptFrame : Data is the stack depth at entry of the try-block.
785 // - OptimizedFrame : Data is the stack slot count of the entire frame. 796 // - OptimizedFrame : Data is the stack slot count of the entire frame.
786 // - InterpretedFrame: Data is the register index holding the context. 797 // - InterpretedFrame: Data is the register index holding the context.
787 virtual int LookupExceptionHandlerInTable( 798 virtual int LookupExceptionHandlerInTable(
788 int* data, HandlerTable::CatchPrediction* prediction); 799 int* data, HandlerTable::CatchPrediction* prediction);
789 800
790 // Architecture-specific register description. 801 // Architecture-specific register description.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 Type type() const override { return OPTIMIZED; } 859 Type type() const override { return OPTIMIZED; }
849 860
850 // GC support. 861 // GC support.
851 void Iterate(ObjectVisitor* v) const override; 862 void Iterate(ObjectVisitor* v) const override;
852 863
853 // Return a list with JSFunctions of this frame. 864 // Return a list with JSFunctions of this frame.
854 // The functions are ordered bottom-to-top (i.e. functions.last() 865 // The functions are ordered bottom-to-top (i.e. functions.last()
855 // is the top-most activation) 866 // is the top-most activation)
856 void GetFunctions(List<JSFunction*>* functions) const override; 867 void GetFunctions(List<JSFunction*>* functions) const override;
857 868
858 void Summarize(List<FrameSummary>* frames) const override; 869 void Summarize(
870 List<FrameSummary>* frames,
871 FrameSummary::Mode mode = FrameSummary::kExactSummary) const override;
859 872
860 // Lookup exception handler for current {pc}, returns -1 if none found. 873 // Lookup exception handler for current {pc}, returns -1 if none found.
861 int LookupExceptionHandlerInTable( 874 int LookupExceptionHandlerInTable(
862 int* data, HandlerTable::CatchPrediction* prediction) override; 875 int* data, HandlerTable::CatchPrediction* prediction) override;
863 876
864 DeoptimizationInputData* GetDeoptimizationData(int* deopt_index) const; 877 DeoptimizationInputData* GetDeoptimizationData(int* deopt_index) const;
865 878
866 static int StackSlotOffsetRelativeToFp(int slot_index); 879 static int StackSlotOffsetRelativeToFp(int slot_index);
867 880
868 protected: 881 protected:
(...skipping 26 matching lines...) Expand all
895 908
896 // Updates the frame's BytecodeArray with |bytecode_array|. Used by the 909 // Updates the frame's BytecodeArray with |bytecode_array|. Used by the
897 // debugger to swap execution onto a BytecodeArray patched with breakpoints. 910 // debugger to swap execution onto a BytecodeArray patched with breakpoints.
898 void PatchBytecodeArray(BytecodeArray* bytecode_array); 911 void PatchBytecodeArray(BytecodeArray* bytecode_array);
899 912
900 // Access to the interpreter register file for this frame. 913 // Access to the interpreter register file for this frame.
901 Object* ReadInterpreterRegister(int register_index) const; 914 Object* ReadInterpreterRegister(int register_index) const;
902 void WriteInterpreterRegister(int register_index, Object* value); 915 void WriteInterpreterRegister(int register_index, Object* value);
903 916
904 // Build a list with summaries for this frame including all inlined frames. 917 // Build a list with summaries for this frame including all inlined frames.
905 void Summarize(List<FrameSummary>* frames) const override; 918 void Summarize(
919 List<FrameSummary>* frames,
920 FrameSummary::Mode mode = FrameSummary::kExactSummary) const override;
906 921
907 protected: 922 protected:
908 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator); 923 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator);
909 924
910 Address GetExpressionAddress(int n) const override; 925 Address GetExpressionAddress(int n) const override;
911 926
912 private: 927 private:
913 friend class StackFrameIteratorBase; 928 friend class StackFrameIteratorBase;
914 }; 929 };
915 930
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 // Determine the code for the frame. 975 // Determine the code for the frame.
961 Code* unchecked_code() const override; 976 Code* unchecked_code() const override;
962 977
963 static WasmFrame* cast(StackFrame* frame) { 978 static WasmFrame* cast(StackFrame* frame) {
964 DCHECK(frame->is_wasm()); 979 DCHECK(frame->is_wasm());
965 return static_cast<WasmFrame*>(frame); 980 return static_cast<WasmFrame*>(frame);
966 } 981 }
967 982
968 JSFunction* function() const override; 983 JSFunction* function() const override;
969 984
970 void Summarize(List<FrameSummary>* frames) const override; 985 void Summarize(
986 List<FrameSummary>* frames,
987 FrameSummary::Mode mode = FrameSummary::kExactSummary) const override;
971 988
972 protected: 989 protected:
973 inline explicit WasmFrame(StackFrameIteratorBase* iterator); 990 inline explicit WasmFrame(StackFrameIteratorBase* iterator);
974 991
975 Address GetCallerStackPointer() const override; 992 Address GetCallerStackPointer() const override;
976 993
977 private: 994 private:
978 friend class StackFrameIteratorBase; 995 friend class StackFrameIteratorBase;
979 }; 996 };
980 997
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 1228
1212 1229
1213 // Reads all frames on the current stack and copies them into the current 1230 // Reads all frames on the current stack and copies them into the current
1214 // zone memory. 1231 // zone memory.
1215 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); 1232 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone);
1216 1233
1217 } // namespace internal 1234 } // namespace internal
1218 } // namespace v8 1235 } // namespace v8
1219 1236
1220 #endif // V8_FRAMES_H_ 1237 #endif // V8_FRAMES_H_
OLDNEW
« no previous file with comments | « src/deoptimizer.cc ('k') | src/frames.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698