OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
6 | 6 |
7 #include "src/regexp/ia32/regexp-macro-assembler-ia32.h" | 7 #include "src/regexp/ia32/regexp-macro-assembler-ia32.h" |
8 | 8 |
9 #include "src/log.h" | 9 #include "src/log.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 Label fallthrough; | 182 Label fallthrough; |
183 __ cmp(edi, Operand(backtrack_stackpointer(), 0)); | 183 __ cmp(edi, Operand(backtrack_stackpointer(), 0)); |
184 __ j(not_equal, &fallthrough); | 184 __ j(not_equal, &fallthrough); |
185 __ add(backtrack_stackpointer(), Immediate(kPointerSize)); // Pop. | 185 __ add(backtrack_stackpointer(), Immediate(kPointerSize)); // Pop. |
186 BranchOrBacktrack(no_condition, on_equal); | 186 BranchOrBacktrack(no_condition, on_equal); |
187 __ bind(&fallthrough); | 187 __ bind(&fallthrough); |
188 } | 188 } |
189 | 189 |
190 | 190 |
191 void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase( | 191 void RegExpMacroAssemblerIA32::CheckNotBackReferenceIgnoreCase( |
192 int start_reg, bool read_backward, Label* on_no_match) { | 192 int start_reg, bool read_backward, bool unicode, Label* on_no_match) { |
193 Label fallthrough; | 193 Label fallthrough; |
194 __ mov(edx, register_location(start_reg)); // Index of start of capture | 194 __ mov(edx, register_location(start_reg)); // Index of start of capture |
195 __ mov(ebx, register_location(start_reg + 1)); // Index of end of capture | 195 __ mov(ebx, register_location(start_reg + 1)); // Index of end of capture |
196 __ sub(ebx, edx); // Length of capture. | 196 __ sub(ebx, edx); // Length of capture. |
197 | 197 |
198 // At this point, the capture registers are either both set or both cleared. | 198 // At this point, the capture registers are either both set or both cleared. |
199 // If the capture length is zero, then the capture is either empty or cleared. | 199 // If the capture length is zero, then the capture is either empty or cleared. |
200 // Fall through in both cases. | 200 // Fall through in both cases. |
201 __ j(equal, &fallthrough); | 201 __ j(equal, &fallthrough); |
202 | 202 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 __ push(backtrack_stackpointer()); | 289 __ push(backtrack_stackpointer()); |
290 __ push(ebx); | 290 __ push(ebx); |
291 | 291 |
292 static const int argument_count = 4; | 292 static const int argument_count = 4; |
293 __ PrepareCallCFunction(argument_count, ecx); | 293 __ PrepareCallCFunction(argument_count, ecx); |
294 // Put arguments into allocated stack area, last argument highest on stack. | 294 // Put arguments into allocated stack area, last argument highest on stack. |
295 // Parameters are | 295 // Parameters are |
296 // Address byte_offset1 - Address captured substring's start. | 296 // Address byte_offset1 - Address captured substring's start. |
297 // Address byte_offset2 - Address of current character position. | 297 // Address byte_offset2 - Address of current character position. |
298 // size_t byte_length - length of capture in bytes(!) | 298 // size_t byte_length - length of capture in bytes(!) |
299 // Isolate* isolate | 299 // Isolate* isolate or 0 if unicode flag. |
300 | 300 |
301 // Set isolate. | 301 // Set isolate. |
302 __ mov(Operand(esp, 3 * kPointerSize), | 302 #ifdef V8_I18N_SUPPORT |
303 Immediate(ExternalReference::isolate_address(isolate()))); | 303 if (unicode) { |
| 304 __ mov(Operand(esp, 3 * kPointerSize), Immediate(0)); |
| 305 } else // NOLINT |
| 306 #endif // V8_I18N_SUPPORT |
| 307 { |
| 308 __ mov(Operand(esp, 3 * kPointerSize), |
| 309 Immediate(ExternalReference::isolate_address(isolate()))); |
| 310 } |
304 // Set byte_length. | 311 // Set byte_length. |
305 __ mov(Operand(esp, 2 * kPointerSize), ebx); | 312 __ mov(Operand(esp, 2 * kPointerSize), ebx); |
306 // Set byte_offset2. | 313 // Set byte_offset2. |
307 // Found by adding negative string-end offset of current position (edi) | 314 // Found by adding negative string-end offset of current position (edi) |
308 // to end of string. | 315 // to end of string. |
309 __ add(edi, esi); | 316 __ add(edi, esi); |
310 if (read_backward) { | 317 if (read_backward) { |
311 __ sub(edi, ebx); // Offset by length when matching backwards. | 318 __ sub(edi, ebx); // Offset by length when matching backwards. |
312 } | 319 } |
313 __ mov(Operand(esp, 1 * kPointerSize), edi); | 320 __ mov(Operand(esp, 1 * kPointerSize), edi); |
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 | 1261 |
1255 | 1262 |
1256 #undef __ | 1263 #undef __ |
1257 | 1264 |
1258 #endif // V8_INTERPRETED_REGEXP | 1265 #endif // V8_INTERPRETED_REGEXP |
1259 | 1266 |
1260 } // namespace internal | 1267 } // namespace internal |
1261 } // namespace v8 | 1268 } // namespace v8 |
1262 | 1269 |
1263 #endif // V8_TARGET_ARCH_IA32 | 1270 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |