Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: src/regexp/arm64/regexp-macro-assembler-arm64.cc

Issue 1630633002: [regexp] correctly advance zero length matches for global/unicode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@backrefbounds
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 __ Str(output_size, MemOperand(frame_pointer(), kOutputSize)); 984 __ Str(output_size, MemOperand(frame_pointer(), kOutputSize));
985 985
986 if (global_with_zero_length_check()) { 986 if (global_with_zero_length_check()) {
987 // Special case for zero-length matches. 987 // Special case for zero-length matches.
988 __ Cmp(current_input_offset(), first_capture_start); 988 __ Cmp(current_input_offset(), first_capture_start);
989 // Not a zero-length match, restart. 989 // Not a zero-length match, restart.
990 __ B(ne, &load_char_start_regexp); 990 __ B(ne, &load_char_start_regexp);
991 // Offset from the end is zero if we already reached the end. 991 // Offset from the end is zero if we already reached the end.
992 __ Cbz(current_input_offset(), &return_w0); 992 __ Cbz(current_input_offset(), &return_w0);
993 // Advance current position after a zero-length match. 993 // Advance current position after a zero-length match.
994 Label advance;
995 __ bind(&advance);
994 __ Add(current_input_offset(), 996 __ Add(current_input_offset(),
995 current_input_offset(), 997 current_input_offset(),
996 Operand((mode_ == UC16) ? 2 : 1)); 998 Operand((mode_ == UC16) ? 2 : 1));
999 if (global_unicode()) CheckNotInSurrogatePair(0, &advance);
997 } 1000 }
998 1001
999 __ B(&load_char_start_regexp); 1002 __ B(&load_char_start_regexp);
1000 } else { 1003 } else {
1001 __ Mov(w0, SUCCESS); 1004 __ Mov(w0, SUCCESS);
1002 } 1005 }
1003 } 1006 }
1004 1007
1005 if (exit_label_.is_linked()) { 1008 if (exit_label_.is_linked()) {
1006 // Exit and return w0 1009 // Exit and return w0
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 } 1654 }
1652 } 1655 }
1653 } 1656 }
1654 1657
1655 #endif // V8_INTERPRETED_REGEXP 1658 #endif // V8_INTERPRETED_REGEXP
1656 1659
1657 } // namespace internal 1660 } // namespace internal
1658 } // namespace v8 1661 } // namespace v8
1659 1662
1660 #endif // V8_TARGET_ARCH_ARM64 1663 #endif // V8_TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698