Changeset 55185 in webkit for trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
- Timestamp:
- Feb 24, 2010, 1:02:40 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
r55027 r55185 33 33 34 34 #include "CodeBlock.h" 35 #include "GetterSetter.h" 35 36 #include "JITInlineMethods.h" 36 37 #include "JITStubCall.h" … … 696 697 } 697 698 698 void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)699 void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, bool isGetter, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame) 699 700 { 700 701 // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is … … 714 715 #endif 715 716 716 // Checks out okay! - getDirectOffset 717 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); 718 717 // Checks out okay! 718 if (isGetter) { 719 compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset); 720 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); 721 stubCall.addArgument(regT1); 722 stubCall.addArgument(regT0); 723 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 724 stubCall.call(); 725 } else 726 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); 719 727 Jump success = jump(); 720 721 728 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 722 729 … … 729 736 patchBuffer.link(success, stubInfo->hotPathBegin.labelAtOffset(patchOffsetGetByIdPutResult)); 730 737 738 if (isGetter) { 739 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 740 if (iter->to) 741 patchBuffer.link(iter->from, FunctionPtr(iter->to)); 742 } 743 } 731 744 // Track the stub we have created so that it will be deleted later. 732 745 CodeLocationLabel entryLabel = patchBuffer.finalizeCodeAddendum(); … … 742 755 } 743 756 744 void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, size_t cachedOffset)757 void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, bool isGetter, size_t cachedOffset) 745 758 { 746 759 Jump failureCase = checkStructure(regT0, structure); 747 compileGetDirectOffset(regT0, regT0, structure, cachedOffset); 760 if (isGetter) { 761 compileGetDirectOffset(regT0, regT1, structure, cachedOffset); 762 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); 763 stubCall.addArgument(regT1); 764 stubCall.addArgument(regT0); 765 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 766 stubCall.call(); 767 } else 768 compileGetDirectOffset(regT0, regT0, structure, cachedOffset); 748 769 Jump success = jump(); 749 770 750 771 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 772 773 if (isGetter) { 774 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 775 if (iter->to) 776 patchBuffer.link(iter->from, FunctionPtr(iter->to)); 777 } 778 } 751 779 752 780 // Use the patch information to link the failure cases back to the original slow case routine. … … 771 799 } 772 800 773 void JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, Structure* prototypeStructure, size_t cachedOffset, CallFrame* callFrame)801 void JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, Structure* prototypeStructure, bool isGetter, size_t cachedOffset, CallFrame* callFrame) 774 802 { 775 803 // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is … … 789 817 #endif 790 818 791 // Checks out okay! - getDirectOffset 792 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); 819 // Checks out okay! 820 if (isGetter) { 821 compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset); 822 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); 823 stubCall.addArgument(regT1); 824 stubCall.addArgument(regT0); 825 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 826 stubCall.call(); 827 } else 828 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); 793 829 794 830 Jump success = jump(); 795 831 796 832 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 833 834 if (isGetter) { 835 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 836 if (iter->to) 837 patchBuffer.link(iter->from, FunctionPtr(iter->to)); 838 } 839 } 797 840 798 841 // Use the patch information to link the failure cases back to the original slow case routine. … … 816 859 } 817 860 818 void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset, CallFrame* callFrame)861 void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, StructureChain* chain, size_t count, bool isGetter, size_t cachedOffset, CallFrame* callFrame) 819 862 { 820 863 ASSERT(count); 821 822 864 JumpList bucketsOfFail; 823 865 … … 843 885 } 844 886 ASSERT(protoObject); 845 846 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); 887 888 if (isGetter) { 889 compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset); 890 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); 891 stubCall.addArgument(regT1); 892 stubCall.addArgument(regT0); 893 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 894 stubCall.call(); 895 } else 896 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); 847 897 Jump success = jump(); 848 898 849 899 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 900 901 if (isGetter) { 902 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 903 if (iter->to) 904 patchBuffer.link(iter->from, FunctionPtr(iter->to)); 905 } 906 } 850 907 851 908 // Use the patch information to link the failure cases back to the original slow case routine. … … 870 927 } 871 928 872 void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)929 void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, bool isGetter, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame) 873 930 { 874 931 ASSERT(count); 875 932 876 933 JumpList bucketsOfFail; 877 934 … … 896 953 } 897 954 ASSERT(protoObject); 898 899 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); 955 956 if (isGetter) { 957 compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset); 958 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); 959 stubCall.addArgument(regT1); 960 stubCall.addArgument(regT0); 961 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 962 stubCall.call(); 963 } else 964 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); 900 965 Jump success = jump(); 901 966 902 967 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 968 969 if (isGetter) { 970 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 971 if (iter->to) 972 patchBuffer.link(iter->from, FunctionPtr(iter->to)); 973 } 974 } 903 975 904 976 // Use the patch information to link the failure cases back to the original slow case routine.
Note:
See TracChangeset
for help on using the changeset viewer.