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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 } else { | 522 } else { |
523 PrintF("GenericBinaryOpStub (%s by %d)\n", | 523 PrintF("GenericBinaryOpStub (%s by %d)\n", |
524 Token::String(op_), | 524 Token::String(op_), |
525 constant_rhs_); | 525 constant_rhs_); |
526 } | 526 } |
527 } | 527 } |
528 #endif | 528 #endif |
529 }; | 529 }; |
530 | 530 |
531 | 531 |
| 532 class StringStubBase: public CodeStub { |
| 533 public: |
| 534 // Generate code for copying characters using a simple loop. This should only |
| 535 // be used in places where the number of characters is small and the |
| 536 // additional setup and checking in GenerateCopyCharactersLong adds too much |
| 537 // overhead. Copying of overlapping regions is not supported. |
| 538 void GenerateCopyCharacters(MacroAssembler* masm, |
| 539 Register dest, |
| 540 Register src, |
| 541 Register count, |
| 542 Register scratch, |
| 543 bool ascii); |
| 544 |
| 545 // Generate code for copying a large number of characters. This function |
| 546 // is allowed to spend extra time setting up conditions to make copying |
| 547 // faster. Copying of overlapping regions is not supported. |
| 548 void GenerateCopyCharactersLong(MacroAssembler* masm, |
| 549 Register dest, |
| 550 Register src, |
| 551 Register count, |
| 552 Register scratch1, |
| 553 Register scratch2, |
| 554 Register scratch3, |
| 555 Register scratch4, |
| 556 Register scratch5, |
| 557 int flags); |
| 558 }; |
| 559 |
| 560 |
| 561 // Flag that indicates how to generate code for the stub StringAddStub. |
| 562 enum StringAddFlags { |
| 563 NO_STRING_ADD_FLAGS = 0, |
| 564 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. |
| 565 }; |
| 566 |
| 567 |
| 568 class SubStringStub: public StringStubBase { |
| 569 public: |
| 570 SubStringStub() {} |
| 571 |
| 572 private: |
| 573 Major MajorKey() { return SubString; } |
| 574 int MinorKey() { return 0; } |
| 575 |
| 576 void Generate(MacroAssembler* masm); |
| 577 }; |
| 578 |
| 579 |
| 580 |
532 class StringCompareStub: public CodeStub { | 581 class StringCompareStub: public CodeStub { |
533 public: | 582 public: |
534 StringCompareStub() { } | 583 StringCompareStub() { } |
535 | 584 |
536 // Compare two flat ASCII strings and returns result in r0. | 585 // Compare two flat ASCII strings and returns result in r0. |
537 // Does not use the stack. | 586 // Does not use the stack. |
538 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 587 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
539 Register left, | 588 Register left, |
540 Register right, | 589 Register right, |
541 Register scratch1, | 590 Register scratch1, |
542 Register scratch2, | 591 Register scratch2, |
543 Register scratch3, | 592 Register scratch3, |
544 Register scratch4); | 593 Register scratch4); |
545 | 594 |
546 private: | 595 private: |
547 Major MajorKey() { return StringCompare; } | 596 Major MajorKey() { return StringCompare; } |
548 int MinorKey() { return 0; } | 597 int MinorKey() { return 0; } |
549 | 598 |
550 void Generate(MacroAssembler* masm); | 599 void Generate(MacroAssembler* masm); |
551 }; | 600 }; |
552 | 601 |
553 | 602 |
554 } } // namespace v8::internal | 603 } } // namespace v8::internal |
555 | 604 |
556 #endif // V8_ARM_CODEGEN_ARM_H_ | 605 #endif // V8_ARM_CODEGEN_ARM_H_ |
OLD | NEW |