| 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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 #endif | 530 #endif |
| 531 }; | 531 }; |
| 532 | 532 |
| 533 | 533 |
| 534 class StringStubBase: public CodeStub { | 534 class StringStubBase: public CodeStub { |
| 535 public: | 535 public: |
| 536 // Generate code for copying characters using a simple loop. This should only | 536 // Generate code for copying characters using a simple loop. This should only |
| 537 // be used in places where the number of characters is small and the | 537 // be used in places where the number of characters is small and the |
| 538 // additional setup and checking in GenerateCopyCharactersLong adds too much | 538 // additional setup and checking in GenerateCopyCharactersLong adds too much |
| 539 // overhead. Copying of overlapping regions is not supported. | 539 // overhead. Copying of overlapping regions is not supported. |
| 540 // Dest register ends at the position after the last character written. |
| 540 void GenerateCopyCharacters(MacroAssembler* masm, | 541 void GenerateCopyCharacters(MacroAssembler* masm, |
| 541 Register dest, | 542 Register dest, |
| 542 Register src, | 543 Register src, |
| 543 Register count, | 544 Register count, |
| 544 Register scratch, | 545 Register scratch, |
| 545 bool ascii); | 546 bool ascii); |
| 546 | 547 |
| 547 // Generate code for copying a large number of characters. This function | 548 // Generate code for copying a large number of characters. This function |
| 548 // is allowed to spend extra time setting up conditions to make copying | 549 // is allowed to spend extra time setting up conditions to make copying |
| 549 // faster. Copying of overlapping regions is not supported. | 550 // faster. Copying of overlapping regions is not supported. |
| 551 // Dest register ends at the position after the last character written. |
| 550 void GenerateCopyCharactersLong(MacroAssembler* masm, | 552 void GenerateCopyCharactersLong(MacroAssembler* masm, |
| 551 Register dest, | 553 Register dest, |
| 552 Register src, | 554 Register src, |
| 553 Register count, | 555 Register count, |
| 554 Register scratch1, | 556 Register scratch1, |
| 555 Register scratch2, | 557 Register scratch2, |
| 556 Register scratch3, | 558 Register scratch3, |
| 557 Register scratch4, | 559 Register scratch4, |
| 558 Register scratch5, | 560 Register scratch5, |
| 559 int flags); | 561 int flags); |
| 560 }; | 562 }; |
| 561 | 563 |
| 562 | 564 |
| 563 // Flag that indicates how to generate code for the stub StringAddStub. | 565 // Flag that indicates how to generate code for the stub StringAddStub. |
| 564 enum StringAddFlags { | 566 enum StringAddFlags { |
| 565 NO_STRING_ADD_FLAGS = 0, | 567 NO_STRING_ADD_FLAGS = 0, |
| 566 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. | 568 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. |
| 567 }; | 569 }; |
| 568 | 570 |
| 569 | 571 |
| 572 class StringAddStub: public StringStubBase { |
| 573 public: |
| 574 explicit StringAddStub(StringAddFlags flags) { |
| 575 string_check_ = ((flags & NO_STRING_CHECK_IN_STUB) == 0); |
| 576 } |
| 577 |
| 578 private: |
| 579 Major MajorKey() { return StringAdd; } |
| 580 int MinorKey() { return string_check_ ? 0 : 1; } |
| 581 |
| 582 void Generate(MacroAssembler* masm); |
| 583 |
| 584 // Should the stub check whether arguments are strings? |
| 585 bool string_check_; |
| 586 }; |
| 587 |
| 588 |
| 570 class SubStringStub: public StringStubBase { | 589 class SubStringStub: public StringStubBase { |
| 571 public: | 590 public: |
| 572 SubStringStub() {} | 591 SubStringStub() {} |
| 573 | 592 |
| 574 private: | 593 private: |
| 575 Major MajorKey() { return SubString; } | 594 Major MajorKey() { return SubString; } |
| 576 int MinorKey() { return 0; } | 595 int MinorKey() { return 0; } |
| 577 | 596 |
| 578 void Generate(MacroAssembler* masm); | 597 void Generate(MacroAssembler* masm); |
| 579 }; | 598 }; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 598 Major MajorKey() { return StringCompare; } | 617 Major MajorKey() { return StringCompare; } |
| 599 int MinorKey() { return 0; } | 618 int MinorKey() { return 0; } |
| 600 | 619 |
| 601 void Generate(MacroAssembler* masm); | 620 void Generate(MacroAssembler* masm); |
| 602 }; | 621 }; |
| 603 | 622 |
| 604 | 623 |
| 605 } } // namespace v8::internal | 624 } } // namespace v8::internal |
| 606 | 625 |
| 607 #endif // V8_ARM_CODEGEN_ARM_H_ | 626 #endif // V8_ARM_CODEGEN_ARM_H_ |
| OLD | NEW |