Changeset 55564 in webkit for trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
- Timestamp:
- Mar 4, 2010, 5:33:54 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
r55198 r55564 697 697 } 698 698 699 void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, bool isGetter, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)699 void JIT::privateCompileGetByIdProto(StructureStubInfo* stubInfo, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame) 700 700 { 701 701 // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is … … 715 715 #endif 716 716 717 bool needsStubLink = false; 718 717 719 // Checks out okay! 718 if (isGetter) { 720 if (slot.cachedPropertyType() == PropertySlot::Getter) { 721 needsStubLink = true; 719 722 compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset); 720 723 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); … … 723 726 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 724 727 stubCall.call(); 728 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 729 needsStubLink = true; 730 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 731 stubCall.addArgument(ImmPtr(protoObject)); 732 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 733 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 734 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 735 stubCall.call(); 725 736 } else 726 737 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); … … 736 747 patchBuffer.link(success, stubInfo->hotPathBegin.labelAtOffset(patchOffsetGetByIdPutResult)); 737 748 738 if ( isGetter) {749 if (needsStubLink) { 739 750 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 740 751 if (iter->to) … … 755 766 } 756 767 757 void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, bool isGetter, size_t cachedOffset)768 void JIT::privateCompileGetByIdSelfList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* polymorphicStructures, int currentIndex, Structure* structure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset) 758 769 { 759 770 Jump failureCase = checkStructure(regT0, structure); 760 if (isGetter) { 771 bool needsStubLink = false; 772 if (slot.cachedPropertyType() == PropertySlot::Getter) { 773 needsStubLink = true; 761 774 if (!structure->isUsingInlineStorage()) { 762 775 move(regT0, regT1); … … 769 782 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 770 783 stubCall.call(); 784 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 785 needsStubLink = true; 786 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 787 stubCall.addArgument(regT0); 788 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 789 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 790 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 791 stubCall.call(); 771 792 } else 772 793 compileGetDirectOffset(regT0, regT0, structure, cachedOffset); … … 775 796 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 776 797 777 if ( isGetter) {798 if (needsStubLink) { 778 799 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 779 800 if (iter->to) … … 803 824 } 804 825 805 void JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, Structure* prototypeStructure, bool isGetter, size_t cachedOffset, CallFrame* callFrame)826 void JIT::privateCompileGetByIdProtoList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, Structure* prototypeStructure, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, CallFrame* callFrame) 806 827 { 807 828 // The prototype object definitely exists (if this stub exists the CodeBlock is referencing a Structure that is … … 822 843 823 844 // Checks out okay! 824 if (isGetter) { 845 bool needsStubLink = false; 846 if (slot.cachedPropertyType() == PropertySlot::Getter) { 847 needsStubLink = true; 825 848 compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset); 826 849 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); … … 829 852 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 830 853 stubCall.call(); 854 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 855 needsStubLink = true; 856 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 857 stubCall.addArgument(ImmPtr(protoObject)); 858 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 859 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 860 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 861 stubCall.call(); 831 862 } else 832 863 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); … … 836 867 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 837 868 838 if ( isGetter) {869 if (needsStubLink) { 839 870 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 840 871 if (iter->to) … … 863 894 } 864 895 865 void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, StructureChain* chain, size_t count, bool isGetter, size_t cachedOffset, CallFrame* callFrame)896 void JIT::privateCompileGetByIdChainList(StructureStubInfo* stubInfo, PolymorphicAccessStructureList* prototypeStructures, int currentIndex, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, CallFrame* callFrame) 866 897 { 867 898 ASSERT(count); … … 890 921 ASSERT(protoObject); 891 922 892 if (isGetter) { 923 bool needsStubLink = false; 924 if (slot.cachedPropertyType() == PropertySlot::Getter) { 925 needsStubLink = true; 893 926 compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset); 894 927 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); … … 897 930 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 898 931 stubCall.call(); 932 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 933 needsStubLink = true; 934 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 935 stubCall.addArgument(ImmPtr(protoObject)); 936 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 937 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 938 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 939 stubCall.call(); 899 940 } else 900 941 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); … … 903 944 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 904 945 905 if ( isGetter) {946 if (needsStubLink) { 906 947 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 907 948 if (iter->to) … … 931 972 } 932 973 933 void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, bool isGetter, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame)974 void JIT::privateCompileGetByIdChain(StructureStubInfo* stubInfo, Structure* structure, StructureChain* chain, size_t count, const Identifier& ident, const PropertySlot& slot, size_t cachedOffset, ReturnAddressPtr returnAddress, CallFrame* callFrame) 934 975 { 935 976 ASSERT(count); … … 957 998 } 958 999 ASSERT(protoObject); 959 960 if (isGetter) { 1000 1001 bool needsStubLink = false; 1002 if (slot.cachedPropertyType() == PropertySlot::Getter) { 1003 needsStubLink = true; 961 1004 compileGetDirectOffset(protoObject, regT1, regT1, cachedOffset); 962 1005 JITStubCall stubCall(this, cti_op_get_by_id_getter_stub); … … 965 1008 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 966 1009 stubCall.call(); 1010 } else if (slot.cachedPropertyType() == PropertySlot::Custom) { 1011 needsStubLink = true; 1012 JITStubCall stubCall(this, cti_op_get_by_id_custom_stub); 1013 stubCall.addArgument(ImmPtr(protoObject)); 1014 stubCall.addArgument(ImmPtr(FunctionPtr(slot.customGetter()).executableAddress())); 1015 stubCall.addArgument(ImmPtr(const_cast<Identifier*>(&ident))); 1016 stubCall.addArgument(ImmPtr(stubInfo->callReturnLocation.executableAddress())); 1017 stubCall.call(); 967 1018 } else 968 1019 compileGetDirectOffset(protoObject, regT1, regT0, cachedOffset); … … 971 1022 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 972 1023 973 if ( isGetter) {1024 if (needsStubLink) { 974 1025 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { 975 1026 if (iter->to)
Note:
See TracChangeset
for help on using the changeset viewer.