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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 #include "src/regexp/mips64/regexp-macro-assembler-mips64.h" | 7 #include "src/regexp/mips64/regexp-macro-assembler-mips64.h" |
8 | 8 |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/log.h" | 10 #include "src/log.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 __ Branch(&backtrack_non_equal, ne, current_input_offset(), Operand(a0)); | 244 __ Branch(&backtrack_non_equal, ne, current_input_offset(), Operand(a0)); |
245 __ Daddu(backtrack_stackpointer(), | 245 __ Daddu(backtrack_stackpointer(), |
246 backtrack_stackpointer(), | 246 backtrack_stackpointer(), |
247 Operand(kIntSize)); | 247 Operand(kIntSize)); |
248 __ bind(&backtrack_non_equal); | 248 __ bind(&backtrack_non_equal); |
249 BranchOrBacktrack(on_equal, eq, current_input_offset(), Operand(a0)); | 249 BranchOrBacktrack(on_equal, eq, current_input_offset(), Operand(a0)); |
250 } | 250 } |
251 | 251 |
252 | 252 |
253 void RegExpMacroAssemblerMIPS::CheckNotBackReferenceIgnoreCase( | 253 void RegExpMacroAssemblerMIPS::CheckNotBackReferenceIgnoreCase( |
254 int start_reg, bool read_backward, Label* on_no_match) { | 254 int start_reg, bool read_backward, bool unicode, Label* on_no_match) { |
255 Label fallthrough; | 255 Label fallthrough; |
256 __ ld(a0, register_location(start_reg)); // Index of start of capture. | 256 __ ld(a0, register_location(start_reg)); // Index of start of capture. |
257 __ ld(a1, register_location(start_reg + 1)); // Index of end of capture. | 257 __ ld(a1, register_location(start_reg + 1)); // Index of end of capture. |
258 __ Dsubu(a1, a1, a0); // Length of capture. | 258 __ Dsubu(a1, a1, a0); // Length of capture. |
259 | 259 |
260 // At this point, the capture registers are either both set or both cleared. | 260 // At this point, the capture registers are either both set or both cleared. |
261 // If the capture length is zero, then the capture is either empty or cleared. | 261 // If the capture length is zero, then the capture is either empty or cleared. |
262 // Fall through in both cases. | 262 // Fall through in both cases. |
263 __ Branch(&fallthrough, eq, a1, Operand(zero_reg)); | 263 __ Branch(&fallthrough, eq, a1, Operand(zero_reg)); |
264 | 264 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 __ PrepareCallCFunction(argument_count, a2); | 339 __ PrepareCallCFunction(argument_count, a2); |
340 | 340 |
341 // a0 - offset of start of capture. | 341 // a0 - offset of start of capture. |
342 // a1 - length of capture. | 342 // a1 - length of capture. |
343 | 343 |
344 // Put arguments into arguments registers. | 344 // Put arguments into arguments registers. |
345 // Parameters are | 345 // Parameters are |
346 // a0: Address byte_offset1 - Address captured substring's start. | 346 // a0: Address byte_offset1 - Address captured substring's start. |
347 // a1: Address byte_offset2 - Address of current character position. | 347 // a1: Address byte_offset2 - Address of current character position. |
348 // a2: size_t byte_length - length of capture in bytes(!). | 348 // a2: size_t byte_length - length of capture in bytes(!). |
349 // a3: Isolate* isolate. | 349 // a3: Isolate* isolate or 0 if unicode flag. |
350 | 350 |
351 // Address of start of capture. | 351 // Address of start of capture. |
352 __ Daddu(a0, a0, Operand(end_of_input_address())); | 352 __ Daddu(a0, a0, Operand(end_of_input_address())); |
353 // Length of capture. | 353 // Length of capture. |
354 __ mov(a2, a1); | 354 __ mov(a2, a1); |
355 // Save length in callee-save register for use on return. | 355 // Save length in callee-save register for use on return. |
356 __ mov(s3, a1); | 356 __ mov(s3, a1); |
357 // Address of current input position. | 357 // Address of current input position. |
358 __ Daddu(a1, current_input_offset(), Operand(end_of_input_address())); | 358 __ Daddu(a1, current_input_offset(), Operand(end_of_input_address())); |
359 if (read_backward) { | 359 if (read_backward) { |
360 __ Dsubu(a1, a1, Operand(s3)); | 360 __ Dsubu(a1, a1, Operand(s3)); |
361 } | 361 } |
362 // Isolate. | 362 // Isolate. |
363 __ li(a3, Operand(ExternalReference::isolate_address(masm_->isolate()))); | 363 #ifdef V8_I18N_SUPPORT |
| 364 if (unicode) { |
| 365 __ li(a3, Operand(zero_reg)); |
| 366 } else // NOLINT |
| 367 #endif // V8_I18N_SUPPORT |
| 368 { |
| 369 __ li(a3, Operand(ExternalReference::isolate_address(masm_->isolate()))); |
| 370 } |
364 | 371 |
365 { | 372 { |
366 AllowExternalCallThatCantCauseGC scope(masm_); | 373 AllowExternalCallThatCantCauseGC scope(masm_); |
367 ExternalReference function = | 374 ExternalReference function = |
368 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate()); | 375 ExternalReference::re_case_insensitive_compare_uc16(masm_->isolate()); |
369 __ CallCFunction(function, argument_count); | 376 __ CallCFunction(function, argument_count); |
370 } | 377 } |
371 | 378 |
372 // Restore regexp engine registers. | 379 // Restore regexp engine registers. |
373 __ MultiPop(regexp_registers_to_retain); | 380 __ MultiPop(regexp_registers_to_retain); |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1320 } | 1327 } |
1321 | 1328 |
1322 #undef __ | 1329 #undef __ |
1323 | 1330 |
1324 #endif // V8_INTERPRETED_REGEXP | 1331 #endif // V8_INTERPRETED_REGEXP |
1325 | 1332 |
1326 } // namespace internal | 1333 } // namespace internal |
1327 } // namespace v8 | 1334 } // namespace v8 |
1328 | 1335 |
1329 #endif // V8_TARGET_ARCH_MIPS64 | 1336 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |