Ignore:
Timestamp:
Jul 21, 2009, 8:24:34 PM (16 years ago)
Author:
[email protected]
Message:

2009-07-21 Gavin Barraclough <[email protected]>

Reviewed by Sam Weinig.

Move call linking / repatching down from AbstractMacroAssembler into MacroAssemblerARCH classes.
( https://bugs.webkit.org/show_bug.cgi?id=27527 )

This allows the implementation to be defined per architecture. Specifically this addresses the
fact that x86-64 MacroAssembler implements far calls as a load to register, followed by a call
to register. Patching the call actually requires the pointer load to be patched, rather than
the call to be patched. This is implementation detail specific to MacroAssemblerX86_64, and as
such is best handled there.

  • assembler/AbstractMacroAssembler.h:
  • assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::linkCall): (JSC::MacroAssemblerARM::repatchCall):
  • assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::linkCall): (JSC::MacroAssemblerARMv7::repatchCall):
  • assembler/MacroAssemblerX86.h: (JSC::MacroAssemblerX86::linkCall): (JSC::MacroAssemblerX86::repatchCall):
  • assembler/MacroAssemblerX86_64.h: (JSC::MacroAssemblerX86_64::linkCall): (JSC::MacroAssemblerX86_64::repatchCall):
File:
1 edited

Legend:

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

    r44526 r46209  
    165165private:
    166166    const bool m_isSSE2Present;
     167
     168    friend class LinkBuffer;
     169    friend class RepatchBuffer;
     170
     171    static void linkCall(void* code, Call call, FunctionPtr function)
     172    {
     173        X86Assembler::linkCall(code, call.m_jmp, function.value());
     174    }
     175
     176    static void repatchCall(CodeLocationCall call, CodeLocationLabel destination)
     177    {
     178        X86Assembler::relinkCall(call.dataLocation(), destination.executableAddress());
     179    }
     180
     181    static void repatchCall(CodeLocationCall call, FunctionPtr destination)
     182    {
     183        X86Assembler::relinkCall(call.dataLocation(), destination.executableAddress());
     184    }
    167185};
    168186
Note: See TracChangeset for help on using the changeset viewer.