OLD | NEW |
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 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 if (global_with_zero_length_check()) { | 801 if (global_with_zero_length_check()) { |
802 // Special case for zero-length matches. | 802 // Special case for zero-length matches. |
803 // t7: capture start index | 803 // t7: capture start index |
804 // Not a zero-length match, restart. | 804 // Not a zero-length match, restart. |
805 __ Branch( | 805 __ Branch( |
806 &load_char_start_regexp, ne, current_input_offset(), Operand(t7)); | 806 &load_char_start_regexp, ne, current_input_offset(), Operand(t7)); |
807 // Offset from the end is zero if we already reached the end. | 807 // Offset from the end is zero if we already reached the end. |
808 __ Branch(&exit_label_, eq, current_input_offset(), | 808 __ Branch(&exit_label_, eq, current_input_offset(), |
809 Operand(zero_reg)); | 809 Operand(zero_reg)); |
810 // Advance current position after a zero-length match. | 810 // Advance current position after a zero-length match. |
| 811 Label advance; |
| 812 __ bind(&advance); |
811 __ Addu(current_input_offset(), | 813 __ Addu(current_input_offset(), |
812 current_input_offset(), | 814 current_input_offset(), |
813 Operand((mode_ == UC16) ? 2 : 1)); | 815 Operand((mode_ == UC16) ? 2 : 1)); |
| 816 if (global_unicode()) CheckNotInSurrogatePair(0, &advance); |
814 } | 817 } |
815 | 818 |
816 __ Branch(&load_char_start_regexp); | 819 __ Branch(&load_char_start_regexp); |
817 } else { | 820 } else { |
818 __ li(v0, Operand(SUCCESS)); | 821 __ li(v0, Operand(SUCCESS)); |
819 } | 822 } |
820 } | 823 } |
821 // Exit and return v0. | 824 // Exit and return v0. |
822 __ bind(&exit_label_); | 825 __ bind(&exit_label_); |
823 if (global()) { | 826 if (global()) { |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 | 1291 |
1289 | 1292 |
1290 #undef __ | 1293 #undef __ |
1291 | 1294 |
1292 #endif // V8_INTERPRETED_REGEXP | 1295 #endif // V8_INTERPRETED_REGEXP |
1293 | 1296 |
1294 } // namespace internal | 1297 } // namespace internal |
1295 } // namespace v8 | 1298 } // namespace v8 |
1296 | 1299 |
1297 #endif // V8_TARGET_ARCH_MIPS | 1300 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |