OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 // A simple interpreter for the Irregexp byte code. | 5 // A simple interpreter for the Irregexp byte code. |
6 | 6 |
7 #include "src/regexp/interpreter-irregexp.h" | 7 #include "src/regexp/interpreter-irregexp.h" |
8 | 8 |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/regexp/bytecodes-irregexp.h" | 10 #include "src/regexp/bytecodes-irregexp.h" |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 break; | 553 break; |
554 } | 554 } |
555 BYTECODE(CHECK_AT_START) | 555 BYTECODE(CHECK_AT_START) |
556 if (current == 0) { | 556 if (current == 0) { |
557 pc = code_base + Load32Aligned(pc + 4); | 557 pc = code_base + Load32Aligned(pc + 4); |
558 } else { | 558 } else { |
559 pc += BC_CHECK_AT_START_LENGTH; | 559 pc += BC_CHECK_AT_START_LENGTH; |
560 } | 560 } |
561 break; | 561 break; |
562 BYTECODE(CHECK_NOT_AT_START) | 562 BYTECODE(CHECK_NOT_AT_START) |
563 if (current + (insn >> BYTECODE_SHIFT) == 0) { | 563 if (current + (insn >> BYTECODE_SHIFT) == 0) { |
564 pc += BC_CHECK_NOT_AT_START_LENGTH; | 564 pc += BC_CHECK_NOT_AT_START_LENGTH; |
565 } else { | 565 } else { |
566 pc = code_base + Load32Aligned(pc + 4); | 566 pc = code_base + Load32Aligned(pc + 4); |
567 } | 567 } |
568 break; | 568 break; |
569 BYTECODE(SET_CURRENT_POSITION_FROM_END) { | 569 BYTECODE(SET_CURRENT_POSITION_FROM_END) { |
570 int by = static_cast<uint32_t>(insn) >> BYTECODE_SHIFT; | 570 int by = static_cast<uint32_t>(insn) >> BYTECODE_SHIFT; |
571 if (subject.length() - current > by) { | 571 if (subject.length() - current > by) { |
572 current = subject.length() - by; | 572 current = subject.length() - by; |
573 current_char = subject[current - 1]; | 573 current_char = subject[current - 1]; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 code_base, | 612 code_base, |
613 subject_vector, | 613 subject_vector, |
614 registers, | 614 registers, |
615 start_position, | 615 start_position, |
616 previous_char); | 616 previous_char); |
617 } | 617 } |
618 } | 618 } |
619 | 619 |
620 } // namespace internal | 620 } // namespace internal |
621 } // namespace v8 | 621 } // namespace v8 |
OLD | NEW |