Changeset 190675 in webkit
- Timestamp:
- Oct 7, 2015 11:26:19 AM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r190673 r190675 1 2015-10-07 Filip Pizlo <fpizlo@apple.com> 2 3 JIT::emitGetGlobalProperty/emitPutGlobalProperty are only called from one place 4 https://bugs.webkit.org/show_bug.cgi?id=149879 5 6 Reviewed by Saam Barati. 7 8 To simplify my work to insert barriers on loads of the butterfly, I want to reduce the amount 9 of abstraction we have around code that loads the butterfly. 10 11 * jit/JIT.h: 12 * jit/JITPropertyAccess.cpp: 13 (JSC::JIT::emitLoadWithStructureCheck): 14 (JSC::JIT::emitGetVarFromPointer): 15 (JSC::JIT::emit_op_get_from_scope): 16 (JSC::JIT::emitSlow_op_get_from_scope): 17 (JSC::JIT::emitPutGlobalVariable): 18 (JSC::JIT::emit_op_put_to_scope): 19 (JSC::JIT::emitGetGlobalProperty): Deleted. 20 (JSC::JIT::emitPutGlobalProperty): Deleted. 21 * jit/JITPropertyAccess32_64.cpp: 22 (JSC::JIT::emitLoadWithStructureCheck): 23 (JSC::JIT::emitGetVarFromPointer): 24 (JSC::JIT::emit_op_get_from_scope): 25 (JSC::JIT::emitSlow_op_get_from_scope): 26 (JSC::JIT::emitPutGlobalVariable): 27 (JSC::JIT::emit_op_put_to_scope): 28 (JSC::JIT::emitGetGlobalProperty): Deleted. 29 (JSC::JIT::emitPutGlobalProperty): Deleted. 30 1 31 2015-10-07 Filip Pizlo <fpizlo@apple.com> 2 32 -
trunk/Source/JavaScriptCore/jit/JIT.h
r190673 r190675 669 669 void emitResolveClosure(int dst, int scope, bool needsVarInjectionChecks, unsigned depth); 670 670 void emitLoadWithStructureCheck(int scope, Structure** structureSlot); 671 void emitGetGlobalProperty(uintptr_t* operandSlot);672 671 #if USE(JSVALUE64) 673 672 void emitGetVarFromPointer(JSValue* operand, GPRReg); … … 678 677 #endif 679 678 void emitGetClosureVar(int scope, uintptr_t operand); 680 void emitPutGlobalProperty(uintptr_t* operandSlot, int value);681 679 void emitNotifyWrite(WatchpointSet*); 682 680 void emitNotifyWrite(GPRReg pointerToSet); -
trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
r190673 r190675 755 755 } 756 756 757 void JIT::emitGetGlobalProperty(uintptr_t* operandSlot)758 {759 GPRReg base = regT0;760 GPRReg result = regT0;761 GPRReg offset = regT1;762 GPRReg scratch = regT2;763 764 load32(operandSlot, offset);765 if (!ASSERT_DISABLED) {766 Jump isOutOfLine = branch32(GreaterThanOrEqual, offset, TrustedImm32(firstOutOfLineOffset));767 abortWithReason(JITOffsetIsNotOutOfLine);768 isOutOfLine.link(this);769 }770 loadPtr(Address(base, JSObject::butterflyOffset()), scratch);771 neg32(offset);772 signExtend32ToPtr(offset, offset);773 load64(BaseIndex(scratch, offset, TimesEight, (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue)), result);774 }775 776 757 void JIT::emitGetVarFromPointer(JSValue* operand, GPRReg reg) 777 758 { … … 802 783 switch (resolveType) { 803 784 case GlobalProperty: 804 case GlobalPropertyWithVarInjectionChecks: 785 case GlobalPropertyWithVarInjectionChecks: { 805 786 emitLoadWithStructureCheck(scope, structureSlot); // Structure check covers var injection. 806 emitGetGlobalProperty(operandSlot); 787 GPRReg base = regT0; 788 GPRReg result = regT0; 789 GPRReg offset = regT1; 790 GPRReg scratch = regT2; 791 792 load32(operandSlot, offset); 793 if (!ASSERT_DISABLED) { 794 Jump isOutOfLine = branch32(GreaterThanOrEqual, offset, TrustedImm32(firstOutOfLineOffset)); 795 abortWithReason(JITOffsetIsNotOutOfLine); 796 isOutOfLine.link(this); 797 } 798 loadPtr(Address(base, JSObject::butterflyOffset()), scratch); 799 neg32(offset); 800 signExtend32ToPtr(offset, offset); 801 load64(BaseIndex(scratch, offset, TimesEight, (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue)), result); 807 802 break; 803 } 808 804 case GlobalVar: 809 805 case GlobalVarWithVarInjectionChecks: … … 902 898 } 903 899 904 void JIT::emitPutGlobalProperty(uintptr_t* operandSlot, int value)905 {906 emitGetVirtualRegister(value, regT2);907 908 loadPtr(Address(regT0, JSObject::butterflyOffset()), regT0);909 loadPtr(operandSlot, regT1);910 negPtr(regT1);911 storePtr(regT2, BaseIndex(regT0, regT1, TimesEight, (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue)));912 }913 914 900 void JIT::emitPutGlobalVariable(JSValue* operand, int value, WatchpointSet* set) 915 901 { … … 947 933 switch (resolveType) { 948 934 case GlobalProperty: 949 case GlobalPropertyWithVarInjectionChecks: 935 case GlobalPropertyWithVarInjectionChecks: { 950 936 emitWriteBarrier(m_codeBlock->globalObject(), value, ShouldFilterValue); 951 937 emitLoadWithStructureCheck(scope, structureSlot); // Structure check covers var injection. 952 emitPutGlobalProperty(operandSlot, value); 938 emitGetVirtualRegister(value, regT2); 939 940 loadPtr(Address(regT0, JSObject::butterflyOffset()), regT0); 941 loadPtr(operandSlot, regT1); 942 negPtr(regT1); 943 storePtr(regT2, BaseIndex(regT0, regT1, TimesEight, (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue))); 953 944 break; 945 } 954 946 case GlobalVar: 955 947 case GlobalVarWithVarInjectionChecks: -
trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
r190673 r190675 781 781 } 782 782 783 void JIT::emitGetGlobalProperty(uintptr_t* operandSlot)784 {785 GPRReg base = regT2;786 GPRReg resultTag = regT1;787 GPRReg resultPayload = regT0;788 GPRReg offset = regT3;789 790 move(regT0, base);791 load32(operandSlot, offset);792 if (!ASSERT_DISABLED) {793 Jump isOutOfLine = branch32(GreaterThanOrEqual, offset, TrustedImm32(firstOutOfLineOffset));794 abortWithReason(JITOffsetIsNotOutOfLine);795 isOutOfLine.link(this);796 }797 loadPtr(Address(base, JSObject::butterflyOffset()), base);798 neg32(offset);799 load32(BaseIndex(base, offset, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload) + (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue)), resultPayload);800 load32(BaseIndex(base, offset, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag) + (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue)), resultTag);801 }802 803 783 void JIT::emitGetVarFromPointer(JSValue* operand, GPRReg tag, GPRReg payload) 804 784 { … … 832 812 switch (resolveType) { 833 813 case GlobalProperty: 834 case GlobalPropertyWithVarInjectionChecks: 814 case GlobalPropertyWithVarInjectionChecks: { 835 815 emitLoadWithStructureCheck(scope, structureSlot); // Structure check covers var injection. 836 emitGetGlobalProperty(operandSlot); 816 GPRReg base = regT2; 817 GPRReg resultTag = regT1; 818 GPRReg resultPayload = regT0; 819 GPRReg offset = regT3; 820 821 move(regT0, base); 822 load32(operandSlot, offset); 823 if (!ASSERT_DISABLED) { 824 Jump isOutOfLine = branch32(GreaterThanOrEqual, offset, TrustedImm32(firstOutOfLineOffset)); 825 abortWithReason(JITOffsetIsNotOutOfLine); 826 isOutOfLine.link(this); 827 } 828 loadPtr(Address(base, JSObject::butterflyOffset()), base); 829 neg32(offset); 830 load32(BaseIndex(base, offset, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload) + (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue)), resultPayload); 831 load32(BaseIndex(base, offset, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag) + (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue)), resultTag); 837 832 break; 833 } 838 834 case GlobalVar: 839 835 case GlobalVarWithVarInjectionChecks: … … 927 923 } 928 924 929 void JIT::emitPutGlobalProperty(uintptr_t* operandSlot, int value)930 {931 emitLoad(value, regT3, regT2);932 933 loadPtr(Address(regT0, JSObject::butterflyOffset()), regT0);934 loadPtr(operandSlot, regT1);935 negPtr(regT1);936 store32(regT3, BaseIndex(regT0, regT1, TimesEight, (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag)));937 store32(regT2, BaseIndex(regT0, regT1, TimesEight, (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload)));938 }939 940 925 void JIT::emitPutGlobalVariable(JSValue* operand, int value, WatchpointSet* set) 941 926 { … … 978 963 switch (resolveType) { 979 964 case GlobalProperty: 980 case GlobalPropertyWithVarInjectionChecks: 965 case GlobalPropertyWithVarInjectionChecks: { 981 966 emitWriteBarrier(m_codeBlock->globalObject(), value, ShouldFilterValue); 982 967 emitLoadWithStructureCheck(scope, structureSlot); // Structure check covers var injection. 983 emitPutGlobalProperty(operandSlot, value); 968 emitLoad(value, regT3, regT2); 969 970 loadPtr(Address(regT0, JSObject::butterflyOffset()), regT0); 971 loadPtr(operandSlot, regT1); 972 negPtr(regT1); 973 store32(regT3, BaseIndex(regT0, regT1, TimesEight, (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag))); 974 store32(regT2, BaseIndex(regT0, regT1, TimesEight, (firstOutOfLineOffset - 2) * sizeof(EncodedJSValue) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload))); 984 975 break; 976 } 985 977 case GlobalVar: 986 978 case GlobalVarWithVarInjectionChecks:
Note: See TracChangeset
for help on using the changeset viewer.