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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 237 |
238 virtual void FinishCode(Code* code) { | 238 virtual void FinishCode(Code* code) { |
239 code->set_binary_op_type(operands_type_); | 239 code->set_binary_op_type(operands_type_); |
240 code->set_binary_op_result_type(result_type_); | 240 code->set_binary_op_result_type(result_type_); |
241 } | 241 } |
242 | 242 |
243 friend class CodeGenerator; | 243 friend class CodeGenerator; |
244 }; | 244 }; |
245 | 245 |
246 | 246 |
| 247 class StringHelper : public AllStatic { |
| 248 public: |
| 249 // Generate code for copying characters using a simple loop. This should only |
| 250 // be used in places where the number of characters is small and the |
| 251 // additional setup and checking in GenerateCopyCharactersLong adds too much |
| 252 // overhead. Copying of overlapping regions is not supported. |
| 253 // Dest register ends at the position after the last character written. |
| 254 static void GenerateCopyCharacters(MacroAssembler* masm, |
| 255 Register dest, |
| 256 Register src, |
| 257 Register count, |
| 258 Register scratch, |
| 259 bool ascii); |
| 260 |
| 261 // Generate code for copying a large number of characters. This function |
| 262 // is allowed to spend extra time setting up conditions to make copying |
| 263 // faster. Copying of overlapping regions is not supported. |
| 264 // Dest register ends at the position after the last character written. |
| 265 static void GenerateCopyCharactersLong(MacroAssembler* masm, |
| 266 Register dest, |
| 267 Register src, |
| 268 Register count, |
| 269 Register scratch1, |
| 270 Register scratch2, |
| 271 Register scratch3, |
| 272 Register scratch4, |
| 273 Register scratch5, |
| 274 int flags); |
| 275 |
| 276 |
| 277 // Probe the symbol table for a two character string. If the string is |
| 278 // not found by probing a jump to the label not_found is performed. This jump |
| 279 // does not guarantee that the string is not in the symbol table. If the |
| 280 // string is found the code falls through with the string in register r0. |
| 281 // Contents of both c1 and c2 registers are modified. At the exit c1 is |
| 282 // guaranteed to contain halfword with low and high bytes equal to |
| 283 // initial contents of c1 and c2 respectively. |
| 284 static void GenerateTwoCharacterSymbolTableProbe(MacroAssembler* masm, |
| 285 Register c1, |
| 286 Register c2, |
| 287 Register scratch1, |
| 288 Register scratch2, |
| 289 Register scratch3, |
| 290 Register scratch4, |
| 291 Register scratch5, |
| 292 Label* not_found); |
| 293 |
| 294 // Generate string hash. |
| 295 static void GenerateHashInit(MacroAssembler* masm, |
| 296 Register hash, |
| 297 Register character); |
| 298 |
| 299 static void GenerateHashAddCharacter(MacroAssembler* masm, |
| 300 Register hash, |
| 301 Register character); |
| 302 |
| 303 static void GenerateHashGetHash(MacroAssembler* masm, |
| 304 Register hash); |
| 305 |
| 306 private: |
| 307 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); |
| 308 }; |
| 309 |
| 310 |
247 // Flag that indicates how to generate code for the stub StringAddStub. | 311 // Flag that indicates how to generate code for the stub StringAddStub. |
248 enum StringAddFlags { | 312 enum StringAddFlags { |
249 NO_STRING_ADD_FLAGS = 0, | 313 NO_STRING_ADD_FLAGS = 0, |
250 // Omit left string check in stub (left is definitely a string). | 314 // Omit left string check in stub (left is definitely a string). |
251 NO_STRING_CHECK_LEFT_IN_STUB = 1 << 0, | 315 NO_STRING_CHECK_LEFT_IN_STUB = 1 << 0, |
252 // Omit right string check in stub (right is definitely a string). | 316 // Omit right string check in stub (right is definitely a string). |
253 NO_STRING_CHECK_RIGHT_IN_STUB = 1 << 1, | 317 NO_STRING_CHECK_RIGHT_IN_STUB = 1 << 1, |
254 // Omit both string checks in stub. | 318 // Omit both string checks in stub. |
255 NO_STRING_CHECK_IN_STUB = | 319 NO_STRING_CHECK_IN_STUB = |
256 NO_STRING_CHECK_LEFT_IN_STUB | NO_STRING_CHECK_RIGHT_IN_STUB | 320 NO_STRING_CHECK_LEFT_IN_STUB | NO_STRING_CHECK_RIGHT_IN_STUB |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
830 | 894 |
831 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 895 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
832 | 896 |
833 LookupMode mode_; | 897 LookupMode mode_; |
834 }; | 898 }; |
835 | 899 |
836 | 900 |
837 } } // namespace v8::internal | 901 } } // namespace v8::internal |
838 | 902 |
839 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 903 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
OLD | NEW |