OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 __ push(rax); // receiver | 599 __ push(rax); // receiver |
600 __ push(rcx); // name | 600 __ push(rcx); // name |
601 __ push(rbx); // return address | 601 __ push(rbx); // return address |
602 | 602 |
603 // Perform tail call to the entry. | 603 // Perform tail call to the entry. |
604 __ TailCallRuntime(f, 2); | 604 __ TailCallRuntime(f, 2); |
605 } | 605 } |
606 | 606 |
607 | 607 |
608 void LoadIC::GenerateArrayLength(MacroAssembler* masm) { | 608 void LoadIC::GenerateArrayLength(MacroAssembler* masm) { |
609 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); | 609 // ----------- S t a t e ------------- |
| 610 // -- rcx : name |
| 611 // -- rsp[0] : return address |
| 612 // -- rsp[8] : receiver |
| 613 // ----------------------------------- |
| 614 |
| 615 Label miss; |
| 616 |
| 617 __ movq(rax, Operand(rsp, kPointerSize)); |
| 618 |
| 619 StubCompiler::GenerateLoadArrayLength(masm, rax, rdx, &miss); |
| 620 __ bind(&miss); |
| 621 StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC); |
610 } | 622 } |
611 | 623 |
| 624 |
612 void LoadIC::GenerateFunctionPrototype(MacroAssembler* masm) { | 625 void LoadIC::GenerateFunctionPrototype(MacroAssembler* masm) { |
613 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); | 626 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); |
614 } | 627 } |
615 | 628 |
616 | 629 |
617 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { | 630 void LoadIC::GenerateMegamorphic(MacroAssembler* masm) { |
618 // ----------- S t a t e ------------- | 631 // ----------- S t a t e ------------- |
619 // -- rcx : name | 632 // -- rcx : name |
620 // -- rsp[0] : return address | 633 // -- rsp[0] : return address |
621 // -- rsp[8] : receiver | 634 // -- rsp[8] : receiver |
(...skipping 21 matching lines...) Expand all Loading... |
643 | 656 |
644 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); | 657 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); |
645 } | 658 } |
646 | 659 |
647 void LoadIC::GenerateNormal(MacroAssembler* masm) { | 660 void LoadIC::GenerateNormal(MacroAssembler* masm) { |
648 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); | 661 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); |
649 } | 662 } |
650 | 663 |
651 | 664 |
652 void LoadIC::GenerateStringLength(MacroAssembler* masm) { | 665 void LoadIC::GenerateStringLength(MacroAssembler* masm) { |
653 Generate(masm, ExternalReference(IC_Utility(kLoadIC_Miss))); | 666 // ----------- S t a t e ------------- |
| 667 // -- rcx : name |
| 668 // -- rsp[0] : return address |
| 669 // -- rsp[8] : receiver |
| 670 // ----------------------------------- |
| 671 |
| 672 Label miss; |
| 673 |
| 674 __ movq(rax, Operand(rsp, kPointerSize)); |
| 675 |
| 676 StubCompiler::GenerateLoadStringLength(masm, rax, rdx, &miss); |
| 677 __ bind(&miss); |
| 678 StubCompiler::GenerateLoadMiss(masm, Code::LOAD_IC); |
654 } | 679 } |
655 | 680 |
656 | 681 |
| 682 |
657 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { | 683 bool LoadIC::PatchInlinedLoad(Address address, Object* map, int offset) { |
658 // The address of the instruction following the call. | 684 // The address of the instruction following the call. |
659 Address test_instruction_address = | 685 Address test_instruction_address = |
660 address + Assembler::kTargetAddrToReturnAddrDist; | 686 address + Assembler::kTargetAddrToReturnAddrDist; |
661 // If the instruction following the call is not a test eax, nothing | 687 // If the instruction following the call is not a test eax, nothing |
662 // was inlined. | 688 // was inlined. |
663 if (*test_instruction_address != kTestEaxByte) return false; | 689 if (*test_instruction_address != kTestEaxByte) return false; |
664 | 690 |
665 Address delta_address = test_instruction_address + 1; | 691 Address delta_address = test_instruction_address + 1; |
666 // The delta to the start of the map check instruction. | 692 // The delta to the start of the map check instruction. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 | 745 |
720 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { | 746 void StoreIC::GenerateMegamorphic(MacroAssembler* masm) { |
721 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); | 747 Generate(masm, ExternalReference(IC_Utility(kStoreIC_Miss))); |
722 } | 748 } |
723 | 749 |
724 | 750 |
725 #undef __ | 751 #undef __ |
726 | 752 |
727 | 753 |
728 } } // namespace v8::internal | 754 } } // namespace v8::internal |
OLD | NEW |