| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 private: | 51 private: |
| 52 SaveFPRegsMode save_doubles_; | 52 SaveFPRegsMode save_doubles_; |
| 53 | 53 |
| 54 Major MajorKey() { return StoreBufferOverflow; } | 54 Major MajorKey() { return StoreBufferOverflow; } |
| 55 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 55 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 | 58 |
| 59 class StringHelper : public AllStatic { | 59 class StringHelper : public AllStatic { |
| 60 public: | 60 public: |
| 61 // Generate code for copying characters using a simple loop. This should only | |
| 62 // be used in places where the number of characters is small and the | |
| 63 // additional setup and checking in GenerateCopyCharactersLong adds too much | |
| 64 // overhead. Copying of overlapping regions is not supported. | |
| 65 // Dest register ends at the position after the last character written. | |
| 66 static void GenerateCopyCharacters(MacroAssembler* masm, | |
| 67 Register dest, | |
| 68 Register src, | |
| 69 Register count, | |
| 70 Register scratch, | |
| 71 bool ascii); | |
| 72 | |
| 73 // Generate code for copying a large number of characters. This function | 61 // Generate code for copying a large number of characters. This function |
| 74 // is allowed to spend extra time setting up conditions to make copying | 62 // is allowed to spend extra time setting up conditions to make copying |
| 75 // faster. Copying of overlapping regions is not supported. | 63 // faster. Copying of overlapping regions is not supported. |
| 76 // Dest register ends at the position after the last character written. | 64 // Dest register ends at the position after the last character written. |
| 77 static void GenerateCopyCharactersLong(MacroAssembler* masm, | 65 static void GenerateCopyCharactersLong(MacroAssembler* masm, |
| 78 Register dest, | 66 Register dest, |
| 79 Register src, | 67 Register src, |
| 80 Register count, | 68 Register count, |
| 81 Register scratch1, | 69 Register scratch1, |
| 82 Register scratch2, | 70 Register scratch2, |
| 83 Register scratch3, | 71 Register scratch3, |
| 84 Register scratch4, | 72 Register scratch4, |
| 85 Register scratch5, | 73 Register scratch5, |
| 86 int flags); | 74 int flags); |
| 87 | 75 |
| 88 | 76 |
| 89 // Probe the string table for a two character string. If the string is | |
| 90 // not found by probing a jump to the label not_found is performed. This jump | |
| 91 // does not guarantee that the string is not in the string table. If the | |
| 92 // string is found the code falls through with the string in register r0. | |
| 93 // Contents of both c1 and c2 registers are modified. At the exit c1 is | |
| 94 // guaranteed to contain halfword with low and high bytes equal to | |
| 95 // initial contents of c1 and c2 respectively. | |
| 96 static void GenerateTwoCharacterStringTableProbe(MacroAssembler* masm, | |
| 97 Register c1, | |
| 98 Register c2, | |
| 99 Register scratch1, | |
| 100 Register scratch2, | |
| 101 Register scratch3, | |
| 102 Register scratch4, | |
| 103 Register scratch5, | |
| 104 Label* not_found); | |
| 105 | |
| 106 // Generate string hash. | 77 // Generate string hash. |
| 107 static void GenerateHashInit(MacroAssembler* masm, | 78 static void GenerateHashInit(MacroAssembler* masm, |
| 108 Register hash, | 79 Register hash, |
| 109 Register character); | 80 Register character); |
| 110 | 81 |
| 111 static void GenerateHashAddCharacter(MacroAssembler* masm, | 82 static void GenerateHashAddCharacter(MacroAssembler* masm, |
| 112 Register hash, | 83 Register hash, |
| 113 Register character); | 84 Register character); |
| 114 | 85 |
| 115 static void GenerateHashGetHash(MacroAssembler* masm, | 86 static void GenerateHashGetHash(MacroAssembler* masm, |
| 116 Register hash); | 87 Register hash); |
| 117 | 88 |
| 118 private: | 89 private: |
| 119 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); | 90 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); |
| 120 }; | 91 }; |
| 121 | 92 |
| 122 | 93 |
| 123 class StringAddStub: public PlatformCodeStub { | |
| 124 public: | |
| 125 explicit StringAddStub(StringAddFlags flags) : flags_(flags) {} | |
| 126 | |
| 127 private: | |
| 128 Major MajorKey() { return StringAdd; } | |
| 129 int MinorKey() { return flags_; } | |
| 130 | |
| 131 void Generate(MacroAssembler* masm); | |
| 132 | |
| 133 void GenerateConvertArgument(MacroAssembler* masm, | |
| 134 int stack_offset, | |
| 135 Register arg, | |
| 136 Register scratch1, | |
| 137 Register scratch2, | |
| 138 Register scratch3, | |
| 139 Register scratch4, | |
| 140 Label* slow); | |
| 141 | |
| 142 void GenerateRegisterArgsPush(MacroAssembler* masm); | |
| 143 void GenerateRegisterArgsPop(MacroAssembler* masm); | |
| 144 | |
| 145 const StringAddFlags flags_; | |
| 146 }; | |
| 147 | |
| 148 | |
| 149 class SubStringStub: public PlatformCodeStub { | 94 class SubStringStub: public PlatformCodeStub { |
| 150 public: | 95 public: |
| 151 SubStringStub() {} | 96 SubStringStub() {} |
| 152 | 97 |
| 153 private: | 98 private: |
| 154 Major MajorKey() { return SubString; } | 99 Major MajorKey() { return SubString; } |
| 155 int MinorKey() { return 0; } | 100 int MinorKey() { return 0; } |
| 156 | 101 |
| 157 void Generate(MacroAssembler* masm); | 102 void Generate(MacroAssembler* masm); |
| 158 }; | 103 }; |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 | 464 |
| 520 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 465 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
| 521 | 466 |
| 522 LookupMode mode_; | 467 LookupMode mode_; |
| 523 }; | 468 }; |
| 524 | 469 |
| 525 | 470 |
| 526 } } // namespace v8::internal | 471 } } // namespace v8::internal |
| 527 | 472 |
| 528 #endif // V8_MIPS_CODE_STUBS_ARM_H_ | 473 #endif // V8_MIPS_CODE_STUBS_ARM_H_ |
| OLD | NEW |