OLD | NEW |
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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 code->set_type_recording_binary_op_result_type(result_type_); | 328 code->set_type_recording_binary_op_result_type(result_type_); |
329 } | 329 } |
330 | 330 |
331 friend class CodeGenerator; | 331 friend class CodeGenerator; |
332 }; | 332 }; |
333 | 333 |
334 | 334 |
335 // Flag that indicates how to generate code for the stub StringAddStub. | 335 // Flag that indicates how to generate code for the stub StringAddStub. |
336 enum StringAddFlags { | 336 enum StringAddFlags { |
337 NO_STRING_ADD_FLAGS = 0, | 337 NO_STRING_ADD_FLAGS = 0, |
338 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. | 338 // Omit left string check in stub (left is definitely a string). |
| 339 NO_STRING_CHECK_LEFT_IN_STUB = 1 << 0, |
| 340 // Omit right string check in stub (right is definitely a string). |
| 341 NO_STRING_CHECK_RIGHT_IN_STUB = 1 << 1, |
| 342 // Omit both string checks in stub. |
| 343 NO_STRING_CHECK_IN_STUB = |
| 344 NO_STRING_CHECK_LEFT_IN_STUB | NO_STRING_CHECK_RIGHT_IN_STUB |
339 }; | 345 }; |
340 | 346 |
341 | 347 |
342 class StringAddStub: public CodeStub { | 348 class StringAddStub: public CodeStub { |
343 public: | 349 public: |
344 explicit StringAddStub(StringAddFlags flags) { | 350 explicit StringAddStub(StringAddFlags flags) : flags_(flags) {} |
345 string_check_ = ((flags & NO_STRING_CHECK_IN_STUB) == 0); | |
346 } | |
347 | 351 |
348 private: | 352 private: |
349 Major MajorKey() { return StringAdd; } | 353 Major MajorKey() { return StringAdd; } |
350 int MinorKey() { return string_check_ ? 0 : 1; } | 354 int MinorKey() { return flags_; } |
351 | 355 |
352 void Generate(MacroAssembler* masm); | 356 void Generate(MacroAssembler* masm); |
353 | 357 |
354 // Should the stub check whether arguments are strings? | 358 void GenerateConvertArgument(MacroAssembler* masm, |
355 bool string_check_; | 359 int stack_offset, |
| 360 Register arg, |
| 361 Register scratch1, |
| 362 Register scratch2, |
| 363 Register scratch3, |
| 364 Register scratch4, |
| 365 Label* slow); |
| 366 |
| 367 const StringAddFlags flags_; |
356 }; | 368 }; |
357 | 369 |
358 | 370 |
359 class SubStringStub: public CodeStub { | 371 class SubStringStub: public CodeStub { |
360 public: | 372 public: |
361 SubStringStub() {} | 373 SubStringStub() {} |
362 | 374 |
363 private: | 375 private: |
364 Major MajorKey() { return SubString; } | 376 Major MajorKey() { return SubString; } |
365 int MinorKey() { return 0; } | 377 int MinorKey() { return 0; } |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 bool load_elements_from_receiver, | 648 bool load_elements_from_receiver, |
637 bool load_elements_map_from_elements, | 649 bool load_elements_map_from_elements, |
638 Label* key_not_smi, | 650 Label* key_not_smi, |
639 Label* value_not_smi, | 651 Label* value_not_smi, |
640 Label* not_pixel_array, | 652 Label* not_pixel_array, |
641 Label* out_of_range); | 653 Label* out_of_range); |
642 | 654 |
643 } } // namespace v8::internal | 655 } } // namespace v8::internal |
644 | 656 |
645 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 657 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
OLD | NEW |