v8  3.25.30(node0.11.13)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
frames-ia32.h
Go to the documentation of this file.
1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are
4 // met:
5 //
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided
11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 #ifndef V8_IA32_FRAMES_IA32_H_
29 #define V8_IA32_FRAMES_IA32_H_
30 
31 namespace v8 {
32 namespace internal {
33 
34 
35 // Register lists
36 // Note that the bit values must match those used in actual instruction encoding
37 const int kNumRegs = 8;
38 
39 
40 // Caller-saved registers
41 const RegList kJSCallerSaved =
42  1 << 0 | // eax
43  1 << 1 | // ecx
44  1 << 2 | // edx
45  1 << 3 | // ebx - used as a caller-saved register in JavaScript code
46  1 << 7; // edi - callee function
47 
48 const int kNumJSCallerSaved = 5;
49 
51 
52 
53 // Number of registers for which space is reserved in safepoints.
54 const int kNumSafepointRegisters = 8;
55 
56 const int kNoAlignmentPadding = 0;
58 const int kAlignmentZapValue = 0x12345678; // Not heap object tagged.
59 
60 // ----------------------------------------------------
61 
62 
63 class EntryFrameConstants : public AllStatic {
64  public:
65  static const int kCallerFPOffset = -6 * kPointerSize;
66 
67  static const int kFunctionArgOffset = +3 * kPointerSize;
68  static const int kReceiverArgOffset = +4 * kPointerSize;
69  static const int kArgcOffset = +5 * kPointerSize;
70  static const int kArgvOffset = +6 * kPointerSize;
71 };
72 
73 
74 class ExitFrameConstants : public AllStatic {
75  public:
76  static const int kFrameSize = 2 * kPointerSize;
77 
78  static const int kCodeOffset = -2 * kPointerSize;
79  static const int kSPOffset = -1 * kPointerSize;
80 
81  static const int kCallerFPOffset = 0 * kPointerSize;
82  static const int kCallerPCOffset = +1 * kPointerSize;
83 
84  // FP-relative displacement of the caller's SP. It points just
85  // below the saved PC.
86  static const int kCallerSPDisplacement = +2 * kPointerSize;
87 
88  static const int kConstantPoolOffset = 0; // Not used
89 };
90 
91 
92 class JavaScriptFrameConstants : public AllStatic {
93  public:
94  // FP-relative.
96  static const int kLastParameterOffset = +2 * kPointerSize;
98 
99  // Caller SP-relative.
100  static const int kParam0Offset = -2 * kPointerSize;
101  static const int kReceiverOffset = -1 * kPointerSize;
102 
104 };
105 
106 
108  public:
109  // FP-relative.
111 
112  static const int kFrameSize =
114 };
115 
116 
117 class ConstructFrameConstants : public AllStatic {
118  public:
119  // FP-relative.
120  static const int kImplicitReceiverOffset = -5 * kPointerSize;
121  static const int kConstructorOffset = kMinInt;
122  static const int kLengthOffset = -4 * kPointerSize;
124 
125  static const int kFrameSize =
127 };
128 
129 
130 class InternalFrameConstants : public AllStatic {
131  public:
132  // FP-relative.
134 };
135 
136 
137 inline Object* JavaScriptFrame::function_slot_object() const {
139  return Memory::Object_at(fp() + offset);
140 }
141 
142 
143 inline void StackHandler::SetFp(Address slot, Address fp) {
144  Memory::Address_at(slot) = fp;
145 }
146 
147 
148 } } // namespace v8::internal
149 
150 #endif // V8_IA32_FRAMES_IA32_H_
byte * Address
Definition: globals.h:186
const int kMinInt
Definition: globals.h:249
static const int kImplicitReceiverOffset
Definition: frames-arm.h:157
static Object *& Object_at(Address addr)
Definition: v8memory.h:83
Definition: frames-arm.h:103
static const int kFixedFrameSize
Definition: frames.h:181
kSerializedDataOffset Object
Definition: objects-inl.h:5016
uint32_t RegList
Definition: frames.h:41
const int kNoAlignmentPadding
Definition: frames-ia32.h:56
const RegList kJSCallerSaved
Definition: frames-arm.h:47
const int kAlignmentPaddingPushed
Definition: frames-ia32.h:57
static const int kCallerPCOffset
Definition: frames-arm.h:123
static const int kCallerFPOffset
Definition: frames-arm.h:121
const int kPointerSize
Definition: globals.h:268
static Address & Address_at(Address addr)
Definition: v8memory.h:79
static const int kDynamicAlignmentStateOffset
Definition: frames-ia32.h:103
const int kNumJSCallerSaved
Definition: frames-arm.h:53
const int kAlignmentZapValue
Definition: frames-ia32.h:58
static const int kMarkerOffset
Definition: frames.h:184
static const int kExpressionsOffset
Definition: frames.h:183
static const int kArgcOffset
Definition: frames-ia32.h:69
static const int kFunctionArgOffset
Definition: frames-ia32.h:67
static const int kCallerSPDisplacement
Definition: frames-arm.h:127
static const int kCallerFPOffset
Definition: frames-arm.h:105
const int kNumSafepointRegisters
Definition: frames-arm.h:92
static const int kReceiverArgOffset
Definition: frames-ia32.h:68
Object * JSCallerSavedBuffer[kNumJSCallerSaved]
Definition: frames-arm.h:55
static const int kArgvOffset
Definition: frames-ia32.h:70
const Register fp
const int kNumRegs
Definition: frames-arm.h:43
static const int kConstantPoolOffset
Definition: frames-arm.h:115