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

Side by Side Diff: src/regexp/mips64/regexp-macro-assembler-mips64.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 | « src/regexp/mips/regexp-macro-assembler-mips.cc ('k') | src/regexp/regexp-macro-assembler.h » ('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_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 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 if (global_with_zero_length_check()) { 841 if (global_with_zero_length_check()) {
842 // Special case for zero-length matches. 842 // Special case for zero-length matches.
843 // t3: capture start index 843 // t3: capture start index
844 // Not a zero-length match, restart. 844 // Not a zero-length match, restart.
845 __ Branch( 845 __ Branch(
846 &load_char_start_regexp, ne, current_input_offset(), Operand(t3)); 846 &load_char_start_regexp, ne, current_input_offset(), Operand(t3));
847 // Offset from the end is zero if we already reached the end. 847 // Offset from the end is zero if we already reached the end.
848 __ Branch(&exit_label_, eq, current_input_offset(), 848 __ Branch(&exit_label_, eq, current_input_offset(),
849 Operand(zero_reg)); 849 Operand(zero_reg));
850 // Advance current position after a zero-length match. 850 // Advance current position after a zero-length match.
851 Label advance;
852 __ bind(&advance);
851 __ Daddu(current_input_offset(), 853 __ Daddu(current_input_offset(),
852 current_input_offset(), 854 current_input_offset(),
853 Operand((mode_ == UC16) ? 2 : 1)); 855 Operand((mode_ == UC16) ? 2 : 1));
856 if (global_unicode()) CheckNotInSurrogatePair(0, &advance);
854 } 857 }
855 858
856 __ Branch(&load_char_start_regexp); 859 __ Branch(&load_char_start_regexp);
857 } else { 860 } else {
858 __ li(v0, Operand(SUCCESS)); 861 __ li(v0, Operand(SUCCESS));
859 } 862 }
860 } 863 }
861 // Exit and return v0. 864 // Exit and return v0.
862 __ bind(&exit_label_); 865 __ bind(&exit_label_);
863 if (global()) { 866 if (global()) {
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 } 1330 }
1328 1331
1329 #undef __ 1332 #undef __
1330 1333
1331 #endif // V8_INTERPRETED_REGEXP 1334 #endif // V8_INTERPRETED_REGEXP
1332 1335
1333 } // namespace internal 1336 } // namespace internal
1334 } // namespace v8 1337 } // namespace v8
1335 1338
1336 #endif // V8_TARGET_ARCH_MIPS64 1339 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/regexp/mips/regexp-macro-assembler-mips.cc ('k') | src/regexp/regexp-macro-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698