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

    r44554 r46209  
    10551055        return static_cast<ARMv7Assembler::Condition>(cond);
    10561056    }
     1057
     1058private:
     1059    friend class LinkBuffer;
     1060    friend class RepatchBuffer;
     1061
     1062    static void linkCall(void* code, Call call, FunctionPtr function)
     1063    {
     1064        ARMv7Assembler::linkCall(code, call.m_jmp, function.value());
     1065    }
     1066
     1067    static void repatchCall(CodeLocationCall call, CodeLocationLabel destination)
     1068    {
     1069        ARMv7Assembler::relinkCall(call.dataLocation(), destination.executableAddress());
     1070    }
     1071
     1072    static void repatchCall(CodeLocationCall call, FunctionPtr destination)
     1073    {
     1074        ARMv7Assembler::relinkCall(call.dataLocation(), destination.executableAddress());
     1075    }
    10571076};
    10581077
Note: See TracChangeset for help on using the changeset viewer.