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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 // Behaves like an exit frame but with target and new target args. | 327 // Behaves like an exit frame but with target and new target args. |
328 class BuiltinExitFrameConstants : public CommonFrameConstants { | 328 class BuiltinExitFrameConstants : public CommonFrameConstants { |
329 public: | 329 public: |
330 static const int kNewTargetOffset = kCallerPCOffset + 1 * kPointerSize; | 330 static const int kNewTargetOffset = kCallerPCOffset + 1 * kPointerSize; |
331 static const int kTargetOffset = kNewTargetOffset + 1 * kPointerSize; | 331 static const int kTargetOffset = kNewTargetOffset + 1 * kPointerSize; |
332 static const int kArgcOffset = kTargetOffset + 1 * kPointerSize; | 332 static const int kArgcOffset = kTargetOffset + 1 * kPointerSize; |
333 }; | 333 }; |
334 | 334 |
335 class InterpreterFrameConstants : public AllStatic { | 335 class InterpreterFrameConstants : public AllStatic { |
336 public: | 336 public: |
337 // Fixed frame includes new.target and bytecode offset. | 337 // Fixed frame includes new.target, bytecode array, and bytecode offset. |
338 static const int kFixedFrameSize = | 338 static const int kFixedFrameSize = |
339 StandardFrameConstants::kFixedFrameSize + 3 * kPointerSize; | 339 StandardFrameConstants::kFixedFrameSize + 3 * kPointerSize; |
340 static const int kFixedFrameSizeFromFp = | 340 static const int kFixedFrameSizeFromFp = |
341 StandardFrameConstants::kFixedFrameSizeFromFp + 3 * kPointerSize; | 341 StandardFrameConstants::kFixedFrameSizeFromFp + 3 * kPointerSize; |
342 | 342 |
343 // FP-relative. | 343 // FP-relative. |
344 static const int kLastParamFromFp = StandardFrameConstants::kCallerSPOffset; | 344 static const int kLastParamFromFp = StandardFrameConstants::kCallerSPOffset; |
345 static const int kCallerPCOffsetFromFp = | 345 static const int kCallerPCOffsetFromFp = |
346 StandardFrameConstants::kCallerPCOffset; | 346 StandardFrameConstants::kCallerPCOffset; |
347 static const int kNewTargetFromFp = | 347 static const int kNewTargetFromFp = |
348 -StandardFrameConstants::kFixedFrameSizeFromFp - 1 * kPointerSize; | 348 -StandardFrameConstants::kFixedFrameSizeFromFp - 1 * kPointerSize; |
349 static const int kBytecodeArrayFromFp = | 349 static const int kBytecodeArrayFromFp = |
350 -StandardFrameConstants::kFixedFrameSizeFromFp - 2 * kPointerSize; | 350 -StandardFrameConstants::kFixedFrameSizeFromFp - 2 * kPointerSize; |
351 static const int kBytecodeOffsetFromFp = | 351 static const int kBytecodeOffsetFromFp = |
352 -StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize; | 352 -StandardFrameConstants::kFixedFrameSizeFromFp - 3 * kPointerSize; |
353 static const int kRegisterFileFromFp = | 353 static const int kRegisterFileFromFp = |
354 -StandardFrameConstants::kFixedFrameSizeFromFp - 4 * kPointerSize; | 354 -StandardFrameConstants::kFixedFrameSizeFromFp - 4 * kPointerSize; |
355 | 355 |
356 static const int kExpressionsOffset = kRegisterFileFromFp; | 356 static const int kExpressionsOffset = kRegisterFileFromFp; |
357 | 357 |
| 358 // Number of fixed slots in addition to a {StandardFrame}. |
| 359 static const int kExtraSlotCount = |
| 360 InterpreterFrameConstants::kFixedFrameSize / kPointerSize - |
| 361 StandardFrameConstants::kFixedFrameSize / kPointerSize; |
| 362 |
358 // Expression index for {StandardFrame::GetExpressionAddress}. | 363 // Expression index for {StandardFrame::GetExpressionAddress}. |
359 static const int kBytecodeArrayExpressionIndex = -2; | 364 static const int kBytecodeArrayExpressionIndex = -2; |
360 static const int kBytecodeOffsetExpressionIndex = -1; | 365 static const int kBytecodeOffsetExpressionIndex = -1; |
361 static const int kRegisterFileExpressionIndex = 0; | 366 static const int kRegisterFileExpressionIndex = 0; |
362 }; | 367 }; |
363 | 368 |
364 inline static int FPOffsetToFrameSlot(int frame_offset) { | 369 inline static int FPOffsetToFrameSlot(int frame_offset) { |
365 return StandardFrameConstants::kFixedSlotCountAboveFp - 1 - | 370 return StandardFrameConstants::kFixedSlotCountAboveFp - 1 - |
366 frame_offset / kPointerSize; | 371 frame_offset / kPointerSize; |
367 } | 372 } |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 | 1318 |
1314 | 1319 |
1315 // Reads all frames on the current stack and copies them into the current | 1320 // Reads all frames on the current stack and copies them into the current |
1316 // zone memory. | 1321 // zone memory. |
1317 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 1322 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
1318 | 1323 |
1319 } // namespace internal | 1324 } // namespace internal |
1320 } // namespace v8 | 1325 } // namespace v8 |
1321 | 1326 |
1322 #endif // V8_FRAMES_H_ | 1327 #endif // V8_FRAMES_H_ |
OLD | NEW |