Ignore:
Timestamp:
May 24, 2012, 2:14:07 PM (13 years ago)
Author:
[email protected]
Message:

Move cacheFlush from ExecutableAllocator to Assembler classes
https://bugs.webkit.org/show_bug.cgi?id=87420

Reviewed by Oliver Hunt.

Makes more sense there, & remove a pile of #ifdefs.

  • assembler/ARMAssembler.cpp:

(JSC):
(JSC::ARMAssembler::cacheFlush):

  • assembler/ARMAssembler.h:

(ARMAssembler):
(JSC::ARMAssembler::cacheFlush):

  • assembler/ARMv7Assembler.h:

(JSC::ARMv7Assembler::relinkJump):
(JSC::ARMv7Assembler::cacheFlush):
(ARMv7Assembler):
(JSC::ARMv7Assembler::setInt32):
(JSC::ARMv7Assembler::setUInt7ForLoad):

  • assembler/AbstractMacroAssembler.h:

(JSC::AbstractMacroAssembler::cacheFlush):

  • assembler/LinkBuffer.h:

(JSC::LinkBuffer::performFinalization):

  • assembler/MIPSAssembler.h:

(JSC::MIPSAssembler::relinkJump):
(JSC::MIPSAssembler::relinkCall):
(JSC::MIPSAssembler::repatchInt32):
(JSC::MIPSAssembler::cacheFlush):
(MIPSAssembler):

  • assembler/SH4Assembler.h:

(JSC::SH4Assembler::repatchCompact):
(JSC::SH4Assembler::cacheFlush):
(SH4Assembler):

  • assembler/X86Assembler.h:

(X86Assembler):
(JSC::X86Assembler::cacheFlush):

  • jit/ExecutableAllocator.cpp:

(JSC):

  • jit/ExecutableAllocator.h:

(ExecutableAllocator):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/assembler/ARMv7Assembler.h

    r115363 r118413  
    20272027        linkJumpAbsolute(reinterpret_cast<uint16_t*>(from), to);
    20282028
    2029         ExecutableAllocator::cacheFlush(reinterpret_cast<uint16_t*>(from) - 5, 5 * sizeof(uint16_t));
     2029        cacheFlush(reinterpret_cast<uint16_t*>(from) - 5, 5 * sizeof(uint16_t));
    20302030    }
    20312031   
     
    20702070
    20712071    unsigned debugOffset() { return m_formatter.debugOffset(); }
     2072
     2073    static void cacheFlush(void* code, size_t size)
     2074    {
     2075#if OS(IOS)
     2076        sys_cache_control(kCacheFunctionPrepareForExecution, code, size);
     2077#elif OS(LINUX)
     2078        asm volatile(
     2079            "push    {r7}\n"
     2080            "mov     r0, %0\n"
     2081            "mov     r1, %1\n"
     2082            "movw    r7, #0x2\n"
     2083            "movt    r7, #0xf\n"
     2084            "movs    r2, #0x0\n"
     2085            "svc     0x0\n"
     2086            "pop     {r7}\n"
     2087            :
     2088            : "r" (code), "r" (reinterpret_cast<char*>(code) + size)
     2089            : "r0", "r1", "r2");
     2090#elif OS(WINCE)
     2091        CacheRangeFlush(code, size, CACHE_SYNC_ALL);
     2092#elif OS(QNX)
     2093#if !ENABLE(ASSEMBLER_WX_EXCLUSIVE)
     2094        msync(code, size, MS_INVALIDATE_ICACHE);
     2095#else
     2096        UNUSED_PARAM(code);
     2097        UNUSED_PARAM(size);
     2098#endif
     2099#else
     2100#error "The cacheFlush support is missing on this platform."
     2101#endif
     2102    }
    20722103
    20732104private:
     
    21502181        location[-1] = twoWordOp5i6Imm4Reg4EncodedImmSecond((location[-1] >> 8) & 0xf, hi16);
    21512182
    2152         ExecutableAllocator::cacheFlush(location - 4, 4 * sizeof(uint16_t));
     2183        cacheFlush(location - 4, 4 * sizeof(uint16_t));
    21532184    }
    21542185   
     
    21782209        location[0] &= ~((static_cast<uint16_t>(0x7f) >> 2) << 6);
    21792210        location[0] |= (imm.getUInt7() >> 2) << 6;
    2180         ExecutableAllocator::cacheFlush(location, sizeof(uint16_t));
     2211        cacheFlush(location, sizeof(uint16_t));
    21812212    }
    21822213
Note: See TracChangeset for help on using the changeset viewer.