OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/cpu-profiler.h" | 10 #include "src/cpu-profiler.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 __ Mov(x3, ExternalReference::isolate_address(isolate())); | 390 __ Mov(x3, ExternalReference::isolate_address(isolate())); |
391 | 391 |
392 { | 392 { |
393 AllowExternalCallThatCantCauseGC scope(masm_); | 393 AllowExternalCallThatCantCauseGC scope(masm_); |
394 ExternalReference function = | 394 ExternalReference function = |
395 ExternalReference::re_case_insensitive_compare_uc16(isolate()); | 395 ExternalReference::re_case_insensitive_compare_uc16(isolate()); |
396 __ CallCFunction(function, argument_count); | 396 __ CallCFunction(function, argument_count); |
397 } | 397 } |
398 | 398 |
399 // Check if function returned non-zero for success or zero for failure. | 399 // Check if function returned non-zero for success or zero for failure. |
400 CompareAndBranchOrBacktrack(x0, 0, eq, on_no_match); | 400 // x0 is one of the registers used as a cache so it must be tested before |
| 401 // the cache is restored. |
| 402 __ Cmp(x0, 0); |
| 403 __ PopCPURegList(cached_registers); |
| 404 BranchOrBacktrack(eq, on_no_match); |
| 405 |
401 // On success, increment position by length of capture. | 406 // On success, increment position by length of capture. |
402 __ Add(current_input_offset(), current_input_offset(), capture_length); | 407 __ Add(current_input_offset(), current_input_offset(), capture_length); |
403 // Reset the cached registers. | |
404 __ PopCPURegList(cached_registers); | |
405 } | 408 } |
406 | 409 |
407 __ Bind(&fallthrough); | 410 __ Bind(&fallthrough); |
408 } | 411 } |
409 | 412 |
410 void RegExpMacroAssemblerARM64::CheckNotBackReference( | 413 void RegExpMacroAssemblerARM64::CheckNotBackReference( |
411 int start_reg, | 414 int start_reg, |
412 Label* on_no_match) { | 415 Label* on_no_match) { |
413 Label fallthrough; | 416 Label fallthrough; |
414 | 417 |
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 __ Ldrh(current_character(), MemOperand(input_end(), offset, SXTW)); | 1693 __ Ldrh(current_character(), MemOperand(input_end(), offset, SXTW)); |
1691 } | 1694 } |
1692 } | 1695 } |
1693 } | 1696 } |
1694 | 1697 |
1695 #endif // V8_INTERPRETED_REGEXP | 1698 #endif // V8_INTERPRETED_REGEXP |
1696 | 1699 |
1697 }} // namespace v8::internal | 1700 }} // namespace v8::internal |
1698 | 1701 |
1699 #endif // V8_TARGET_ARCH_ARM64 | 1702 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |