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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 317 |
318 class InterpreterFrameConstants : public AllStatic { | 318 class InterpreterFrameConstants : public AllStatic { |
319 public: | 319 public: |
320 // Fixed frame includes new.target and bytecode offset. | 320 // Fixed frame includes new.target and bytecode offset. |
321 static const int kFixedFrameSize = | 321 static const int kFixedFrameSize = |
322 StandardFrameConstants::kFixedFrameSize + 3 * kPointerSize; | 322 StandardFrameConstants::kFixedFrameSize + 3 * kPointerSize; |
323 static const int kFixedFrameSizeFromFp = | 323 static const int kFixedFrameSizeFromFp = |
324 StandardFrameConstants::kFixedFrameSizeFromFp + 3 * kPointerSize; | 324 StandardFrameConstants::kFixedFrameSizeFromFp + 3 * kPointerSize; |
325 | 325 |
326 // FP-relative. | 326 // FP-relative. |
| 327 static const int kLastParamFromFp = StandardFrameConstants::kCallerSPOffset; |
327 static const int kNewTargetFromFp = | 328 static const int kNewTargetFromFp = |
328 -StandardFrameConstants::kFixedFrameSizeFromFp - 1 * kPointerSize; | 329 -StandardFrameConstants::kFixedFrameSizeFromFp - 1 * kPointerSize; |
329 static const int kBytecodeArrayFromFp = | 330 static const int kBytecodeArrayFromFp = |
330 -StandardFrameConstants::kFixedFrameSizeFromFp - 2 * kPointerSize; | 331 -StandardFrameConstants::kFixedFrameSizeFromFp - 2 * kPointerSize; |
331 static const int kBytecodeOffsetFromFp = | 332 static const int kBytecodeOffsetFromFp = |
332 -StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize; | 333 -StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize; |
333 static const int kRegisterFilePointerFromFp = | 334 static const int kRegisterFileFromFp = |
334 -StandardFrameConstants::kFixedFrameSizeFromFp - 4 * kPointerSize; | 335 -StandardFrameConstants::kFixedFrameSizeFromFp - 4 * kPointerSize; |
335 | 336 |
336 static const int kExpressionsOffset = kRegisterFilePointerFromFp; | 337 static const int kExpressionsOffset = kRegisterFileFromFp; |
337 | 338 |
338 // Expression index for {StandardFrame::GetExpressionAddress}. | 339 // Expression index for {StandardFrame::GetExpressionAddress}. |
339 static const int kBytecodeArrayExpressionIndex = -2; | 340 static const int kBytecodeArrayExpressionIndex = -2; |
340 static const int kBytecodeOffsetExpressionIndex = -1; | 341 static const int kBytecodeOffsetExpressionIndex = -1; |
341 static const int kRegisterFileExpressionIndex = 0; | 342 static const int kRegisterFileExpressionIndex = 0; |
342 | |
343 // Register file pointer relative. | |
344 static const int kLastParamFromRegisterPointer = | |
345 StandardFrameConstants::kFixedFrameSize + 4 * kPointerSize; | |
346 | |
347 static const int kBytecodeOffsetFromRegisterPointer = 1 * kPointerSize; | |
348 static const int kBytecodeArrayFromRegisterPointer = 2 * kPointerSize; | |
349 static const int kNewTargetFromRegisterPointer = 3 * kPointerSize; | |
350 static const int kFunctionFromRegisterPointer = 4 * kPointerSize; | |
351 static const int kContextFromRegisterPointer = 5 * kPointerSize; | |
352 }; | 343 }; |
353 | 344 |
354 inline static int FPOffsetToFrameSlot(int frame_offset) { | 345 inline static int FPOffsetToFrameSlot(int frame_offset) { |
355 return StandardFrameConstants::kFixedSlotCountAboveFp - 1 - | 346 return StandardFrameConstants::kFixedSlotCountAboveFp - 1 - |
356 frame_offset / kPointerSize; | 347 frame_offset / kPointerSize; |
357 } | 348 } |
358 | 349 |
359 inline static int FrameSlotToFPOffset(int slot) { | 350 inline static int FrameSlotToFPOffset(int slot) { |
360 return (StandardFrameConstants::kFixedSlotCountAboveFp - 1 - slot) * | 351 return (StandardFrameConstants::kFixedSlotCountAboveFp - 1 - slot) * |
361 kPointerSize; | 352 kPointerSize; |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 | 1209 |
1219 | 1210 |
1220 // Reads all frames on the current stack and copies them into the current | 1211 // Reads all frames on the current stack and copies them into the current |
1221 // zone memory. | 1212 // zone memory. |
1222 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 1213 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
1223 | 1214 |
1224 } // namespace internal | 1215 } // namespace internal |
1225 } // namespace v8 | 1216 } // namespace v8 |
1226 | 1217 |
1227 #endif // V8_FRAMES_H_ | 1218 #endif // V8_FRAMES_H_ |
OLD | NEW |