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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // stack (before the return address) to spill parameter registers. We | 149 // stack (before the return address) to spill parameter registers. We |
150 // use this space to store the register passed parameters. | 150 // use this space to store the register passed parameters. |
151 static const int kInputString = kFrameAlign; | 151 static const int kInputString = kFrameAlign; |
152 // StartIndex is passed as 32 bit int. | 152 // StartIndex is passed as 32 bit int. |
153 static const int kStartIndex = kInputString + kPointerSize; | 153 static const int kStartIndex = kInputString + kPointerSize; |
154 static const int kInputStart = kStartIndex + kPointerSize; | 154 static const int kInputStart = kStartIndex + kPointerSize; |
155 static const int kInputEnd = kInputStart + kPointerSize; | 155 static const int kInputEnd = kInputStart + kPointerSize; |
156 static const int kRegisterOutput = kInputEnd + kPointerSize; | 156 static const int kRegisterOutput = kInputEnd + kPointerSize; |
157 // For the case of global regular expression, we have room to store at least | 157 // For the case of global regular expression, we have room to store at least |
158 // one set of capture results. For the case of non-global regexp, we ignore | 158 // one set of capture results. For the case of non-global regexp, we ignore |
159 // this value. | 159 // this value. NumOutputRegisters is passed as 32-bit value. The upper |
| 160 // 32 bit of this 64-bit stack slot may contain garbage. |
160 static const int kNumOutputRegisters = kRegisterOutput + kPointerSize; | 161 static const int kNumOutputRegisters = kRegisterOutput + kPointerSize; |
161 static const int kStackHighEnd = kNumOutputRegisters + kPointerSize; | 162 static const int kStackHighEnd = kNumOutputRegisters + kPointerSize; |
162 // DirectCall is passed as 32 bit int (values 0 or 1). | 163 // DirectCall is passed as 32 bit int (values 0 or 1). |
163 static const int kDirectCall = kStackHighEnd + kPointerSize; | 164 static const int kDirectCall = kStackHighEnd + kPointerSize; |
164 static const int kIsolate = kDirectCall + kPointerSize; | 165 static const int kIsolate = kDirectCall + kPointerSize; |
165 #else | 166 #else |
166 // In AMD64 ABI Calling Convention, the first six integer parameters | 167 // In AMD64 ABI Calling Convention, the first six integer parameters |
167 // are passed as registers, and caller must allocate space on the stack | 168 // are passed as registers, and caller must allocate space on the stack |
168 // if it wants them stored. We push the parameters after the frame pointer. | 169 // if it wants them stored. We push the parameters after the frame pointer. |
169 static const int kInputString = kFramePointer - kPointerSize; | 170 static const int kInputString = kFramePointer - kPointerSize; |
(...skipping 18 matching lines...) Expand all Loading... |
188 static const int kBackup_rbx = kBackup_rdi - kPointerSize; | 189 static const int kBackup_rbx = kBackup_rdi - kPointerSize; |
189 static const int kLastCalleeSaveRegister = kBackup_rbx; | 190 static const int kLastCalleeSaveRegister = kBackup_rbx; |
190 #else | 191 #else |
191 // AMD64 Calling Convention has only one callee-save register that | 192 // AMD64 Calling Convention has only one callee-save register that |
192 // we use. We push this after the frame pointer (and after the | 193 // we use. We push this after the frame pointer (and after the |
193 // parameters). | 194 // parameters). |
194 static const int kBackup_rbx = kNumOutputRegisters - kPointerSize; | 195 static const int kBackup_rbx = kNumOutputRegisters - kPointerSize; |
195 static const int kLastCalleeSaveRegister = kBackup_rbx; | 196 static const int kLastCalleeSaveRegister = kBackup_rbx; |
196 #endif | 197 #endif |
197 | 198 |
198 static const int kSuccessfulCaptures = kBackup_rbx - kPointerSize; | 199 static const int kSuccessfulCaptures = kLastCalleeSaveRegister - kPointerSize; |
199 // When adding local variables remember to push space for them in | 200 // When adding local variables remember to push space for them in |
200 // the frame in GetCode. | 201 // the frame in GetCode. |
201 static const int kInputStartMinusOne = kSuccessfulCaptures - kPointerSize; | 202 static const int kInputStartMinusOne = kSuccessfulCaptures - kPointerSize; |
202 | 203 |
203 // First register address. Following registers are below it on the stack. | 204 // First register address. Following registers are below it on the stack. |
204 static const int kRegisterZero = kInputStartMinusOne - kPointerSize; | 205 static const int kRegisterZero = kInputStartMinusOne - kPointerSize; |
205 | 206 |
206 // Initial size of code buffer. | 207 // Initial size of code buffer. |
207 static const size_t kRegExpCodeSize = 1024; | 208 static const size_t kRegExpCodeSize = 1024; |
208 | 209 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 Label exit_label_; | 296 Label exit_label_; |
296 Label check_preempt_label_; | 297 Label check_preempt_label_; |
297 Label stack_overflow_label_; | 298 Label stack_overflow_label_; |
298 }; | 299 }; |
299 | 300 |
300 #endif // V8_INTERPRETED_REGEXP | 301 #endif // V8_INTERPRETED_REGEXP |
301 | 302 |
302 }} // namespace v8::internal | 303 }} // namespace v8::internal |
303 | 304 |
304 #endif // V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_ | 305 #endif // V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |