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