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/X86Assembler.h

    r46202 r46209  
    13461346    }
    13471347   
     1348    static JmpDst labelFor(JmpSrc jump, intptr_t offset = 0)
     1349    {
     1350        return JmpDst(jump.m_offset + offset);
     1351    }
     1352   
    13481353    JmpDst align(int alignment)
    13491354    {
     
    13841389        setRel32(reinterpret_cast<char*>(code) + from.m_offset, to);
    13851390    }
    1386 
    1387 #if PLATFORM(X86_64)
    1388     static void linkPointerForCall(void* where, void* value)
    1389     {
    1390         reinterpret_cast<void**>(where)[-1] = value;
    1391     }
    1392 #endif
    13931391
    13941392    static void linkPointer(void* code, JmpDst where, void* value)
Note: See TracChangeset for help on using the changeset viewer.