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
3 // found in the LICENSE file.
5 #ifndef V8_IA32_FRAMES_IA32_H_
6 #define V8_IA32_FRAMES_IA32_H_
13 // Note that the bit values must match those used in actual instruction encoding
14 const int kNumRegs = 8;
17 // Caller-saved registers
18 const RegList kJSCallerSaved =
22 1 << 3 | // ebx - used as a caller-saved register in JavaScript code
23 1 << 7; // edi - callee function
25 const int kNumJSCallerSaved = 5;
28 // Number of registers for which space is reserved in safepoints.
29 const int kNumSafepointRegisters = 8;
31 const int kNoAlignmentPadding = 0;
32 const int kAlignmentPaddingPushed = 2;
33 const int kAlignmentZapValue = 0x12345678; // Not heap object tagged.
35 // ----------------------------------------------------
38 class EntryFrameConstants : public AllStatic {
40 static const int kCallerFPOffset = -6 * kPointerSize;
42 static const int kFunctionArgOffset = +3 * kPointerSize;
43 static const int kReceiverArgOffset = +4 * kPointerSize;
44 static const int kArgcOffset = +5 * kPointerSize;
45 static const int kArgvOffset = +6 * kPointerSize;
49 class ExitFrameConstants : public AllStatic {
51 static const int kFrameSize = 2 * kPointerSize;
53 static const int kCodeOffset = -2 * kPointerSize;
54 static const int kSPOffset = -1 * kPointerSize;
56 static const int kCallerFPOffset = 0 * kPointerSize;
57 static const int kCallerPCOffset = +1 * kPointerSize;
59 // FP-relative displacement of the caller's SP. It points just
60 // below the saved PC.
61 static const int kCallerSPDisplacement = +2 * kPointerSize;
63 static const int kConstantPoolOffset = 0; // Not used
67 class JavaScriptFrameConstants : public AllStatic {
70 static const int kLocal0Offset = StandardFrameConstants::kExpressionsOffset;
71 static const int kLastParameterOffset = +2 * kPointerSize;
72 static const int kFunctionOffset = StandardFrameConstants::kMarkerOffset;
74 // Caller SP-relative.
75 static const int kParam0Offset = -2 * kPointerSize;
76 static const int kReceiverOffset = -1 * kPointerSize;
78 static const int kDynamicAlignmentStateOffset = kLocal0Offset;
82 inline Object* JavaScriptFrame::function_slot_object() const {
83 const int offset = JavaScriptFrameConstants::kFunctionOffset;
84 return Memory::Object_at(fp() + offset);
88 } } // namespace v8::internal
90 #endif // V8_IA32_FRAMES_IA32_H_