Changeset 86999 in webkit


Ignore:
Timestamp:
May 20, 2011 4:20:48 PM (13 years ago)
Author:
oliver@apple.com
Message:

2011-05-20 Oliver Hunt <oliver@apple.com>

Reviewed by Gavin Barraclough.

Reduce size of inline cache path of get_by_id on ARMv7
https://bugs.webkit.org/show_bug.cgi?id=61221

This reduces the code size of get_by_id by 20 bytes

  • assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::ldrCompact): (JSC::ARMv7Assembler::repatchCompact): (JSC::ARMv7Assembler::setUInt7ForLoad):
  • assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::load32WithCompactAddressOffsetPatch):
  • jit/JIT.h:
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r86974 r86999  
     12011-05-20  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Gavin Barraclough.
     4
     5        Reduce size of inline cache path of get_by_id on ARMv7
     6        https://bugs.webkit.org/show_bug.cgi?id=61221
     7
     8        This reduces the code size of get_by_id by 20 bytes
     9
     10        * assembler/ARMv7Assembler.h:
     11        (JSC::ARMv7Assembler::ldrCompact):
     12        (JSC::ARMv7Assembler::repatchCompact):
     13        (JSC::ARMv7Assembler::setUInt7ForLoad):
     14        * assembler/MacroAssemblerARMv7.h:
     15        (JSC::MacroAssemblerARMv7::load32WithCompactAddressOffsetPatch):
     16        * jit/JIT.h:
     17
    1182011-05-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
    219
  • trunk/Source/JavaScriptCore/assembler/ARMv7Assembler.h

    r86919 r86999  
    954954    }
    955955
     956    void ldrCompact(RegisterID rt, RegisterID rn, ARMThumbImmediate imm)
     957    {
     958        ASSERT(rn != ARMRegisters::pc); // LDR (literal)
     959        ASSERT(imm.isUInt7());
     960        ASSERT(!((rt | rn) & 8));
     961        m_formatter.oneWordOp5Imm5Reg3Reg3(OP_LDR_imm_T1, imm.getUInt7() >> 2, rn, rt);
     962    }
     963
    956964    // If index is set, this is a regular offset or a pre-indexed load;
    957965    // if index is not set then is is a post-index load.
     
    17571765    static void repatchCompact(void* where, int32_t value)
    17581766    {
    1759         repatchInt32(where, value);
     1767        ASSERT(value >= 0);
     1768        ASSERT(ARMThumbImmediate::makeUInt12(value).isUInt7());
     1769        setUInt7ForLoad(where, ARMThumbImmediate::makeUInt12(value));
    17601770    }
    17611771
     
    18461856
    18471857        ExecutableAllocator::cacheFlush(location - 4, 4 * sizeof(uint16_t));
     1858    }
     1859
     1860    static void setUInt7ForLoad(void* code, ARMThumbImmediate imm)
     1861    {
     1862        // Requires us to have planted a LDR_imm_T1
     1863        ASSERT(imm.isValid());
     1864        ASSERT(imm.isUInt7());
     1865        uint16_t* location = reinterpret_cast<uint16_t*>(code);
     1866        location[0] |= (imm.getUInt7() >> 2) << 6;
     1867        ExecutableAllocator::cacheFlush(location, sizeof(uint16_t));
    18481868    }
    18491869
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h

    r86919 r86999  
    4949    typedef ARMv7Assembler::JumpType JumpType;
    5050    typedef ARMv7Assembler::JumpLinkType JumpLinkType;
    51     static const int MaximumCompactPtrAlignedAddressOffset = 0x7FFFFFFF;
     51    // Magic number is the biggest useful offset we can get on ARMv7 with
     52    // a LDR_imm_T2 encoding
     53    static const int MaximumCompactPtrAlignedAddressOffset = 124;
    5254
    5355    MacroAssemblerARMv7()
     
    486488    DataLabelCompact load32WithCompactAddressOffsetPatch(Address address, RegisterID dest)
    487489    {
    488         DataLabel32 label = load32WithAddressOffsetPatch(address, dest);
    489         return DataLabelCompact(label.label());
     490        DataLabelCompact label(this);
     491        ASSERT(address.offset >= 0);
     492        ASSERT(address.offset <= MaximumCompactPtrAlignedAddressOffset);
     493        ASSERT(ARMThumbImmediate::makeUInt12(address.offset).isUInt7());
     494        m_assembler.ldrCompact(dest, address.base, ARMThumbImmediate::makeUInt12(address.offset));
     495        return label;
    490496    }
    491497
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r86919 r86999  
    409409        static const int patchOffsetGetByIdStructure = 10;
    410410        static const int patchOffsetGetByIdBranchToSlowCase = 26;
    411         static const int patchOffsetGetByIdPropertyMapOffset1 = 36;
    412         static const int patchOffsetGetByIdPropertyMapOffset2 = 48;
    413         static const int patchOffsetGetByIdPutResult = 52;
     411        static const int patchOffsetGetByIdPropertyMapOffset1 = 28;
     412        static const int patchOffsetGetByIdPropertyMapOffset2 = 30;
     413        static const int patchOffsetGetByIdPutResult = 32;
    414414#if ENABLE(OPCODE_SAMPLING)
    415415        #error "OPCODE_SAMPLING is not yet supported"
Note: See TracChangeset for help on using the changeset viewer.