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

Side by Side Diff: src/regexp/mips/regexp-macro-assembler-mips.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 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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 #include "src/regexp/mips/regexp-macro-assembler-mips.h" 7 #include "src/regexp/mips/regexp-macro-assembler-mips.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 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 if (global_with_zero_length_check()) { 794 if (global_with_zero_length_check()) {
795 // Special case for zero-length matches. 795 // Special case for zero-length matches.
796 // t7: capture start index 796 // t7: capture start index
797 // Not a zero-length match, restart. 797 // Not a zero-length match, restart.
798 __ Branch( 798 __ Branch(
799 &load_char_start_regexp, ne, current_input_offset(), Operand(t7)); 799 &load_char_start_regexp, ne, current_input_offset(), Operand(t7));
800 // Offset from the end is zero if we already reached the end. 800 // Offset from the end is zero if we already reached the end.
801 __ Branch(&exit_label_, eq, current_input_offset(), 801 __ Branch(&exit_label_, eq, current_input_offset(),
802 Operand(zero_reg)); 802 Operand(zero_reg));
803 // Advance current position after a zero-length match. 803 // Advance current position after a zero-length match.
804 Label advance;
805 __ bind(&advance);
804 __ Addu(current_input_offset(), 806 __ Addu(current_input_offset(),
805 current_input_offset(), 807 current_input_offset(),
806 Operand((mode_ == UC16) ? 2 : 1)); 808 Operand((mode_ == UC16) ? 2 : 1));
809 if (global_unicode()) CheckNotInSurrogatePair(0, &advance);
807 } 810 }
808 811
809 __ Branch(&load_char_start_regexp); 812 __ Branch(&load_char_start_regexp);
810 } else { 813 } else {
811 __ li(v0, Operand(SUCCESS)); 814 __ li(v0, Operand(SUCCESS));
812 } 815 }
813 } 816 }
814 // Exit and return v0. 817 // Exit and return v0.
815 __ bind(&exit_label_); 818 __ bind(&exit_label_);
816 if (global()) { 819 if (global()) {
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 1284
1282 1285
1283 #undef __ 1286 #undef __
1284 1287
1285 #endif // V8_INTERPRETED_REGEXP 1288 #endif // V8_INTERPRETED_REGEXP
1286 1289
1287 } // namespace internal 1290 } // namespace internal
1288 } // namespace v8 1291 } // namespace v8
1289 1292
1290 #endif // V8_TARGET_ARCH_MIPS 1293 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698