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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 class StandardFrameConstants : public AllStatic { | 114 class StandardFrameConstants : public AllStatic { |
115 public: | 115 public: |
116 // Fixed part of the frame consists of return address, caller fp, | 116 // Fixed part of the frame consists of return address, caller fp, |
117 // constant pool (if FLAG_enable_embedded_constant_pool), context, and | 117 // constant pool (if FLAG_enable_embedded_constant_pool), context, and |
118 // function. StandardFrame::IterateExpressions assumes that kLastObjectOffset | 118 // function. StandardFrame::IterateExpressions assumes that kLastObjectOffset |
119 // is the last object pointer. | 119 // is the last object pointer. |
120 static const int kCPSlotSize = | 120 static const int kCPSlotSize = |
121 FLAG_enable_embedded_constant_pool ? kPointerSize : 0; | 121 FLAG_enable_embedded_constant_pool ? kPointerSize : 0; |
122 static const int kFixedFrameSizeFromFp = 2 * kPointerSize + kCPSlotSize; | 122 static const int kFixedFrameSizeFromFp = 2 * kPointerSize + kCPSlotSize; |
| 123 static const int kFixedFrameSizeAboveFp = kPCOnStackSize + kFPOnStackSize; |
123 static const int kFixedFrameSize = | 124 static const int kFixedFrameSize = |
124 kPCOnStackSize + kFPOnStackSize + kFixedFrameSizeFromFp; | 125 kFixedFrameSizeAboveFp + kFixedFrameSizeFromFp; |
| 126 static const int kFixedSlotCountAboveFp = |
| 127 kFixedFrameSizeAboveFp / kPointerSize; |
| 128 static const int kFixedSlotCount = kFixedFrameSize / kPointerSize; |
125 static const int kExpressionsOffset = -3 * kPointerSize - kCPSlotSize; | 129 static const int kExpressionsOffset = -3 * kPointerSize - kCPSlotSize; |
126 static const int kMarkerOffset = -2 * kPointerSize - kCPSlotSize; | 130 static const int kMarkerOffset = -2 * kPointerSize - kCPSlotSize; |
127 static const int kContextOffset = -1 * kPointerSize - kCPSlotSize; | 131 static const int kContextOffset = -1 * kPointerSize - kCPSlotSize; |
128 static const int kConstantPoolOffset = kCPSlotSize ? -1 * kPointerSize : 0; | 132 static const int kConstantPoolOffset = kCPSlotSize ? -1 * kPointerSize : 0; |
129 static const int kCallerFPOffset = 0 * kPointerSize; | 133 static const int kCallerFPOffset = 0 * kPointerSize; |
130 static const int kCallerPCOffset = +1 * kFPOnStackSize; | 134 static const int kCallerPCOffset = +1 * kFPOnStackSize; |
131 static const int kCallerSPOffset = kCallerPCOffset + 1 * kPCOnStackSize; | 135 static const int kCallerSPOffset = kCallerPCOffset + 1 * kPCOnStackSize; |
132 | 136 |
133 static const int kLastObjectOffset = kContextOffset; | 137 static const int kLastObjectOffset = kContextOffset; |
134 }; | 138 }; |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 | 675 |
672 virtual void Summarize(List<FrameSummary>* frames); | 676 virtual void Summarize(List<FrameSummary>* frames); |
673 | 677 |
674 // Lookup exception handler for current {pc}, returns -1 if none found. Also | 678 // Lookup exception handler for current {pc}, returns -1 if none found. Also |
675 // returns the expected number of stack slots at the handler site. | 679 // returns the expected number of stack slots at the handler site. |
676 virtual int LookupExceptionHandlerInTable( | 680 virtual int LookupExceptionHandlerInTable( |
677 int* stack_slots, HandlerTable::CatchPrediction* prediction); | 681 int* stack_slots, HandlerTable::CatchPrediction* prediction); |
678 | 682 |
679 DeoptimizationInputData* GetDeoptimizationData(int* deopt_index); | 683 DeoptimizationInputData* GetDeoptimizationData(int* deopt_index); |
680 | 684 |
| 685 static int StackSlotOffsetRelativeToFp(int slot_index); |
| 686 |
681 protected: | 687 protected: |
682 inline explicit OptimizedFrame(StackFrameIteratorBase* iterator); | 688 inline explicit OptimizedFrame(StackFrameIteratorBase* iterator); |
683 | 689 |
684 private: | 690 private: |
685 friend class StackFrameIteratorBase; | 691 friend class StackFrameIteratorBase; |
686 | 692 |
687 Object* StackSlotAt(int index) const; | 693 Object* StackSlotAt(int index) const; |
688 }; | 694 }; |
689 | 695 |
690 | 696 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 }; | 938 }; |
933 | 939 |
934 | 940 |
935 // Reads all frames on the current stack and copies them into the current | 941 // Reads all frames on the current stack and copies them into the current |
936 // zone memory. | 942 // zone memory. |
937 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 943 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
938 | 944 |
939 } } // namespace v8::internal | 945 } } // namespace v8::internal |
940 | 946 |
941 #endif // V8_FRAMES_H_ | 947 #endif // V8_FRAMES_H_ |
OLD | NEW |