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

Side by Side Diff: src/arm/codegen-arm.h

Issue 1769014: Port string keyed load IC improvements (r4444) to ARM. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 7 months 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 | « no previous file | src/arm/codegen-arm.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 } else { 660 } else {
661 PrintF("GenericBinaryOpStub (%s by %d)\n", 661 PrintF("GenericBinaryOpStub (%s by %d)\n",
662 Token::String(op_), 662 Token::String(op_),
663 constant_rhs_); 663 constant_rhs_);
664 } 664 }
665 } 665 }
666 #endif 666 #endif
667 }; 667 };
668 668
669 669
670 class StringStubBase: public CodeStub { 670 class StringHelper : public AllStatic {
671 public: 671 public:
672 // Generates fast code for getting a char code out of a string
673 // object at the given index. May bail out for four reasons (in the
674 // listed order):
675 // * Receiver is not a string (receiver_not_string label).
676 // * Index is not a smi (index_not_smi label).
677 // * Index is out of range (index_out_of_range).
678 // * Some other reason (slow_case label). In this case it's
679 // guaranteed that the above conditions are not violated,
680 // e.g. it's safe to assume the receiver is a string and the
681 // index is a non-negative smi < length.
682 // When successful, object, index, and scratch are clobbered.
683 // Otherwise, scratch and result are clobbered.
684 static void GenerateFastCharCodeAt(MacroAssembler* masm,
685 Register object,
686 Register index,
687 Register scratch,
688 Register result,
689 Label* receiver_not_string,
690 Label* index_not_smi,
691 Label* index_out_of_range,
692 Label* slow_case);
693
694 // Generates code for creating a one-char string from the given char
695 // code. May do a runtime call, so any register can be clobbered
696 // and, if the given invoke flag specifies a call, an internal frame
697 // is required. In tail call mode the result must be r0 register.
698 static void GenerateCharFromCode(MacroAssembler* masm,
699 Register code,
700 Register scratch,
701 Register result,
702 InvokeFlag flag);
703
672 // Generate code for copying characters using a simple loop. This should only 704 // Generate code for copying characters using a simple loop. This should only
673 // be used in places where the number of characters is small and the 705 // be used in places where the number of characters is small and the
674 // additional setup and checking in GenerateCopyCharactersLong adds too much 706 // additional setup and checking in GenerateCopyCharactersLong adds too much
675 // overhead. Copying of overlapping regions is not supported. 707 // overhead. Copying of overlapping regions is not supported.
676 // Dest register ends at the position after the last character written. 708 // Dest register ends at the position after the last character written.
677 void GenerateCopyCharacters(MacroAssembler* masm, 709 static void GenerateCopyCharacters(MacroAssembler* masm,
678 Register dest, 710 Register dest,
679 Register src, 711 Register src,
680 Register count, 712 Register count,
681 Register scratch, 713 Register scratch,
682 bool ascii); 714 bool ascii);
683 715
684 // Generate code for copying a large number of characters. This function 716 // Generate code for copying a large number of characters. This function
685 // is allowed to spend extra time setting up conditions to make copying 717 // is allowed to spend extra time setting up conditions to make copying
686 // faster. Copying of overlapping regions is not supported. 718 // faster. Copying of overlapping regions is not supported.
687 // Dest register ends at the position after the last character written. 719 // Dest register ends at the position after the last character written.
688 void GenerateCopyCharactersLong(MacroAssembler* masm, 720 static void GenerateCopyCharactersLong(MacroAssembler* masm,
689 Register dest, 721 Register dest,
690 Register src, 722 Register src,
691 Register count, 723 Register count,
692 Register scratch1, 724 Register scratch1,
693 Register scratch2, 725 Register scratch2,
694 Register scratch3, 726 Register scratch3,
695 Register scratch4, 727 Register scratch4,
696 Register scratch5, 728 Register scratch5,
697 int flags); 729 int flags);
698 730
699 731
700 // Probe the symbol table for a two character string. If the string is 732 // Probe the symbol table for a two character string. If the string is
701 // not found by probing a jump to the label not_found is performed. This jump 733 // not found by probing a jump to the label not_found is performed. This jump
702 // does not guarantee that the string is not in the symbol table. If the 734 // does not guarantee that the string is not in the symbol table. If the
703 // string is found the code falls through with the string in register r0. 735 // string is found the code falls through with the string in register r0.
704 // Contents of both c1 and c2 registers are modified. At the exit c1 is 736 // Contents of both c1 and c2 registers are modified. At the exit c1 is
705 // guaranteed to contain halfword with low and high bytes equal to 737 // guaranteed to contain halfword with low and high bytes equal to
706 // initial contents of c1 and c2 respectively. 738 // initial contents of c1 and c2 respectively.
707 void GenerateTwoCharacterSymbolTableProbe(MacroAssembler* masm, 739 static void GenerateTwoCharacterSymbolTableProbe(MacroAssembler* masm,
708 Register c1, 740 Register c1,
709 Register c2, 741 Register c2,
710 Register scratch1, 742 Register scratch1,
711 Register scratch2, 743 Register scratch2,
712 Register scratch3, 744 Register scratch3,
713 Register scratch4, 745 Register scratch4,
714 Register scratch5, 746 Register scratch5,
715 Label* not_found); 747 Label* not_found);
716 748
717 // Generate string hash. 749 // Generate string hash.
718 void GenerateHashInit(MacroAssembler* masm, 750 static void GenerateHashInit(MacroAssembler* masm,
719 Register hash, 751 Register hash,
720 Register character); 752 Register character);
721 753
722 void GenerateHashAddCharacter(MacroAssembler* masm, 754 static void GenerateHashAddCharacter(MacroAssembler* masm,
723 Register hash, 755 Register hash,
724 Register character); 756 Register character);
725 757
726 void GenerateHashGetHash(MacroAssembler* masm, 758 static void GenerateHashGetHash(MacroAssembler* masm,
727 Register hash); 759 Register hash);
760
761 private:
762 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper);
728 }; 763 };
729 764
730 765
731 // Flag that indicates how to generate code for the stub StringAddStub. 766 // Flag that indicates how to generate code for the stub StringAddStub.
732 enum StringAddFlags { 767 enum StringAddFlags {
733 NO_STRING_ADD_FLAGS = 0, 768 NO_STRING_ADD_FLAGS = 0,
734 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. 769 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub.
735 }; 770 };
736 771
737 772
738 class StringAddStub: public StringStubBase { 773 class StringAddStub: public CodeStub {
739 public: 774 public:
740 explicit StringAddStub(StringAddFlags flags) { 775 explicit StringAddStub(StringAddFlags flags) {
741 string_check_ = ((flags & NO_STRING_CHECK_IN_STUB) == 0); 776 string_check_ = ((flags & NO_STRING_CHECK_IN_STUB) == 0);
742 } 777 }
743 778
744 private: 779 private:
745 Major MajorKey() { return StringAdd; } 780 Major MajorKey() { return StringAdd; }
746 int MinorKey() { return string_check_ ? 0 : 1; } 781 int MinorKey() { return string_check_ ? 0 : 1; }
747 782
748 void Generate(MacroAssembler* masm); 783 void Generate(MacroAssembler* masm);
749 784
750 // Should the stub check whether arguments are strings? 785 // Should the stub check whether arguments are strings?
751 bool string_check_; 786 bool string_check_;
752 }; 787 };
753 788
754 789
755 class SubStringStub: public StringStubBase { 790 class SubStringStub: public CodeStub {
756 public: 791 public:
757 SubStringStub() {} 792 SubStringStub() {}
758 793
759 private: 794 private:
760 Major MajorKey() { return SubString; } 795 Major MajorKey() { return SubString; }
761 int MinorKey() { return 0; } 796 int MinorKey() { return 0; }
762 797
763 void Generate(MacroAssembler* masm); 798 void Generate(MacroAssembler* masm);
764 }; 799 };
765 800
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 void Print() { 892 void Print() {
858 PrintF("NumberToStringStub\n"); 893 PrintF("NumberToStringStub\n");
859 } 894 }
860 #endif 895 #endif
861 }; 896 };
862 897
863 898
864 } } // namespace v8::internal 899 } } // namespace v8::internal
865 900
866 #endif // V8_ARM_CODEGEN_ARM_H_ 901 #endif // V8_ARM_CODEGEN_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698