OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 pc += BC_CHECK_AT_START_LENGTH; | 600 pc += BC_CHECK_AT_START_LENGTH; |
601 } | 601 } |
602 break; | 602 break; |
603 BYTECODE(CHECK_NOT_AT_START) | 603 BYTECODE(CHECK_NOT_AT_START) |
604 if (current == 0) { | 604 if (current == 0) { |
605 pc += BC_CHECK_NOT_AT_START_LENGTH; | 605 pc += BC_CHECK_NOT_AT_START_LENGTH; |
606 } else { | 606 } else { |
607 pc = code_base + Load32Aligned(pc + 4); | 607 pc = code_base + Load32Aligned(pc + 4); |
608 } | 608 } |
609 break; | 609 break; |
610 BYTECODE(SET_CURRENT_POSITION_FROM_END) { | |
611 int by = static_cast<uint32_t>(insn) >> BYTECODE_SHIFT; | |
612 if (subject.length() - current > by) { | |
613 current = subject.length() - by; | |
614 current_char = subject[current - 1]; | |
615 } | |
616 pc += BC_SET_CURRENT_POSITION_FROM_END_LENGTH; | |
617 break; | |
618 } | |
619 default: | 610 default: |
620 UNREACHABLE(); | 611 UNREACHABLE(); |
621 break; | 612 break; |
622 } | 613 } |
623 } | 614 } |
624 } | 615 } |
625 | 616 |
626 | 617 |
627 bool IrregexpInterpreter::Match(Handle<ByteArray> code_array, | 618 bool IrregexpInterpreter::Match(Handle<ByteArray> code_array, |
628 Handle<String> subject, | 619 Handle<String> subject, |
(...skipping 17 matching lines...) Expand all Loading... |
646 if (start_position != 0) previous_char = subject_vector[start_position - 1]; | 637 if (start_position != 0) previous_char = subject_vector[start_position - 1]; |
647 return RawMatch(code_base, | 638 return RawMatch(code_base, |
648 subject_vector, | 639 subject_vector, |
649 registers, | 640 registers, |
650 start_position, | 641 start_position, |
651 previous_char); | 642 previous_char); |
652 } | 643 } |
653 } | 644 } |
654 | 645 |
655 } } // namespace v8::internal | 646 } } // namespace v8::internal |
OLD | NEW |