⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 237471 in webkit


Ignore:
Timestamp:
Oct 26, 2018, 11:51:23 AM (8 years ago)
Author:
Alan Coon
Message:

Cherry-pick r236604. rdar://problem/45285669

[JSC] [Armv7] Add a copy function argument to MacroAssemblerARMv7::link() and pass it down to the assembler's linking functions.
​https://bugs.webkit.org/show_bug.cgi?id=190080

Reviewed by Mark Lam.

  • assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::link): (JSC::ARMv7Assembler::linkJumpT1): (JSC::ARMv7Assembler::linkJumpT2): (JSC::ARMv7Assembler::linkJumpT3): (JSC::ARMv7Assembler::linkJumpT4): (JSC::ARMv7Assembler::linkConditionalJumpT4): (JSC::ARMv7Assembler::linkBX): (JSC::ARMv7Assembler::linkConditionalBX):
  • assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::link):

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@236604 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-606-branch/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-606-branch/Source/JavaScriptCore/ChangeLog

    r237470 r237471  
     12018-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
    1442018-10-23  Kocsen Chung  <kocsen_chung@apple.com>
    245
  • branches/safari-606-branch/Source/JavaScriptCore/assembler/ARMv7Assembler.h

    r237470 r237471  
    22102210    }
    22112211
    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)
    22132215    {
    22142216        const uint16_t* fromInstruction = reinterpret_cast_ptr<const uint16_t*>(fromInstruction8);
    22152217        switch (record.linkType()) {
    22162218        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);
    22182220            break;
    22192221        case LinkJumpT2:
    2220             linkJumpT2(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to);
     2222            linkJumpT2(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy);
    22212223            break;
    22222224        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);
    22242226            break;
    22252227        case LinkJumpT4:
    2226             linkJumpT4(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to);
     2228            linkJumpT4(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy);
    22272229            break;
    22282230        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);
    22302232            break;
    22312233        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);
    22332235            break;
    22342236        case LinkBX:
    2235             linkBX(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to);
     2237            linkBX(reinterpret_cast_ptr<uint16_t*>(from), fromInstruction, to, copy);
    22362238            break;
    22372239        default:
    … …  
    26842686    }
    26852687   
    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)
    26872689    {
    26882690        // FIMXE: this should be up in the MacroAssembler layer. :-(       
    … …  
    27002702        ASSERT(!(relative & 1));
    27012703        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)
    27062708    {
    27072709        // FIMXE: this should be up in the MacroAssembler layer. :-(       
    … …  
    27192721        ASSERT(!(relative & 1));
    27202722        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)
    27252727    {
    27262728        // FIMXE: this should be up in the MacroAssembler layer. :-(
    … …  
    27362738        instructions[0] = OP_B_T3a | ((relative & 0x100000) >> 10) | ((cond & 0xf) << 6) | ((relative & 0x3f000) >> 12);
    27372739        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)
    27422744    {
    27432745        // FIMXE: this should be up in the MacroAssembler layer. :-(       
    … …  
    27562758        instructions[0] = OP_B_T4a | ((relative & 0x1000000) >> 14) | ((relative & 0x3ff000) >> 12);
    27572759        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)
    27622764    {
    27632765        // FIMXE: this should be up in the MacroAssembler layer. :-(       
    … …  
    27662768       
    27672769        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)
    27732775    {
    27742776        // FIMXE: this should be up in the MacroAssembler layer. :-(
    … …  
    27872789        instructions[4] = OP_BX | (JUMP_TEMPORARY_REGISTER << 3);
    27882790
    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)
    27932795    {
    27942796        // FIMXE: this should be up in the MacroAssembler layer. :-(       
    … …  
    27982800        linkBX(writeTarget, instruction, target);
    27992801        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));
    28012803    }
    28022804   
  • branches/safari-606-branch/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h

    r237470 r237471  
    7070    static JumpLinkType computeJumpType(LinkRecord& record, const uint8_t* from, const uint8_t* to) { return ARMv7Assembler::computeJumpType(record, from, to); }
    7171    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); }
    7374
    7475    struct ArmAddress {
Note: See TracChangeset for help on using the changeset viewer.