Changeset 43220 in webkit for trunk/JavaScriptCore/assembler


Ignore:
Timestamp:
May 5, 2009, 4:34:23 AM (16 years ago)
Author:
[email protected]
Message:

Bug 25559: Improve native function call performance
<https://bugs.webkit.org/show_bug.cgi?id=25559>

Reviewed by Gavin Barraclough

In order to cache calls to native functions we now make the standard
prototype functions use a small assembly thunk that converts the JS
calling convention into the native calling convention. As this is
only beneficial in the JIT we use the NativeFunctionWrapper typedef
to alternate between PrototypeFunction and JSFunction to keep the
code sane. This change from PrototypeFunction to NativeFunctionWrapper
is the bulk of this patch.

Location:
trunk/JavaScriptCore/assembler
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/assembler/MacroAssemblerX86Common.h

    r42481 r43220  
    554554    }
    555555
     556    void call(Address address)
     557    {
     558        m_assembler.call_m(address.offset, address.base);
     559    }
     560
    556561    void ret()
    557562    {
  • trunk/JavaScriptCore/assembler/MacroAssemblerX86_64.h

    r41474 r43220  
    123123    void addPtr(Imm32 imm, RegisterID src, RegisterID dest)
    124124    {
    125         m_assembler.leal_mr(imm.m_value, src, dest);
     125        m_assembler.leaq_mr(imm.m_value, src, dest);
    126126    }
    127127
  • trunk/JavaScriptCore/assembler/X86Assembler.h

    r42481 r43220  
    10091009        m_formatter.oneByteOp(OP_LEA, dst, base, offset);
    10101010    }
     1011#if PLATFORM(X86_64)
     1012    void leaq_mr(int offset, RegisterID base, RegisterID dst)
     1013    {
     1014        m_formatter.oneByteOp64(OP_LEA, dst, base, offset);
     1015    }
     1016#endif
    10111017
    10121018    // Flow control:
     
    10221028        m_formatter.oneByteOp(OP_GROUP5_Ev, GROUP5_OP_CALLN, dst);
    10231029        return JmpSrc(m_formatter.size());
     1030    }
     1031   
     1032    void call_m(int offset, RegisterID base)
     1033    {
     1034        m_formatter.oneByteOp(OP_GROUP5_Ev, GROUP5_OP_CALLN, base, offset);
    10241035    }
    10251036
Note: See TracChangeset for help on using the changeset viewer.