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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) | 111 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) |
112 | 112 |
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_ool_constant_pool), context, and function. | 117 // constant pool (if FLAG_enable_ool_constant_pool), context, and function. |
118 // StandardFrame::IterateExpressions assumes that kLastObjectOffset is the | 118 // StandardFrame::IterateExpressions assumes that kLastObjectOffset is the |
119 // last object pointer. | 119 // last object pointer. |
120 static const int kCPSlotSize = | 120 static const int kCPSlotSize = |
121 FLAG_enable_ool_constant_pool ? kPointerSize : 0; | 121 (FLAG_enable_ool_constant_pool || FLAG_enable_embedded_constant_pool) |
| 122 ? kPointerSize |
| 123 : 0; |
122 static const int kFixedFrameSizeFromFp = 2 * kPointerSize + kCPSlotSize; | 124 static const int kFixedFrameSizeFromFp = 2 * kPointerSize + kCPSlotSize; |
123 static const int kFixedFrameSize = kPCOnStackSize + kFPOnStackSize + | 125 static const int kFixedFrameSize = kPCOnStackSize + kFPOnStackSize + |
124 kFixedFrameSizeFromFp; | 126 kFixedFrameSizeFromFp; |
125 static const int kExpressionsOffset = -3 * kPointerSize - kCPSlotSize; | 127 static const int kExpressionsOffset = -3 * kPointerSize - kCPSlotSize; |
126 static const int kMarkerOffset = -2 * kPointerSize - kCPSlotSize; | 128 static const int kMarkerOffset = -2 * kPointerSize - kCPSlotSize; |
127 static const int kContextOffset = -1 * kPointerSize - kCPSlotSize; | 129 static const int kContextOffset = -1 * kPointerSize - kCPSlotSize; |
128 static const int kConstantPoolOffset = FLAG_enable_ool_constant_pool ? | 130 static const int kConstantPoolOffset = kCPSlotSize ? -1 * kPointerSize : 0; |
129 -1 * kPointerSize : 0; | |
130 static const int kCallerFPOffset = 0 * kPointerSize; | 131 static const int kCallerFPOffset = 0 * kPointerSize; |
131 static const int kCallerPCOffset = +1 * kFPOnStackSize; | 132 static const int kCallerPCOffset = +1 * kFPOnStackSize; |
132 static const int kCallerSPOffset = kCallerPCOffset + 1 * kPCOnStackSize; | 133 static const int kCallerSPOffset = kCallerPCOffset + 1 * kPCOnStackSize; |
133 | 134 |
134 static const int kLastObjectOffset = FLAG_enable_ool_constant_pool ? | 135 static const int kLastObjectOffset = FLAG_enable_ool_constant_pool ? |
135 kConstantPoolOffset : kContextOffset; | 136 kConstantPoolOffset : kContextOffset; |
136 }; | 137 }; |
137 | 138 |
138 | 139 |
139 // Abstract base class for all stack frames. | 140 // Abstract base class for all stack frames. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 209 |
209 // If this frame is optimized and was dynamically aligned return its old | 210 // If this frame is optimized and was dynamically aligned return its old |
210 // unaligned frame pointer. When the frame is deoptimized its FP will shift | 211 // unaligned frame pointer. When the frame is deoptimized its FP will shift |
211 // up one word and become unaligned. | 212 // up one word and become unaligned. |
212 Address UnpaddedFP() const; | 213 Address UnpaddedFP() const; |
213 | 214 |
214 Address pc() const { return *pc_address(); } | 215 Address pc() const { return *pc_address(); } |
215 void set_pc(Address pc) { *pc_address() = pc; } | 216 void set_pc(Address pc) { *pc_address() = pc; } |
216 | 217 |
217 Address constant_pool() const { return *constant_pool_address(); } | 218 Address constant_pool() const { return *constant_pool_address(); } |
218 void set_constant_pool(ConstantPoolArray* constant_pool) { | 219 void set_constant_pool(Address constant_pool) { |
219 *constant_pool_address() = reinterpret_cast<Address>(constant_pool); | 220 *constant_pool_address() = constant_pool; |
220 } | 221 } |
221 | 222 |
222 virtual void SetCallerFp(Address caller_fp) = 0; | 223 virtual void SetCallerFp(Address caller_fp) = 0; |
223 | 224 |
224 // Manually changes value of fp in this object. | 225 // Manually changes value of fp in this object. |
225 void UpdateFp(Address fp) { state_.fp = fp; } | 226 void UpdateFp(Address fp) { state_.fp = fp; } |
226 | 227 |
227 Address* pc_address() const { return state_.pc_address; } | 228 Address* pc_address() const { return state_.pc_address; } |
228 | 229 |
229 Address* constant_pool_address() const { | 230 Address* constant_pool_address() const { |
(...skipping 21 matching lines...) Expand all Loading... |
251 | 252 |
252 // Get the code object containing the given pc and fill in the | 253 // Get the code object containing the given pc and fill in the |
253 // safepoint entry and the number of stack slots. The pc must be at | 254 // safepoint entry and the number of stack slots. The pc must be at |
254 // a safepoint. | 255 // a safepoint. |
255 static Code* GetSafepointData(Isolate* isolate, | 256 static Code* GetSafepointData(Isolate* isolate, |
256 Address pc, | 257 Address pc, |
257 SafepointEntry* safepoint_entry, | 258 SafepointEntry* safepoint_entry, |
258 unsigned* stack_slots); | 259 unsigned* stack_slots); |
259 | 260 |
260 virtual void Iterate(ObjectVisitor* v) const = 0; | 261 virtual void Iterate(ObjectVisitor* v) const = 0; |
261 static void IteratePc(ObjectVisitor* v, Address* pc_address, Code* holder); | 262 static void IteratePc(ObjectVisitor* v, Address* pc_address, |
| 263 Address* constant_pool_address, Code* holder); |
262 | 264 |
263 // Sets a callback function for return-address rewriting profilers | 265 // Sets a callback function for return-address rewriting profilers |
264 // to resolve the location of a return address to the location of the | 266 // to resolve the location of a return address to the location of the |
265 // profiler's stashed return address. | 267 // profiler's stashed return address. |
266 static void SetReturnAddressLocationResolver( | 268 static void SetReturnAddressLocationResolver( |
267 ReturnAddressLocationResolver resolver); | 269 ReturnAddressLocationResolver resolver); |
268 | 270 |
269 // Resolves pc_address through the resolution address function if one is set. | 271 // Resolves pc_address through the resolution address function if one is set. |
270 static inline Address* ResolveReturnAddressLocation(Address* pc_address); | 272 static inline Address* ResolveReturnAddressLocation(Address* pc_address); |
271 | 273 |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 }; | 899 }; |
898 | 900 |
899 | 901 |
900 // Reads all frames on the current stack and copies them into the current | 902 // Reads all frames on the current stack and copies them into the current |
901 // zone memory. | 903 // zone memory. |
902 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 904 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
903 | 905 |
904 } } // namespace v8::internal | 906 } } // namespace v8::internal |
905 | 907 |
906 #endif // V8_FRAMES_H_ | 908 #endif // V8_FRAMES_H_ |
OLD | NEW |