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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 static const int kFixedFrameSize = | 211 static const int kFixedFrameSize = |
212 kFixedFrameSizeAboveFp + kFixedFrameSizeFromFp; | 212 kFixedFrameSizeAboveFp + kFixedFrameSizeFromFp; |
213 static const int kFixedSlotCountFromFp = kFixedFrameSizeFromFp / kPointerSize; | 213 static const int kFixedSlotCountFromFp = kFixedFrameSizeFromFp / kPointerSize; |
214 static const int kFixedSlotCount = kFixedFrameSize / kPointerSize; | 214 static const int kFixedSlotCount = kFixedFrameSize / kPointerSize; |
215 static const int kContextOffset = kContextOrFrameTypeOffset; | 215 static const int kContextOffset = kContextOrFrameTypeOffset; |
216 static const int kFunctionOffset = -2 * kPointerSize - kCPSlotSize; | 216 static const int kFunctionOffset = -2 * kPointerSize - kCPSlotSize; |
217 static const int kExpressionsOffset = -3 * kPointerSize - kCPSlotSize; | 217 static const int kExpressionsOffset = -3 * kPointerSize - kCPSlotSize; |
218 static const int kLastObjectOffset = kContextOffset; | 218 static const int kLastObjectOffset = kContextOffset; |
219 }; | 219 }; |
220 | 220 |
| 221 // OptimizedBuiltinFrameConstants are used for TF-generated builtins. They |
| 222 // always have a context below the saved fp/constant pool and below that the |
| 223 // JSFunction of the executing function and below that an integer (not a Smi) |
| 224 // containing the number of arguments passed to the builtin. |
| 225 // |
| 226 // slot JS frame |
| 227 // +-----------------+-------------------------------- |
| 228 // -n-1 | parameter 0 | ^ |
| 229 // |- - - - - - - - -| | |
| 230 // -n | | Caller |
| 231 // ... | ... | frame slots |
| 232 // -2 | parameter n-1 | (slot < 0) |
| 233 // |- - - - - - - - -| | |
| 234 // -1 | parameter n | v |
| 235 // -----+-----------------+-------------------------------- |
| 236 // 0 | return addr | ^ ^ |
| 237 // |- - - - - - - - -| | | |
| 238 // 1 | saved frame ptr | Fixed | |
| 239 // |- - - - - - - - -| Header <-- frame ptr | |
| 240 // 2 | [Constant Pool] | | | |
| 241 // |- - - - - - - - -| | | |
| 242 // 2+cp | Context | | if a constant pool | |
| 243 // |- - - - - - - - -| | is used, cp = 1, | |
| 244 // 3+cp | JSFunction | | otherwise, cp = 0 | |
| 245 // |- - - - - - - - -| | | |
| 246 // 4+cp | argc | v | |
| 247 // +-----------------+---- | |
| 248 // 5+cp | | ^ Callee |
| 249 // |- - - - - - - - -| | frame slots |
| 250 // ... | | Frame slots (slot >= 0) |
| 251 // |- - - - - - - - -| | | |
| 252 // | | v | |
| 253 // -----+-----------------+----- <-- stack ptr ------------- |
| 254 // |
| 255 class OptimizedBuiltinFrameConstants : public StandardFrameConstants { |
| 256 public: |
| 257 static const int kArgCSize = kPointerSize; |
| 258 static const int kArgCOffset = -3 * kPointerSize - kCPSlotSize; |
| 259 static const int kFixedFrameSize = kFixedFrameSizeAboveFp - kArgCOffset; |
| 260 static const int kFixedSlotCount = kFixedFrameSize / kPointerSize; |
| 261 }; |
| 262 |
221 // TypedFrames have a SMI type maker value below the saved FP/constant pool to | 263 // TypedFrames have a SMI type maker value below the saved FP/constant pool to |
222 // distinguish them from StandardFrames, which have a context in that position | 264 // distinguish them from StandardFrames, which have a context in that position |
223 // instead. | 265 // instead. |
224 // | 266 // |
225 // slot JS frame | 267 // slot JS frame |
226 // +-----------------+-------------------------------- | 268 // +-----------------+-------------------------------- |
227 // -n-1 | parameter 0 | ^ | 269 // -n-1 | parameter 0 | ^ |
228 // |- - - - - - - - -| | | 270 // |- - - - - - - - -| | |
229 // -n | | Caller | 271 // -n | | Caller |
230 // ... | ... | frame slots | 272 // ... | ... | frame slots |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 void Summarize( | 976 void Summarize( |
935 List<FrameSummary>* frames, | 977 List<FrameSummary>* frames, |
936 FrameSummary::Mode mode = FrameSummary::kExactSummary) const override; | 978 FrameSummary::Mode mode = FrameSummary::kExactSummary) const override; |
937 | 979 |
938 // Lookup exception handler for current {pc}, returns -1 if none found. | 980 // Lookup exception handler for current {pc}, returns -1 if none found. |
939 int LookupExceptionHandlerInTable( | 981 int LookupExceptionHandlerInTable( |
940 int* data, HandlerTable::CatchPrediction* prediction) override; | 982 int* data, HandlerTable::CatchPrediction* prediction) override; |
941 | 983 |
942 DeoptimizationInputData* GetDeoptimizationData(int* deopt_index) const; | 984 DeoptimizationInputData* GetDeoptimizationData(int* deopt_index) const; |
943 | 985 |
| 986 Object* receiver() const override; |
| 987 |
944 static int StackSlotOffsetRelativeToFp(int slot_index); | 988 static int StackSlotOffsetRelativeToFp(int slot_index); |
945 | 989 |
946 protected: | 990 protected: |
947 inline explicit OptimizedFrame(StackFrameIteratorBase* iterator); | 991 inline explicit OptimizedFrame(StackFrameIteratorBase* iterator); |
948 | 992 |
949 private: | 993 private: |
950 friend class StackFrameIteratorBase; | 994 friend class StackFrameIteratorBase; |
951 | 995 |
952 Object* StackSlotAt(int index) const; | 996 Object* StackSlotAt(int index) const; |
953 }; | 997 }; |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 | 1371 |
1328 | 1372 |
1329 // Reads all frames on the current stack and copies them into the current | 1373 // Reads all frames on the current stack and copies them into the current |
1330 // zone memory. | 1374 // zone memory. |
1331 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 1375 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
1332 | 1376 |
1333 } // namespace internal | 1377 } // namespace internal |
1334 } // namespace v8 | 1378 } // namespace v8 |
1335 | 1379 |
1336 #endif // V8_FRAMES_H_ | 1380 #endif // V8_FRAMES_H_ |
OLD | NEW |