OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // Parameters (first four passed as registers, but with room on stack). | 131 // Parameters (first four passed as registers, but with room on stack). |
132 // In Microsoft 64-bit Calling Convention, there is room on the callers | 132 // In Microsoft 64-bit Calling Convention, there is room on the callers |
133 // stack (before the return address) to spill parameter registers. We | 133 // stack (before the return address) to spill parameter registers. We |
134 // use this space to store the register passed parameters. | 134 // use this space to store the register passed parameters. |
135 static const int kInputString = kFrameAlign; | 135 static const int kInputString = kFrameAlign; |
136 // StartIndex is passed as 32 bit int. | 136 // StartIndex is passed as 32 bit int. |
137 static const int kStartIndex = kInputString + kPointerSize; | 137 static const int kStartIndex = kInputString + kPointerSize; |
138 static const int kInputStart = kStartIndex + kPointerSize; | 138 static const int kInputStart = kStartIndex + kPointerSize; |
139 static const int kInputEnd = kInputStart + kPointerSize; | 139 static const int kInputEnd = kInputStart + kPointerSize; |
140 static const int kRegisterOutput = kInputEnd + kPointerSize; | 140 static const int kRegisterOutput = kInputEnd + kPointerSize; |
141 // AtStart is passed as 32 bit int (values 0 or 1). | 141 static const int kStackHighEnd = kRegisterOutput + kPointerSize; |
142 static const int kAtStart = kRegisterOutput + kPointerSize; | |
143 static const int kStackHighEnd = kAtStart + kPointerSize; | |
144 // DirectCall is passed as 32 bit int (values 0 or 1). | 142 // DirectCall is passed as 32 bit int (values 0 or 1). |
145 static const int kDirectCall = kStackHighEnd + kPointerSize; | 143 static const int kDirectCall = kStackHighEnd + kPointerSize; |
146 #else | 144 #else |
147 // In AMD64 ABI Calling Convention, the first six integer parameters | 145 // In AMD64 ABI Calling Convention, the first six integer parameters |
148 // are passed as registers, and caller must allocate space on the stack | 146 // are passed as registers, and caller must allocate space on the stack |
149 // if it wants them stored. We push the parameters after the frame pointer. | 147 // if it wants them stored. We push the parameters after the frame pointer. |
150 static const int kInputString = kFramePointer - kPointerSize; | 148 static const int kInputString = kFramePointer - kPointerSize; |
151 static const int kStartIndex = kInputString - kPointerSize; | 149 static const int kStartIndex = kInputString - kPointerSize; |
152 static const int kInputStart = kStartIndex - kPointerSize; | 150 static const int kInputStart = kStartIndex - kPointerSize; |
153 static const int kInputEnd = kInputStart - kPointerSize; | 151 static const int kInputEnd = kInputStart - kPointerSize; |
154 static const int kRegisterOutput = kInputEnd - kPointerSize; | 152 static const int kRegisterOutput = kInputEnd - kPointerSize; |
155 static const int kAtStart = kRegisterOutput - kPointerSize; | 153 static const int kStackHighEnd = kRegisterOutput - kPointerSize; |
156 static const int kStackHighEnd = kFrameAlign; | 154 static const int kDirectCall = kFrameAlign; |
157 static const int kDirectCall = kStackHighEnd + kPointerSize; | |
158 #endif | 155 #endif |
159 | 156 |
160 #ifdef _WIN64 | 157 #ifdef _WIN64 |
161 // Microsoft calling convention has three callee-saved registers | 158 // Microsoft calling convention has three callee-saved registers |
162 // (that we are using). We push these after the frame pointer. | 159 // (that we are using). We push these after the frame pointer. |
163 static const int kBackup_rsi = kFramePointer - kPointerSize; | 160 static const int kBackup_rsi = kFramePointer - kPointerSize; |
164 static const int kBackup_rdi = kBackup_rsi - kPointerSize; | 161 static const int kBackup_rdi = kBackup_rsi - kPointerSize; |
165 static const int kBackup_rbx = kBackup_rdi - kPointerSize; | 162 static const int kBackup_rbx = kBackup_rdi - kPointerSize; |
166 static const int kLastCalleeSaveRegister = kBackup_rbx; | 163 static const int kLastCalleeSaveRegister = kBackup_rbx; |
167 #else | 164 #else |
168 // AMD64 Calling Convention has only one callee-save register that | 165 // AMD64 Calling Convention has only one callee-save register that |
169 // we use. We push this after the frame pointer (and after the | 166 // we use. We push this after the frame pointer (and after the |
170 // parameters). | 167 // parameters). |
171 static const int kBackup_rbx = kAtStart - kPointerSize; | 168 static const int kBackup_rbx = kStackHighEnd - kPointerSize; |
172 static const int kLastCalleeSaveRegister = kBackup_rbx; | 169 static const int kLastCalleeSaveRegister = kBackup_rbx; |
173 #endif | 170 #endif |
174 | 171 |
175 // When adding local variables remember to push space for them in | 172 // When adding local variables remember to push space for them in |
176 // the frame in GetCode. | 173 // the frame in GetCode. |
177 static const int kInputStartMinusOne = | 174 static const int kInputStartMinusOne = |
178 kLastCalleeSaveRegister - kPointerSize; | 175 kLastCalleeSaveRegister - kPointerSize; |
| 176 static const int kAtStart = kInputStartMinusOne - kPointerSize; |
179 | 177 |
180 // First register address. Following registers are below it on the stack. | 178 // First register address. Following registers are below it on the stack. |
181 static const int kRegisterZero = kInputStartMinusOne - kPointerSize; | 179 static const int kRegisterZero = kAtStart - kPointerSize; |
182 | 180 |
183 // Initial size of code buffer. | 181 // Initial size of code buffer. |
184 static const size_t kRegExpCodeSize = 1024; | 182 static const size_t kRegExpCodeSize = 1024; |
185 | 183 |
186 // Load a number of characters at the given offset from the | 184 // Load a number of characters at the given offset from the |
187 // current position, into the current-character register. | 185 // current position, into the current-character register. |
188 void LoadCurrentCharacterUnchecked(int cp_offset, int character_count); | 186 void LoadCurrentCharacterUnchecked(int cp_offset, int character_count); |
189 | 187 |
190 // Check whether preemption has been requested. | 188 // Check whether preemption has been requested. |
191 void CheckPreemption(); | 189 void CheckPreemption(); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 Label exit_label_; | 284 Label exit_label_; |
287 Label check_preempt_label_; | 285 Label check_preempt_label_; |
288 Label stack_overflow_label_; | 286 Label stack_overflow_label_; |
289 }; | 287 }; |
290 | 288 |
291 #endif // V8_NATIVE_REGEXP | 289 #endif // V8_NATIVE_REGEXP |
292 | 290 |
293 }} // namespace v8::internal | 291 }} // namespace v8::internal |
294 | 292 |
295 #endif // V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_ | 293 #endif // V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_ |
OLD | NEW |