Changeset 44514 in webkit for trunk/JavaScriptCore/wtf/Platform.h


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/wtf/Platform.h

    r44511 r44514  
    229229#endif
    230230#endif
     231#if defined(__ARM_ARCH_7A__)
     232#define WTF_PLATFORM_ARM_V7 1
     233#endif
    231234
    232235/* PLATFORM(X86) */
     
    556559#if (!defined(ENABLE_YARR_JIT) && PLATFORM(X86) && PLATFORM(MAC)) \
    557560 || (!defined(ENABLE_YARR_JIT) && PLATFORM(X86_64) && PLATFORM(MAC)) \
     561 /* Under development, temporarily disabled until 16Mb link range limit in assembler is fixed. */ \
     562 || (!defined(ENABLE_YARR_JIT) && PLATFORM(ARM_V7) && PLATFORM(IPHONE) && 0) \
    558563 || (!defined(ENABLE_YARR_JIT) && PLATFORM(X86) && PLATFORM(WIN))
    559564#define ENABLE_YARR 1
     
    570575/* Setting this flag prevents the assembler from using RWX memory; this may improve
    571576   security but currectly comes at a significant performance cost. */
     577#if PLATFORM(ARM_V7) && PLATFORM(IPHONE)
     578#define ENABLE_ASSEMBLER_WX_EXCLUSIVE 1
     579#else
    572580#define ENABLE_ASSEMBLER_WX_EXCLUSIVE 0
     581#endif
    573582
    574583#if !defined(ENABLE_PAN_SCROLLING) && PLATFORM(WIN_OS)
Note: See TracChangeset for help on using the changeset viewer.