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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/regexp/arm64/regexp-macro-assembler-arm64.h" | 7 #include "src/regexp/arm64/regexp-macro-assembler-arm64.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 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 __ Str(output_size, MemOperand(frame_pointer(), kOutputSize)); | 991 __ Str(output_size, MemOperand(frame_pointer(), kOutputSize)); |
992 | 992 |
993 if (global_with_zero_length_check()) { | 993 if (global_with_zero_length_check()) { |
994 // Special case for zero-length matches. | 994 // Special case for zero-length matches. |
995 __ Cmp(current_input_offset(), first_capture_start); | 995 __ Cmp(current_input_offset(), first_capture_start); |
996 // Not a zero-length match, restart. | 996 // Not a zero-length match, restart. |
997 __ B(ne, &load_char_start_regexp); | 997 __ B(ne, &load_char_start_regexp); |
998 // Offset from the end is zero if we already reached the end. | 998 // Offset from the end is zero if we already reached the end. |
999 __ Cbz(current_input_offset(), &return_w0); | 999 __ Cbz(current_input_offset(), &return_w0); |
1000 // Advance current position after a zero-length match. | 1000 // Advance current position after a zero-length match. |
| 1001 Label advance; |
| 1002 __ bind(&advance); |
1001 __ Add(current_input_offset(), | 1003 __ Add(current_input_offset(), |
1002 current_input_offset(), | 1004 current_input_offset(), |
1003 Operand((mode_ == UC16) ? 2 : 1)); | 1005 Operand((mode_ == UC16) ? 2 : 1)); |
| 1006 if (global_unicode()) CheckNotInSurrogatePair(0, &advance); |
1004 } | 1007 } |
1005 | 1008 |
1006 __ B(&load_char_start_regexp); | 1009 __ B(&load_char_start_regexp); |
1007 } else { | 1010 } else { |
1008 __ Mov(w0, SUCCESS); | 1011 __ Mov(w0, SUCCESS); |
1009 } | 1012 } |
1010 } | 1013 } |
1011 | 1014 |
1012 if (exit_label_.is_linked()) { | 1015 if (exit_label_.is_linked()) { |
1013 // Exit and return w0 | 1016 // Exit and return w0 |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 } | 1661 } |
1659 } | 1662 } |
1660 } | 1663 } |
1661 | 1664 |
1662 #endif // V8_INTERPRETED_REGEXP | 1665 #endif // V8_INTERPRETED_REGEXP |
1663 | 1666 |
1664 } // namespace internal | 1667 } // namespace internal |
1665 } // namespace v8 | 1668 } // namespace v8 |
1666 | 1669 |
1667 #endif // V8_TARGET_ARCH_ARM64 | 1670 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |