| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 6 | 6 |
| 7 #include "src/regexp/ppc/regexp-macro-assembler-ppc.h" | 7 #include "src/regexp/ppc/regexp-macro-assembler-ppc.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 if (global_with_zero_length_check()) { | 838 if (global_with_zero_length_check()) { |
| 839 // Special case for zero-length matches. | 839 // Special case for zero-length matches. |
| 840 // r25: capture start index | 840 // r25: capture start index |
| 841 __ cmp(current_input_offset(), r25); | 841 __ cmp(current_input_offset(), r25); |
| 842 // Not a zero-length match, restart. | 842 // Not a zero-length match, restart. |
| 843 __ bne(&load_char_start_regexp); | 843 __ bne(&load_char_start_regexp); |
| 844 // Offset from the end is zero if we already reached the end. | 844 // Offset from the end is zero if we already reached the end. |
| 845 __ cmpi(current_input_offset(), Operand::Zero()); | 845 __ cmpi(current_input_offset(), Operand::Zero()); |
| 846 __ beq(&exit_label_); | 846 __ beq(&exit_label_); |
| 847 // Advance current position after a zero-length match. | 847 // Advance current position after a zero-length match. |
| 848 Label advance; |
| 849 __ bind(&advance); |
| 848 __ addi(current_input_offset(), current_input_offset(), | 850 __ addi(current_input_offset(), current_input_offset(), |
| 849 Operand((mode_ == UC16) ? 2 : 1)); | 851 Operand((mode_ == UC16) ? 2 : 1)); |
| 852 if (global_unicode()) CheckNotInSurrogatePair(0, &advance); |
| 850 } | 853 } |
| 851 | 854 |
| 852 __ b(&load_char_start_regexp); | 855 __ b(&load_char_start_regexp); |
| 853 } else { | 856 } else { |
| 854 __ li(r3, Operand(SUCCESS)); | 857 __ li(r3, Operand(SUCCESS)); |
| 855 } | 858 } |
| 856 } | 859 } |
| 857 | 860 |
| 858 // Exit and return r3 | 861 // Exit and return r3 |
| 859 __ bind(&exit_label_); | 862 __ bind(&exit_label_); |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 } | 1292 } |
| 1290 | 1293 |
| 1291 | 1294 |
| 1292 #undef __ | 1295 #undef __ |
| 1293 | 1296 |
| 1294 #endif // V8_INTERPRETED_REGEXP | 1297 #endif // V8_INTERPRETED_REGEXP |
| 1295 } // namespace internal | 1298 } // namespace internal |
| 1296 } // namespace v8 | 1299 } // namespace v8 |
| 1297 | 1300 |
| 1298 #endif // V8_TARGET_ARCH_PPC | 1301 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |