Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Side by Side Diff: src/x64/regexp-macro-assembler-x64.cc

Issue 43333003: Move movq(Register, ExternalReference) into X64 MacroAssembler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698