Ignore:
Timestamp:
May 17, 2011, 1:02:41 PM (14 years ago)
Author:
[email protected]
Message:

2011-05-16 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

Reduce code size for inline cache
https://bugs.webkit.org/show_bug.cgi?id=60942

This patch introduces the concept of a "compact" address that
allows individual architectures to control the maximum offset
used for the inline path of get_by_id. This reduces the code
size of get_by_id by 3 bytes on x86 and x86_64 and slightly
improves performance on v8 tests.

  • assembler/ARMAssembler.h: (JSC::ARMAssembler::repatchCompact):
  • assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::repatchCompact):
  • assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::DataLabelCompact::DataLabelCompact): (JSC::AbstractMacroAssembler::differenceBetween): (JSC::AbstractMacroAssembler::repatchCompact):
  • assembler/CodeLocation.h: (JSC::CodeLocationDataLabelCompact::CodeLocationDataLabelCompact): (JSC::CodeLocationCommon::dataLabelCompactAtOffset):
  • assembler/LinkBuffer.h: (JSC::LinkBuffer::locationOf):
  • assembler/MIPSAssembler.h: (JSC::MIPSAssembler::repatchCompact):
  • assembler/MacroAssembler.h: (JSC::MacroAssembler::loadPtrWithCompactAddressOffsetPatch):
  • assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::load32WithCompactAddressOffsetPatch):
  • assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::load32WithCompactAddressOffsetPatch):
  • assembler/MacroAssemblerMIPS.h: (JSC::MacroAssemblerMIPS::load32WithCompactAddressOffsetPatch):
  • assembler/MacroAssemblerSH4.h: (JSC::MacroAssemblerSH4::load32WithAddressOffsetPatch):
  • assembler/MacroAssemblerX86.h: (JSC::MacroAssemblerX86::repatchCompact):
  • assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::loadCompactWithAddressOffsetPatch):
  • assembler/MacroAssemblerX86_64.h: (JSC::MacroAssemblerX86_64::loadPtrWithCompactAddressOffsetPatch):
  • assembler/RepatchBuffer.h: (JSC::RepatchBuffer::repatch):
  • assembler/SH4Assembler.h: (JSC::SH4Assembler::repatchCompact):
  • assembler/X86Assembler.h: (JSC::X86Assembler::movl_mr_disp8): (JSC::X86Assembler::movq_mr_disp8): (JSC::X86Assembler::repatchCompact): (JSC::X86Assembler::setInt8): (JSC::X86Assembler::X86InstructionFormatter::oneByteOp_disp8): (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64_disp8): (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
  • jit/JIT.h:
  • jit/JITPropertyAccess.cpp: (JSC::JIT::compileGetByIdHotPath): (JSC::JIT::emit_op_put_by_id): (JSC::JIT::patchGetByIdSelf):
  • jit/JITPropertyAccess32_64.cpp: (JSC::JIT::compileGetByIdHotPath): (JSC::JIT::emit_op_put_by_id): (JSC::JIT::patchGetByIdSelf):
  • jit/JITStubs.cpp: (JSC::JITThunks::tryCacheGetByID):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h

    r85561 r86699  
    305305        }
    306306
     307        AssemblerLabel label() const { return m_label; }
     308
     309    private:
     310        AssemblerLabel m_label;
     311    };
     312
     313    // DataLabelCompact:
     314    //
     315    // A DataLabelCompact is used to refer to a location in the code containing a
     316    // compact immediate to be patched after the code has been generated.
     317    class DataLabelCompact {
     318        template<class TemplateAssemblerType>
     319        friend class AbstractMacroAssembler;
     320        friend class LinkBuffer;
     321    public:
     322        DataLabelCompact()
     323        {
     324        }
     325       
     326        DataLabelCompact(AbstractMacroAssembler<AssemblerType>* masm)
     327            : m_label(masm->m_assembler.label())
     328        {
     329        }
     330   
     331        DataLabelCompact(AssemblerLabel label)
     332            : m_label(label)
     333        {
     334        }
     335
    307336    private:
    308337        AssemblerLabel m_label;
     
    501530        return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
    502531    }
     532   
     533    ptrdiff_t differenceBetween(Label from, DataLabelCompact to)
     534    {
     535        return AssemblerType::getDifferenceBetweenLabels(from.m_label, to.m_label);
     536    }
    503537
    504538    ptrdiff_t differenceBetween(DataLabelPtr from, Jump to)
     
    565599    }
    566600
     601    static void repatchCompact(CodeLocationDataLabelCompact dataLabelCompact, int32_t value)
     602    {
     603        AssemblerType::repatchCompact(dataLabelCompact.dataLocation(), value);
     604    }
     605   
    567606    static void repatchInt32(CodeLocationDataLabel32 dataLabel32, int32_t value)
    568607    {
Note: See TracChangeset for help on using the changeset viewer.