OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // If the code object is relocated, the return address is fixed before | 128 // If the code object is relocated, the return address is fixed before |
129 // returning. | 129 // returning. |
130 static int CheckStackGuardState(Address* return_address, | 130 static int CheckStackGuardState(Address* return_address, |
131 Code* re_code, | 131 Code* re_code, |
132 Address re_frame); | 132 Address re_frame); |
133 | 133 |
134 private: | 134 private: |
135 // Offsets from rbp of function parameters and stored registers. | 135 // Offsets from rbp of function parameters and stored registers. |
136 static const int kFramePointer = 0; | 136 static const int kFramePointer = 0; |
137 // Above the frame pointer - function parameters and return address. | 137 // Above the frame pointer - function parameters and return address. |
138 static const int kReturn_eip = kFramePointer + kPointerSize; | 138 static const int kReturn_eip = kFramePointer + kRegisterSize; |
139 static const int kFrameAlign = kReturn_eip + kPointerSize; | 139 static const int kFrameAlign = kReturn_eip + kRegisterSize; |
140 | 140 |
141 #ifdef _WIN64 | 141 #ifdef _WIN64 |
142 // Parameters (first four passed as registers, but with room on stack). | 142 // Parameters (first four passed as registers, but with room on stack). |
143 // In Microsoft 64-bit Calling Convention, there is room on the callers | 143 // In Microsoft 64-bit Calling Convention, there is room on the callers |
144 // stack (before the return address) to spill parameter registers. We | 144 // stack (before the return address) to spill parameter registers. We |
145 // use this space to store the register passed parameters. | 145 // use this space to store the register passed parameters. |
146 static const int kInputString = kFrameAlign; | 146 static const int kInputString = kFrameAlign; |
147 // StartIndex is passed as 32 bit int. | 147 // StartIndex is passed as 32 bit int. |
148 static const int kStartIndex = kInputString + kPointerSize; | 148 static const int kStartIndex = kInputString + kRegisterSize; |
149 static const int kInputStart = kStartIndex + kPointerSize; | 149 static const int kInputStart = kStartIndex + kRegisterSize; |
150 static const int kInputEnd = kInputStart + kPointerSize; | 150 static const int kInputEnd = kInputStart + kRegisterSize; |
151 static const int kRegisterOutput = kInputEnd + kPointerSize; | 151 static const int kRegisterOutput = kInputEnd + kRegisterSize; |
152 // For the case of global regular expression, we have room to store at least | 152 // For the case of global regular expression, we have room to store at least |
153 // one set of capture results. For the case of non-global regexp, we ignore | 153 // one set of capture results. For the case of non-global regexp, we ignore |
154 // this value. NumOutputRegisters is passed as 32-bit value. The upper | 154 // this value. NumOutputRegisters is passed as 32-bit value. The upper |
155 // 32 bit of this 64-bit stack slot may contain garbage. | 155 // 32 bit of this 64-bit stack slot may contain garbage. |
156 static const int kNumOutputRegisters = kRegisterOutput + kPointerSize; | 156 static const int kNumOutputRegisters = kRegisterOutput + kRegisterSize; |
157 static const int kStackHighEnd = kNumOutputRegisters + kPointerSize; | 157 static const int kStackHighEnd = kNumOutputRegisters + kRegisterSize; |
158 // DirectCall is passed as 32 bit int (values 0 or 1). | 158 // DirectCall is passed as 32 bit int (values 0 or 1). |
159 static const int kDirectCall = kStackHighEnd + kPointerSize; | 159 static const int kDirectCall = kStackHighEnd + kRegisterSize; |
160 static const int kIsolate = kDirectCall + kPointerSize; | 160 static const int kIsolate = kDirectCall + kRegisterSize; |
161 #else | 161 #else |
162 // In AMD64 ABI Calling Convention, the first six integer parameters | 162 // In AMD64 ABI Calling Convention, the first six integer parameters |
163 // are passed as registers, and caller must allocate space on the stack | 163 // are passed as registers, and caller must allocate space on the stack |
164 // if it wants them stored. We push the parameters after the frame pointer. | 164 // if it wants them stored. We push the parameters after the frame pointer. |
165 static const int kInputString = kFramePointer - kPointerSize; | 165 static const int kInputString = kFramePointer - kRegisterSize; |
166 static const int kStartIndex = kInputString - kPointerSize; | 166 static const int kStartIndex = kInputString - kRegisterSize; |
167 static const int kInputStart = kStartIndex - kPointerSize; | 167 static const int kInputStart = kStartIndex - kRegisterSize; |
168 static const int kInputEnd = kInputStart - kPointerSize; | 168 static const int kInputEnd = kInputStart - kRegisterSize; |
169 static const int kRegisterOutput = kInputEnd - kPointerSize; | 169 static const int kRegisterOutput = kInputEnd - kRegisterSize; |
| 170 |
170 // For the case of global regular expression, we have room to store at least | 171 // For the case of global regular expression, we have room to store at least |
171 // one set of capture results. For the case of non-global regexp, we ignore | 172 // one set of capture results. For the case of non-global regexp, we ignore |
172 // this value. | 173 // this value. |
173 static const int kNumOutputRegisters = kRegisterOutput - kPointerSize; | 174 static const int kNumOutputRegisters = kRegisterOutput - kRegisterSize; |
174 static const int kStackHighEnd = kFrameAlign; | 175 static const int kStackHighEnd = kFrameAlign; |
175 static const int kDirectCall = kStackHighEnd + kPointerSize; | 176 static const int kDirectCall = kStackHighEnd + kRegisterSize; |
176 static const int kIsolate = kDirectCall + kPointerSize; | 177 static const int kIsolate = kDirectCall + kRegisterSize; |
177 #endif | 178 #endif |
178 | 179 |
179 #ifdef _WIN64 | 180 #ifdef _WIN64 |
180 // Microsoft calling convention has three callee-saved registers | 181 // Microsoft calling convention has three callee-saved registers |
181 // (that we are using). We push these after the frame pointer. | 182 // (that we are using). We push these after the frame pointer. |
182 static const int kBackup_rsi = kFramePointer - kPointerSize; | 183 static const int kBackup_rsi = kFramePointer - kRegisterSize; |
183 static const int kBackup_rdi = kBackup_rsi - kPointerSize; | 184 static const int kBackup_rdi = kBackup_rsi - kRegisterSize; |
184 static const int kBackup_rbx = kBackup_rdi - kPointerSize; | 185 static const int kBackup_rbx = kBackup_rdi - kRegisterSize; |
185 static const int kLastCalleeSaveRegister = kBackup_rbx; | 186 static const int kLastCalleeSaveRegister = kBackup_rbx; |
186 #else | 187 #else |
187 // AMD64 Calling Convention has only one callee-save register that | 188 // AMD64 Calling Convention has only one callee-save register that |
188 // we use. We push this after the frame pointer (and after the | 189 // we use. We push this after the frame pointer (and after the |
189 // parameters). | 190 // parameters). |
190 static const int kBackup_rbx = kNumOutputRegisters - kPointerSize; | 191 static const int kBackup_rbx = kNumOutputRegisters - kRegisterSize; |
191 static const int kLastCalleeSaveRegister = kBackup_rbx; | 192 static const int kLastCalleeSaveRegister = kBackup_rbx; |
192 #endif | 193 #endif |
193 | 194 |
194 static const int kSuccessfulCaptures = kLastCalleeSaveRegister - kPointerSize; | 195 static const int kSuccessfulCaptures = kLastCalleeSaveRegister - kPointerSize; |
195 // When adding local variables remember to push space for them in | 196 // When adding local variables remember to push space for them in |
196 // the frame in GetCode. | 197 // the frame in GetCode. |
197 static const int kInputStartMinusOne = kSuccessfulCaptures - kPointerSize; | 198 static const int kInputStartMinusOne = kSuccessfulCaptures - kPointerSize; |
198 | 199 |
199 // First register address. Following registers are below it on the stack. | 200 // First register address. Following registers are below it on the stack. |
200 static const int kRegisterZero = kInputStartMinusOne - kPointerSize; | 201 static const int kRegisterZero = kInputStartMinusOne - kPointerSize; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 Label exit_label_; | 294 Label exit_label_; |
294 Label check_preempt_label_; | 295 Label check_preempt_label_; |
295 Label stack_overflow_label_; | 296 Label stack_overflow_label_; |
296 }; | 297 }; |
297 | 298 |
298 #endif // V8_INTERPRETED_REGEXP | 299 #endif // V8_INTERPRETED_REGEXP |
299 | 300 |
300 }} // namespace v8::internal | 301 }} // namespace v8::internal |
301 | 302 |
302 #endif // V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_ | 303 #endif // V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |