Ignore:
Timestamp:
Jun 8, 2009, 6:40:59 PM (16 years ago)
Author:
[email protected]
Message:

2009-06-08 Gavin Barraclough <[email protected]>

Reviewed by Geoff Garen.

Add (incomplete) support to YARR for running with the jit enabled
on Arm thumb2 platforms. Adds new Assembler/MacroAssembler classes,
along with cache flushing support, tweaks to MacroAssemblerCodePtr
to support decorated thumb code pointers, and new enter/exit code
to YARR jit for the platform.

Support for this platform is still under development - the assembler
currrently only supports planting and linking jumps with a 16Mb range.
As such, initially commiting in a disabled state.

Add new assembler files.

  • assembler/ARMv7Assembler.h: Added.

Add new Assembler.

  • assembler/AbstractMacroAssembler.h:

Tweaks to ensure sizes of pointer values planted in JIT code do not change.

  • assembler/MacroAssembler.h:

On ARMv7 platforms use MacroAssemblerARMv7.

  • assembler/MacroAssemblerARMv7.h: Added.

Add new MacroAssembler.

  • assembler/MacroAssemblerCodeRef.h: (JSC::FunctionPtr::FunctionPtr):

Add better ASSERT.

(JSC::ReturnAddressPtr::ReturnAddressPtr):

Add better ASSERT.

(JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):

On ARMv7, MacroAssemblerCodePtr's mush be 'decorated' with a low bit set,
to indicate to the processor that the code is thumb code, not traditional
32-bit ARM.

(JSC::MacroAssemblerCodePtr::dataLocation):

On ARMv7, decoration must be removed.

  • jit/ExecutableAllocator.h: (JSC::ExecutableAllocator::makeWritable):

Reformatted, no change.

(JSC::ExecutableAllocator::makeExecutable):

When marking code executable also cache flush it, where necessary.

(JSC::ExecutableAllocator::MakeWritable::MakeWritable):

Only use the null implementation of this class if both !ASSEMBLER_WX_EXCLUSIVE
and running on x86(_64) - on other platforms we may also need ensure that
makeExecutable is called at the end to flush caches.

(JSC::ExecutableAllocator::reprotectRegion):

Reformatted, no change.

(JSC::ExecutableAllocator::cacheFlush):

Cache flush a region of memory, or platforms where this is necessary.

  • wtf/Platform.h:

Add changes necessary to allow YARR jit to build on this platform, disabled.

  • yarr/RegexJIT.cpp: (JSC::Yarr::RegexGenerator::generateEnter): (JSC::Yarr::RegexGenerator::generateReturn):

Add support to these methods for ARMv7.

File:
1 edited

Legend:

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

    r44476 r44514  
    182182        explicit Imm32(int32_t value)
    183183            : m_value(value)
     184#if PLATFORM(ARM_V7)
     185            , m_isPointer(false)
     186#endif
    184187        {
    185188        }
     
    188191        explicit Imm32(ImmPtr ptr)
    189192            : m_value(ptr.asIntptr())
    190         {
    191         }
     193#if PLATFORM(ARM_V7)
     194            , m_isPointer(true)
    192195#endif
     196        {
     197        }
     198#endif
    193199
    194200        int32_t m_value;
     201#if PLATFORM(ARM_V7)
     202        // We rely on being able to regenerate code to recover exception handling
     203        // information.  Since ARMv7 supports 16-bit immediates there is a danger
     204        // that if pointer values change the layout of the generated code will change.
     205        // To avoid this problem, always generate pointers (and thus Imm32s constructed
     206        // from ImmPtrs) with a code sequence that is able  to represent  any pointer
     207        // value - don't use a more compact form in these cases.
     208        bool m_isPointer;
     209#endif
    195210    };
    196211
     
    529544        void relink(CodeLocationLabel destination)
    530545        {
    531             AssemblerType::relinkJump(this->dataLocation(), destination.executableAddress());
     546            AssemblerType::relinkJump(this->dataLocation(), destination.dataLocation());
    532547        }
    533548
     
    787802        void link(Jump jump, CodeLocationLabel label)
    788803        {
    789             AssemblerType::linkJump(code(), jump.m_jmp, label.executableAddress());
     804            AssemblerType::linkJump(code(), jump.m_jmp, label.dataLocation());
    790805        }
    791806
     
    793808        {
    794809            for (unsigned i = 0; i < list.m_jumps.size(); ++i)
    795                 AssemblerType::linkJump(code(), list.m_jumps[i].m_jmp, label.executableAddress());
     810                AssemblerType::linkJump(code(), list.m_jumps[i].m_jmp, label.dataLocation());
    796811        }
    797812
Note: See TracChangeset for help on using the changeset viewer.