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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 virtual void FinishCode(Code* code) { | 219 virtual void FinishCode(Code* code) { |
220 code->set_binary_op_type(operands_type_); | 220 code->set_binary_op_type(operands_type_); |
221 code->set_binary_op_result_type(result_type_); | 221 code->set_binary_op_result_type(result_type_); |
222 } | 222 } |
223 | 223 |
224 friend class CodeGenerator; | 224 friend class CodeGenerator; |
225 }; | 225 }; |
226 | 226 |
227 | 227 |
| 228 class StringHelper : public AllStatic { |
| 229 public: |
| 230 // Generate code for copying characters using a simple loop. This should only |
| 231 // be used in places where the number of characters is small and the |
| 232 // additional setup and checking in GenerateCopyCharactersLong adds too much |
| 233 // overhead. Copying of overlapping regions is not supported. |
| 234 // Dest register ends at the position after the last character written. |
| 235 static void GenerateCopyCharacters(MacroAssembler* masm, |
| 236 Register dest, |
| 237 Register src, |
| 238 Register count, |
| 239 Register scratch, |
| 240 bool ascii); |
| 241 |
| 242 // Generate code for copying a large number of characters. This function |
| 243 // is allowed to spend extra time setting up conditions to make copying |
| 244 // faster. Copying of overlapping regions is not supported. |
| 245 // Dest register ends at the position after the last character written. |
| 246 static void GenerateCopyCharactersLong(MacroAssembler* masm, |
| 247 Register dest, |
| 248 Register src, |
| 249 Register count, |
| 250 Register scratch1, |
| 251 Register scratch2, |
| 252 Register scratch3, |
| 253 Register scratch4, |
| 254 Register scratch5, |
| 255 int flags); |
| 256 |
| 257 |
| 258 // Probe the symbol table for a two character string. If the string is |
| 259 // not found by probing a jump to the label not_found is performed. This jump |
| 260 // does not guarantee that the string is not in the symbol table. If the |
| 261 // string is found the code falls through with the string in register r0. |
| 262 // Contents of both c1 and c2 registers are modified. At the exit c1 is |
| 263 // guaranteed to contain halfword with low and high bytes equal to |
| 264 // initial contents of c1 and c2 respectively. |
| 265 static void GenerateTwoCharacterSymbolTableProbe(MacroAssembler* masm, |
| 266 Register c1, |
| 267 Register c2, |
| 268 Register scratch1, |
| 269 Register scratch2, |
| 270 Register scratch3, |
| 271 Register scratch4, |
| 272 Register scratch5, |
| 273 Label* not_found); |
| 274 |
| 275 // Generate string hash. |
| 276 static void GenerateHashInit(MacroAssembler* masm, |
| 277 Register hash, |
| 278 Register character); |
| 279 |
| 280 static void GenerateHashAddCharacter(MacroAssembler* masm, |
| 281 Register hash, |
| 282 Register character); |
| 283 |
| 284 static void GenerateHashGetHash(MacroAssembler* masm, |
| 285 Register hash); |
| 286 |
| 287 private: |
| 288 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); |
| 289 }; |
| 290 |
| 291 |
228 // Flag that indicates how to generate code for the stub StringAddStub. | 292 // Flag that indicates how to generate code for the stub StringAddStub. |
229 enum StringAddFlags { | 293 enum StringAddFlags { |
230 NO_STRING_ADD_FLAGS = 0, | 294 NO_STRING_ADD_FLAGS = 0, |
231 // Omit left string check in stub (left is definitely a string). | 295 // Omit left string check in stub (left is definitely a string). |
232 NO_STRING_CHECK_LEFT_IN_STUB = 1 << 0, | 296 NO_STRING_CHECK_LEFT_IN_STUB = 1 << 0, |
233 // Omit right string check in stub (right is definitely a string). | 297 // Omit right string check in stub (right is definitely a string). |
234 NO_STRING_CHECK_RIGHT_IN_STUB = 1 << 1, | 298 NO_STRING_CHECK_RIGHT_IN_STUB = 1 << 1, |
235 // Omit both string checks in stub. | 299 // Omit both string checks in stub. |
236 NO_STRING_CHECK_IN_STUB = | 300 NO_STRING_CHECK_IN_STUB = |
237 NO_STRING_CHECK_LEFT_IN_STUB | NO_STRING_CHECK_RIGHT_IN_STUB | 301 NO_STRING_CHECK_LEFT_IN_STUB | NO_STRING_CHECK_RIGHT_IN_STUB |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 | 659 |
596 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 660 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
597 | 661 |
598 LookupMode mode_; | 662 LookupMode mode_; |
599 }; | 663 }; |
600 | 664 |
601 | 665 |
602 } } // namespace v8::internal | 666 } } // namespace v8::internal |
603 | 667 |
604 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 668 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
OLD | NEW |