Changeset 237471 in webkit
- Timestamp:
- Oct 26, 2018, 11:51:23 AM (8 years ago)
- Location:
- branches/safari-606-branch/Source/JavaScriptCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
assembler/ARMv7Assembler.h (modified) (9 diffs)
-
assembler/MacroAssemblerARMv7.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-606-branch/Source/JavaScriptCore/ChangeLog
r237470 r237471 1 2018-10-23 Kocsen Chung <kocsen_chung@apple.com> 2 3 Cherry-pick r236604. rdar://problem/45285669 4 5 [JSC] [Armv7] Add a copy function argument to MacroAssemblerARMv7::link() and pass it down to the assembler's linking functions. 6 https://bugs.webkit.org/show_bug.cgi?id=190080 7 8 Reviewed by Mark Lam. 9 10 * assembler/ARMv7Assembler.h: 11 (JSC::ARMv7Assembler::link): 12 (JSC::ARMv7Assembler::linkJumpT1): 13 (JSC::ARMv7Assembler::linkJumpT2): 14 (JSC::ARMv7Assembler::linkJumpT3): 15 (JSC::ARMv7Assembler::linkJumpT4): 16 (JSC::ARMv7Assembler::linkConditionalJumpT4): 17 (JSC::ARMv7Assembler::linkBX): 18 (JSC::ARMv7Assembler::linkConditionalBX): 19 * assembler/MacroAssemblerARMv7.h: 20 (JSC::MacroAssemblerARMv7::link): 21 22 23 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236604 268f45cc-cd09-0410-ab3c-d52691b4dbfc 24 25 2018-09-28 Guillaume Emont <guijemont@igalia.com> 26 27 [JSC] [Armv7] Add a copy function argument to MacroAssemblerARMv7::link() and pass it down to the assembler's linking functions. 28 https://bugs.webkit.org/show_bug.cgi?id=190080 29 30 Reviewed by Mark Lam. 31 32 * assembler/ARMv7Assembler.h: 33 (JSC::ARMv7Assembler::link): 34 (JSC::ARMv7Assembler::linkJumpT1): 35 (JSC::ARMv7Assembler::linkJumpT2): 36 (JSC::ARMv7Assembler::linkJumpT3): 37 (JSC::ARMv7Assembler::linkJumpT4): 38 (JSC::ARMv7Assembler::linkConditionalJumpT4): 39 (JSC::ARMv7Assembler::linkBX): 40 (JSC::ARMv7Assembler::linkConditionalBX): 41 * assembler/MacroAssemblerARMv7.h: 42 (JSC::MacroAssemblerARMv7::link): 43 1 44 2018-10-23 Kocsen Chung <kocsen_chung@apple.com> 2 45 -
branches/safari-606-branch/Source/JavaScriptCore/assembler/ARMv7Assembler.h
r237470 r237471 2210 2210 } 2211 2211 2212 static void ALWAYS_INLINE link(LinkRecord& record, uint8_t* from, const uint8_t* fromInstruction8, uint8_t* to) 2212 typedef void* (*CopyFunction)(void*, const void*, size_t); 2213 2214 static void ALWAYS_INLINE link(LinkRecord& record, uint8_t* from, const uint8_t* fromInstruction8, uint8_t* to, CopyFunction copy) 2213 2215 { 2214 2216 const uint16_t* fromInstruction = reinterpret_cast_ptr<const uint16_t*>(fromInstruction8); 2215 2217 switch (record.linkType()) { 2216 2218 case LinkJumpT1: 2217 linkJumpT1(record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to );2219 linkJumpT1(record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy); 2218 2220 break; 2219 2221 case LinkJumpT2: 2220 linkJumpT2(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to );2222 linkJumpT2(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy); 2221 2223 break; 2222 2224 case LinkJumpT3: 2223 linkJumpT3(record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to );2225 linkJumpT3(record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy); 2224 2226 break; 2225 2227 case LinkJumpT4: 2226 linkJumpT4(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to );2228 linkJumpT4(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy); 2227 2229 break; 2228 2230 case LinkConditionalJumpT4: 2229 linkConditionalJumpT4(record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to );2231 linkConditionalJumpT4(record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy); 2230 2232 break; 2231 2233 case LinkConditionalBX: 2232 linkConditionalBX(record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to );2234 linkConditionalBX(record.condition(), reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy); 2233 2235 break; 2234 2236 case LinkBX: 2235 linkBX(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to );2237 linkBX(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy); 2236 2238 break; 2237 2239 default: … … 2684 2686 } 2685 2687 2686 static void linkJumpT1(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target )2688 static void linkJumpT1(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2687 2689 { 2688 2690 // FIMXE: this should be up in the MacroAssembler layer. :-( … … 2700 2702 ASSERT(!(relative & 1)); 2701 2703 uint16_t newInstruction = OP_B_T1 | ((cond & 0xf) << 8) | ((relative & 0x1fe) >> 1); 2702 performJITMemcpy(writeTarget - 1, &newInstruction, sizeof(uint16_t));2703 } 2704 2705 static void linkJumpT2(uint16_t* writeTarget, const uint16_t* instruction, void* target )2704 copy(writeTarget - 1, &newInstruction, sizeof(uint16_t)); 2705 } 2706 2707 static void linkJumpT2(uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2706 2708 { 2707 2709 // FIMXE: this should be up in the MacroAssembler layer. :-( … … 2719 2721 ASSERT(!(relative & 1)); 2720 2722 uint16_t newInstruction = OP_B_T2 | ((relative & 0xffe) >> 1); 2721 performJITMemcpy(writeTarget - 1, &newInstruction, sizeof(uint16_t));2722 } 2723 2724 static void linkJumpT3(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target )2723 copy(writeTarget - 1, &newInstruction, sizeof(uint16_t)); 2724 } 2725 2726 static void linkJumpT3(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2725 2727 { 2726 2728 // FIMXE: this should be up in the MacroAssembler layer. :-( … … 2736 2738 instructions[0] = OP_B_T3a | ((relative & 0x100000) >> 10) | ((cond & 0xf) << 6) | ((relative & 0x3f000) >> 12); 2737 2739 instructions[1] = OP_B_T3b | ((relative & 0x80000) >> 8) | ((relative & 0x40000) >> 5) | ((relative & 0xffe) >> 1); 2738 performJITMemcpy(writeTarget - 2, instructions, 2 * sizeof(uint16_t));2739 } 2740 2741 static void linkJumpT4(uint16_t* writeTarget, const uint16_t* instruction, void* target )2740 copy(writeTarget - 2, instructions, 2 * sizeof(uint16_t)); 2741 } 2742 2743 static void linkJumpT4(uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2742 2744 { 2743 2745 // FIMXE: this should be up in the MacroAssembler layer. :-( … … 2756 2758 instructions[0] = OP_B_T4a | ((relative & 0x1000000) >> 14) | ((relative & 0x3ff000) >> 12); 2757 2759 instructions[1] = OP_B_T4b | ((relative & 0x800000) >> 10) | ((relative & 0x400000) >> 11) | ((relative & 0xffe) >> 1); 2758 performJITMemcpy(writeTarget - 2, instructions, 2 * sizeof(uint16_t));2759 } 2760 2761 static void linkConditionalJumpT4(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target )2760 copy(writeTarget - 2, instructions, 2 * sizeof(uint16_t)); 2761 } 2762 2763 static void linkConditionalJumpT4(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2762 2764 { 2763 2765 // FIMXE: this should be up in the MacroAssembler layer. :-( … … 2766 2768 2767 2769 uint16_t newInstruction = ifThenElse(cond) | OP_IT; 2768 performJITMemcpy(writeTarget - 3, &newInstruction, sizeof(uint16_t));2769 linkJumpT4(writeTarget, instruction, target );2770 } 2771 2772 static void linkBX(uint16_t* writeTarget, const uint16_t* instruction, void* target )2770 copy(writeTarget - 3, &newInstruction, sizeof(uint16_t)); 2771 linkJumpT4(writeTarget, instruction, target, copy); 2772 } 2773 2774 static void linkBX(uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2773 2775 { 2774 2776 // FIMXE: this should be up in the MacroAssembler layer. :-( … … 2787 2789 instructions[4] = OP_BX | (JUMP_TEMPORARY_REGISTER << 3); 2788 2790 2789 performJITMemcpy(writeTarget - 5, instructions, 5 * sizeof(uint16_t));2790 } 2791 2792 static void linkConditionalBX(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target )2791 copy(writeTarget - 5, instructions, 5 * sizeof(uint16_t)); 2792 } 2793 2794 static void linkConditionalBX(Condition cond, uint16_t* writeTarget, const uint16_t* instruction, void* target, CopyFunction copy = performJITMemcpy) 2793 2795 { 2794 2796 // FIMXE: this should be up in the MacroAssembler layer. :-( … … 2798 2800 linkBX(writeTarget, instruction, target); 2799 2801 uint16_t newInstruction = ifThenElse(cond, true, true) | OP_IT; 2800 performJITMemcpy(writeTarget - 6, &newInstruction, sizeof(uint16_t));2802 copy(writeTarget - 6, &newInstruction, sizeof(uint16_t)); 2801 2803 } 2802 2804 -
branches/safari-606-branch/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h
r237470 r237471 70 70 static JumpLinkType computeJumpType(LinkRecord& record, const uint8_t* from, const uint8_t* to) { return ARMv7Assembler::computeJumpType(record, from, to); } 71 71 static int jumpSizeDelta(JumpType jumpType, JumpLinkType jumpLinkType) { return ARMv7Assembler::jumpSizeDelta(jumpType, jumpLinkType); } 72 static void link(LinkRecord& record, uint8_t* from, const uint8_t* fromInstruction, uint8_t* to) { return ARMv7Assembler::link(record, from, fromInstruction, to); } 72 template <typename CopyFunction> 73 static void link(LinkRecord& record, uint8_t* from, const uint8_t* fromInstruction, uint8_t* to, CopyFunction copy) { return ARMv7Assembler::link(record, from, fromInstruction, to, copy); } 73 74 74 75 struct ArmAddress {
Note:
See TracChangeset
for help on using the changeset viewer.