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

Side by Side Diff: src/regexp/arm/regexp-macro-assembler-arm.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: fix test Created 4 years, 11 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
« no previous file with comments | « no previous file | src/regexp/arm64/regexp-macro-assembler-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/regexp/arm/regexp-macro-assembler-arm.h" 7 #include "src/regexp/arm/regexp-macro-assembler-arm.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 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 if (global_with_zero_length_check()) { 798 if (global_with_zero_length_check()) {
799 // Special case for zero-length matches. 799 // Special case for zero-length matches.
800 // r4: capture start index 800 // r4: capture start index
801 __ cmp(current_input_offset(), r4); 801 __ cmp(current_input_offset(), r4);
802 // Not a zero-length match, restart. 802 // Not a zero-length match, restart.
803 __ b(ne, &load_char_start_regexp); 803 __ b(ne, &load_char_start_regexp);
804 // Offset from the end is zero if we already reached the end. 804 // Offset from the end is zero if we already reached the end.
805 __ cmp(current_input_offset(), Operand::Zero()); 805 __ cmp(current_input_offset(), Operand::Zero());
806 __ b(eq, &exit_label_); 806 __ b(eq, &exit_label_);
807 // Advance current position after a zero-length match. 807 // Advance current position after a zero-length match.
808 Label advance;
809 __ bind(&advance);
808 __ add(current_input_offset(), 810 __ add(current_input_offset(),
809 current_input_offset(), 811 current_input_offset(),
810 Operand((mode_ == UC16) ? 2 : 1)); 812 Operand((mode_ == UC16) ? 2 : 1));
813 if (global_unicode()) CheckNotInSurrogatePair(0, &advance);
811 } 814 }
812 815
813 __ b(&load_char_start_regexp); 816 __ b(&load_char_start_regexp);
814 } else { 817 } else {
815 __ mov(r0, Operand(SUCCESS)); 818 __ mov(r0, Operand(SUCCESS));
816 } 819 }
817 } 820 }
818 821
819 // Exit and return r0 822 // Exit and return r0
820 __ bind(&exit_label_); 823 __ bind(&exit_label_);
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
1240 1243
1241 1244
1242 #undef __ 1245 #undef __
1243 1246
1244 #endif // V8_INTERPRETED_REGEXP 1247 #endif // V8_INTERPRETED_REGEXP
1245 1248
1246 } // namespace internal 1249 } // namespace internal
1247 } // namespace v8 1250 } // namespace v8
1248 1251
1249 #endif // V8_TARGET_ARCH_ARM 1252 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/regexp/arm64/regexp-macro-assembler-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698