Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(418)

Side by Side Diff: src/x64/regexp-macro-assembler-x64.h

Issue 18014003: Add X32 port into V8 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 #ifndef V8_TARGET_ARCH_X32
138 static const int kReturn_eip = kFramePointer + kPointerSize; 139 static const int kReturn_eip = kFramePointer + kPointerSize;
139 static const int kFrameAlign = kReturn_eip + kPointerSize; 140 static const int kFrameAlign = kReturn_eip + kPointerSize;
141 #else
142 static const int kReturn_eip = kFramePointer + kHWRegSize;
143 static const int kFrameAlign = kReturn_eip + kHWRegSize;
144 #endif
140 145
141 #ifdef _WIN64 146 #ifdef _WIN64
142 // Parameters (first four passed as registers, but with room on stack). 147 // Parameters (first four passed as registers, but with room on stack).
143 // In Microsoft 64-bit Calling Convention, there is room on the callers 148 // In Microsoft 64-bit Calling Convention, there is room on the callers
144 // stack (before the return address) to spill parameter registers. We 149 // stack (before the return address) to spill parameter registers. We
145 // use this space to store the register passed parameters. 150 // use this space to store the register passed parameters.
146 static const int kInputString = kFrameAlign; 151 static const int kInputString = kFrameAlign;
147 // StartIndex is passed as 32 bit int. 152 // StartIndex is passed as 32 bit int.
148 static const int kStartIndex = kInputString + kPointerSize; 153 static const int kStartIndex = kInputString + kPointerSize;
149 static const int kInputStart = kStartIndex + kPointerSize; 154 static const int kInputStart = kStartIndex + kPointerSize;
150 static const int kInputEnd = kInputStart + kPointerSize; 155 static const int kInputEnd = kInputStart + kPointerSize;
151 static const int kRegisterOutput = kInputEnd + kPointerSize; 156 static const int kRegisterOutput = kInputEnd + kPointerSize;
152 // 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
153 // 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
154 // this value. NumOutputRegisters is passed as 32-bit value. The upper 159 // this value. NumOutputRegisters is passed as 32-bit value. The upper
155 // 32 bit of this 64-bit stack slot may contain garbage. 160 // 32 bit of this 64-bit stack slot may contain garbage.
156 static const int kNumOutputRegisters = kRegisterOutput + kPointerSize; 161 static const int kNumOutputRegisters = kRegisterOutput + kPointerSize;
157 static const int kStackHighEnd = kNumOutputRegisters + kPointerSize; 162 static const int kStackHighEnd = kNumOutputRegisters + kPointerSize;
158 // DirectCall is passed as 32 bit int (values 0 or 1). 163 // DirectCall is passed as 32 bit int (values 0 or 1).
159 static const int kDirectCall = kStackHighEnd + kPointerSize; 164 static const int kDirectCall = kStackHighEnd + kPointerSize;
160 static const int kIsolate = kDirectCall + kPointerSize; 165 static const int kIsolate = kDirectCall + kPointerSize;
161 #else 166 #else
162 // In AMD64 ABI Calling Convention, the first six integer parameters 167 // In AMD64 ABI Calling Convention, the first six integer parameters
163 // 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
164 // 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.
170 #ifndef V8_TARGET_ARCH_X32
165 static const int kInputString = kFramePointer - kPointerSize; 171 static const int kInputString = kFramePointer - kPointerSize;
166 static const int kStartIndex = kInputString - kPointerSize; 172 static const int kStartIndex = kInputString - kPointerSize;
167 static const int kInputStart = kStartIndex - kPointerSize; 173 static const int kInputStart = kStartIndex - kPointerSize;
168 static const int kInputEnd = kInputStart - kPointerSize; 174 static const int kInputEnd = kInputStart - kPointerSize;
169 static const int kRegisterOutput = kInputEnd - kPointerSize; 175 static const int kRegisterOutput = kInputEnd - kPointerSize;
176 #else
177 static const int kInputString = kFramePointer - kHWRegSize;
178 static const int kStartIndex = kInputString - kHWRegSize;
179 static const int kInputStart = kStartIndex - kHWRegSize;
180 static const int kInputEnd = kInputStart - kHWRegSize;
181 static const int kRegisterOutput = kInputEnd - kHWRegSize;
182 #endif
170 // For the case of global regular expression, we have room to store at least 183 // 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 184 // one set of capture results. For the case of non-global regexp, we ignore
172 // this value. 185 // this value.
186 #ifndef V8_TARGET_ARCH_X32
173 static const int kNumOutputRegisters = kRegisterOutput - kPointerSize; 187 static const int kNumOutputRegisters = kRegisterOutput - kPointerSize;
174 static const int kStackHighEnd = kFrameAlign; 188 static const int kStackHighEnd = kFrameAlign;
175 static const int kDirectCall = kStackHighEnd + kPointerSize; 189 static const int kDirectCall = kStackHighEnd + kPointerSize;
176 static const int kIsolate = kDirectCall + kPointerSize; 190 static const int kIsolate = kDirectCall + kPointerSize;
191 #else
192 static const int kNumOutputRegisters = kRegisterOutput - kHWRegSize;
193 static const int kStackHighEnd = kFrameAlign;
194 static const int kDirectCall = kStackHighEnd + kHWRegSize;
195 static const int kIsolate = kDirectCall + kHWRegSize;
196 #endif
177 #endif 197 #endif
178 198
179 #ifdef _WIN64 199 #ifdef _WIN64
180 // Microsoft calling convention has three callee-saved registers 200 // Microsoft calling convention has three callee-saved registers
181 // (that we are using). We push these after the frame pointer. 201 // (that we are using). We push these after the frame pointer.
182 static const int kBackup_rsi = kFramePointer - kPointerSize; 202 static const int kBackup_rsi = kFramePointer - kPointerSize;
183 static const int kBackup_rdi = kBackup_rsi - kPointerSize; 203 static const int kBackup_rdi = kBackup_rsi - kPointerSize;
184 static const int kBackup_rbx = kBackup_rdi - kPointerSize; 204 static const int kBackup_rbx = kBackup_rdi - kPointerSize;
185 static const int kLastCalleeSaveRegister = kBackup_rbx; 205 static const int kLastCalleeSaveRegister = kBackup_rbx;
186 #else 206 #else
187 // AMD64 Calling Convention has only one callee-save register that 207 // AMD64 Calling Convention has only one callee-save register that
188 // we use. We push this after the frame pointer (and after the 208 // we use. We push this after the frame pointer (and after the
189 // parameters). 209 // parameters).
210 #ifndef V8_TARGET_ARCH_X32
190 static const int kBackup_rbx = kNumOutputRegisters - kPointerSize; 211 static const int kBackup_rbx = kNumOutputRegisters - kPointerSize;
212 #else
213 static const int kBackup_rbx = kNumOutputRegisters - kHWRegSize;
214 #endif
191 static const int kLastCalleeSaveRegister = kBackup_rbx; 215 static const int kLastCalleeSaveRegister = kBackup_rbx;
192 #endif 216 #endif
193 217
194 static const int kSuccessfulCaptures = kLastCalleeSaveRegister - kPointerSize; 218 static const int kSuccessfulCaptures = kLastCalleeSaveRegister - kPointerSize;
195 // When adding local variables remember to push space for them in 219 // When adding local variables remember to push space for them in
196 // the frame in GetCode. 220 // the frame in GetCode.
197 static const int kInputStartMinusOne = kSuccessfulCaptures - kPointerSize; 221 static const int kInputStartMinusOne = kSuccessfulCaptures - kPointerSize;
198 222
199 // First register address. Following registers are below it on the stack. 223 // First register address. Following registers are below it on the stack.
200 static const int kRegisterZero = kInputStartMinusOne - kPointerSize; 224 static const int kRegisterZero = kInputStartMinusOne - kPointerSize;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 Label exit_label_; 317 Label exit_label_;
294 Label check_preempt_label_; 318 Label check_preempt_label_;
295 Label stack_overflow_label_; 319 Label stack_overflow_label_;
296 }; 320 };
297 321
298 #endif // V8_INTERPRETED_REGEXP 322 #endif // V8_INTERPRETED_REGEXP
299 323
300 }} // namespace v8::internal 324 }} // namespace v8::internal
301 325
302 #endif // V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_ 326 #endif // V8_X64_REGEXP_MACRO_ASSEMBLER_X64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698