| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 __ bind(&done); | 611 __ bind(&done); |
| 612 } | 612 } |
| 613 return true; | 613 return true; |
| 614 } | 614 } |
| 615 case 'w': { | 615 case 'w': { |
| 616 if (mode_ != ASCII) { | 616 if (mode_ != ASCII) { |
| 617 // Table is 128 entries, so all ASCII characters can be tested. | 617 // Table is 128 entries, so all ASCII characters can be tested. |
| 618 __ cmpl(current_character(), Immediate('z')); | 618 __ cmpl(current_character(), Immediate('z')); |
| 619 BranchOrBacktrack(above, on_no_match); | 619 BranchOrBacktrack(above, on_no_match); |
| 620 } | 620 } |
| 621 __ movq(rbx, ExternalReference::re_word_character_map()); | 621 __ Move(rbx, ExternalReference::re_word_character_map()); |
| 622 ASSERT_EQ(0, word_character_map[0]); // Character '\0' is not a word char. | 622 ASSERT_EQ(0, word_character_map[0]); // Character '\0' is not a word char. |
| 623 __ testb(Operand(rbx, current_character(), times_1, 0), | 623 __ testb(Operand(rbx, current_character(), times_1, 0), |
| 624 current_character()); | 624 current_character()); |
| 625 BranchOrBacktrack(zero, on_no_match); | 625 BranchOrBacktrack(zero, on_no_match); |
| 626 return true; | 626 return true; |
| 627 } | 627 } |
| 628 case 'W': { | 628 case 'W': { |
| 629 Label done; | 629 Label done; |
| 630 if (mode_ != ASCII) { | 630 if (mode_ != ASCII) { |
| 631 // Table is 128 entries, so all ASCII characters can be tested. | 631 // Table is 128 entries, so all ASCII characters can be tested. |
| 632 __ cmpl(current_character(), Immediate('z')); | 632 __ cmpl(current_character(), Immediate('z')); |
| 633 __ j(above, &done); | 633 __ j(above, &done); |
| 634 } | 634 } |
| 635 __ movq(rbx, ExternalReference::re_word_character_map()); | 635 __ Move(rbx, ExternalReference::re_word_character_map()); |
| 636 ASSERT_EQ(0, word_character_map[0]); // Character '\0' is not a word char. | 636 ASSERT_EQ(0, word_character_map[0]); // Character '\0' is not a word char. |
| 637 __ testb(Operand(rbx, current_character(), times_1, 0), | 637 __ testb(Operand(rbx, current_character(), times_1, 0), |
| 638 current_character()); | 638 current_character()); |
| 639 BranchOrBacktrack(not_zero, on_no_match); | 639 BranchOrBacktrack(not_zero, on_no_match); |
| 640 if (mode_ != ASCII) { | 640 if (mode_ != ASCII) { |
| 641 __ bind(&done); | 641 __ bind(&done); |
| 642 } | 642 } |
| 643 return true; | 643 return true; |
| 644 } | 644 } |
| 645 | 645 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 __ push(Immediate(0)); // Number of successful matches in a global regexp. | 711 __ push(Immediate(0)); // Number of successful matches in a global regexp. |
| 712 __ push(Immediate(0)); // Make room for "input start - 1" constant. | 712 __ push(Immediate(0)); // Make room for "input start - 1" constant. |
| 713 | 713 |
| 714 // Check if we have space on the stack for registers. | 714 // Check if we have space on the stack for registers. |
| 715 Label stack_limit_hit; | 715 Label stack_limit_hit; |
| 716 Label stack_ok; | 716 Label stack_ok; |
| 717 | 717 |
| 718 ExternalReference stack_limit = | 718 ExternalReference stack_limit = |
| 719 ExternalReference::address_of_stack_limit(isolate()); | 719 ExternalReference::address_of_stack_limit(isolate()); |
| 720 __ movq(rcx, rsp); | 720 __ movq(rcx, rsp); |
| 721 __ movq(kScratchRegister, stack_limit); | 721 __ Move(kScratchRegister, stack_limit); |
| 722 __ subq(rcx, Operand(kScratchRegister, 0)); | 722 __ subq(rcx, Operand(kScratchRegister, 0)); |
| 723 // Handle it if the stack pointer is already below the stack limit. | 723 // Handle it if the stack pointer is already below the stack limit. |
| 724 __ j(below_equal, &stack_limit_hit); | 724 __ j(below_equal, &stack_limit_hit); |
| 725 // Check if there is room for the variable number of registers above | 725 // Check if there is room for the variable number of registers above |
| 726 // the stack limit. | 726 // the stack limit. |
| 727 __ cmpq(rcx, Immediate(num_registers_ * kPointerSize)); | 727 __ cmpq(rcx, Immediate(num_registers_ * kPointerSize)); |
| 728 __ j(above_equal, &stack_ok); | 728 __ j(above_equal, &stack_ok); |
| 729 // Exit with OutOfMemory exception. There is not enough space on the stack | 729 // Exit with OutOfMemory exception. There is not enough space on the stack |
| 730 // for our working registers. | 730 // for our working registers. |
| 731 __ Set(rax, EXCEPTION); | 731 __ Set(rax, EXCEPTION); |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1439 } | 1439 } |
| 1440 } | 1440 } |
| 1441 | 1441 |
| 1442 #undef __ | 1442 #undef __ |
| 1443 | 1443 |
| 1444 #endif // V8_INTERPRETED_REGEXP | 1444 #endif // V8_INTERPRETED_REGEXP |
| 1445 | 1445 |
| 1446 }} // namespace v8::internal | 1446 }} // namespace v8::internal |
| 1447 | 1447 |
| 1448 #endif // V8_TARGET_ARCH_X64 | 1448 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |