OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/regexp/ppc/regexp-macro-assembler-ppc.h" | 7 #include "src/regexp/ppc/regexp-macro-assembler-ppc.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 __ LoadP(r3, MemOperand(backtrack_stackpointer(), 0)); | 218 __ LoadP(r3, MemOperand(backtrack_stackpointer(), 0)); |
219 __ cmp(current_input_offset(), r3); | 219 __ cmp(current_input_offset(), r3); |
220 __ bne(&backtrack_non_equal); | 220 __ bne(&backtrack_non_equal); |
221 __ addi(backtrack_stackpointer(), backtrack_stackpointer(), | 221 __ addi(backtrack_stackpointer(), backtrack_stackpointer(), |
222 Operand(kPointerSize)); | 222 Operand(kPointerSize)); |
223 | 223 |
224 __ bind(&backtrack_non_equal); | 224 __ bind(&backtrack_non_equal); |
225 BranchOrBacktrack(eq, on_equal); | 225 BranchOrBacktrack(eq, on_equal); |
226 } | 226 } |
227 | 227 |
228 | |
229 void RegExpMacroAssemblerPPC::CheckNotBackReferenceIgnoreCase( | 228 void RegExpMacroAssemblerPPC::CheckNotBackReferenceIgnoreCase( |
230 int start_reg, bool read_backward, Label* on_no_match) { | 229 int start_reg, bool read_backward, bool unicode, Label* on_no_match) { |
231 Label fallthrough; | 230 Label fallthrough; |
232 __ LoadP(r3, register_location(start_reg), r0); // Index of start of capture | 231 __ LoadP(r3, register_location(start_reg), r0); // Index of start of capture |
233 __ LoadP(r4, register_location(start_reg + 1), r0); // Index of end | 232 __ LoadP(r4, register_location(start_reg + 1), r0); // Index of end |
234 __ sub(r4, r4, r3, LeaveOE, SetRC); // Length of capture. | 233 __ sub(r4, r4, r3, LeaveOE, SetRC); // Length of capture. |
235 | 234 |
236 // At this point, the capture registers are either both set or both cleared. | 235 // At this point, the capture registers are either both set or both cleared. |
237 // If the capture length is zero, then the capture is either empty or cleared. | 236 // If the capture length is zero, then the capture is either empty or cleared. |
238 // Fall through in both cases. | 237 // Fall through in both cases. |
239 __ beq(&fallthrough, cr0); | 238 __ beq(&fallthrough, cr0); |
240 | 239 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 __ PrepareCallCFunction(argument_count, r5); | 314 __ PrepareCallCFunction(argument_count, r5); |
316 | 315 |
317 // r3 - offset of start of capture | 316 // r3 - offset of start of capture |
318 // r4 - length of capture | 317 // r4 - length of capture |
319 | 318 |
320 // Put arguments into arguments registers. | 319 // Put arguments into arguments registers. |
321 // Parameters are | 320 // Parameters are |
322 // r3: Address byte_offset1 - Address captured substring's start. | 321 // r3: Address byte_offset1 - Address captured substring's start. |
323 // r4: Address byte_offset2 - Address of current character position. | 322 // r4: Address byte_offset2 - Address of current character position. |
324 // r5: size_t byte_length - length of capture in bytes(!) | 323 // r5: size_t byte_length - length of capture in bytes(!) |
325 // r6: Isolate* isolate | 324 // r6: Isolate* isolate or 0 if unicode flag. |
326 | 325 |
327 // Address of start of capture. | 326 // Address of start of capture. |
328 __ add(r3, r3, end_of_input_address()); | 327 __ add(r3, r3, end_of_input_address()); |
329 // Length of capture. | 328 // Length of capture. |
330 __ mr(r5, r4); | 329 __ mr(r5, r4); |
331 // Save length in callee-save register for use on return. | 330 // Save length in callee-save register for use on return. |
332 __ mr(r25, r4); | 331 __ mr(r25, r4); |
333 // Address of current input position. | 332 // Address of current input position. |
334 __ add(r4, current_input_offset(), end_of_input_address()); | 333 __ add(r4, current_input_offset(), end_of_input_address()); |
335 if (read_backward) { | 334 if (read_backward) { |
336 __ sub(r4, r4, r25); | 335 __ sub(r4, r4, r25); |
337 } | 336 } |
338 // Isolate. | 337 // Isolate. |
339 __ mov(r6, Operand(ExternalReference::isolate_address(isolate()))); | 338 #ifdef V8_I18N_SUPPORT |
| 339 if (unicode) { |
| 340 __ li(r6, Operand::Zero()); |
| 341 } else // NOLINT |
| 342 #endif // V8_I18N_SUPPORT |
| 343 { |
| 344 __ mov(r6, Operand(ExternalReference::isolate_address(isolate()))); |
| 345 } |
340 | 346 |
341 { | 347 { |
342 AllowExternalCallThatCantCauseGC scope(masm_); | 348 AllowExternalCallThatCantCauseGC scope(masm_); |
343 ExternalReference function = | 349 ExternalReference function = |
344 ExternalReference::re_case_insensitive_compare_uc16(isolate()); | 350 ExternalReference::re_case_insensitive_compare_uc16(isolate()); |
345 __ CallCFunction(function, argument_count); | 351 __ CallCFunction(function, argument_count); |
346 } | 352 } |
347 | 353 |
348 // Check if function returned non-zero for success or zero for failure. | 354 // Check if function returned non-zero for success or zero for failure. |
349 __ cmpi(r3, Operand::Zero()); | 355 __ cmpi(r3, Operand::Zero()); |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 } | 1295 } |
1290 | 1296 |
1291 | 1297 |
1292 #undef __ | 1298 #undef __ |
1293 | 1299 |
1294 #endif // V8_INTERPRETED_REGEXP | 1300 #endif // V8_INTERPRETED_REGEXP |
1295 } // namespace internal | 1301 } // namespace internal |
1296 } // namespace v8 | 1302 } // namespace v8 |
1297 | 1303 |
1298 #endif // V8_TARGET_ARCH_PPC | 1304 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |