Commit 0505a8fa authored by barraclough@apple.com's avatar barraclough@apple.com

2009-09-18 Gabor Loki <loki@inf.u-szeged.hu>

        Reviewed by Gavin Barraclough.

        Build fix to enable ARM_THUMB2 on Linux
        https://bugs.webkit.org/show_bug.cgi?id=

        * jit/ExecutableAllocator.h:
        (JSC::ExecutableAllocator::cacheFlush):
        * jit/JITStubs.cpp:
        * wtf/Platform.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48527 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 83c45d04
2009-09-18 Gabor Loki <loki@inf.u-szeged.hu>
Reviewed by Gavin Barraclough.
Build fix to enable ARM_THUMB2 on Linux
https://bugs.webkit.org/show_bug.cgi?id=
* jit/ExecutableAllocator.h:
(JSC::ExecutableAllocator::cacheFlush):
* jit/JITStubs.cpp:
* wtf/Platform.h:
2009-09-18 Gabor Loki <loki@inf.u-szeged.hu>
Reviewed by Gavin Barraclough.
......
......@@ -191,24 +191,28 @@ public:
{
User::IMB_Range(code, static_cast<char*>(code) + size);
}
#elif PLATFORM(ARM_TRADITIONAL)
#elif PLATFORM(ARM) && COMPILER(GCC) && (GCC_VERSION >= 30406)
static void cacheFlush(void* code, size_t size)
{
#if COMPILER(GCC) && (GCC_VERSION >= 30406)
__clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(code) + size);
#else
const int syscall = 0xf0002;
__asm __volatile (
"mov r0, %0\n"
"mov r1, %1\n"
"mov r7, %2\n"
"mov r2, #0x0\n"
"swi 0x00000000\n"
:
: "r" (code), "r" (reinterpret_cast<char*>(code) + size), "r" (syscall)
: "r0", "r1", "r7");
#endif // COMPILER(GCC) && (GCC_VERSION >= 30406)
}
#elif PLATFORM(ARM_TRADITIONAL) && PLATFORM(LINUX)
static void cacheFlush(void* code, size_t size)
{
asm volatile (
"push {r7}\n"
"mov r0, %0\n"
"mov r1, %1\n"
"mov r7, 0xf0002\n"
"mov r2, #0x0\n"
"svc 0x0\n"
"pop {r7}\n"
:
: "r" (code), "r" (reinterpret_cast<char*>(code) + size)
: "r0", "r1");
}
#else
#error "The cacheFlush support is missing on this platform."
#endif
private:
......
......@@ -69,6 +69,12 @@ namespace JSC {
#define SYMBOL_STRING(name) #name
#endif
#if PLATFORM(IPHONE)
#define THUMB_FUNC_PARAM(name) SYMBOL_STRING(name)
#else
#define THUMB_FUNC_PARAM(name)
#endif
#if USE(JSVALUE32_64)
#if COMPILER(GCC) && PLATFORM(X86)
......@@ -204,7 +210,7 @@ asm volatile (
".align 2" "\n"
".globl " SYMBOL_STRING(ctiTrampoline) "\n"
".thumb" "\n"
".thumb_func " SYMBOL_STRING(ctiTrampoline) "\n"
".thumb_func " THUMB_FUNC_PARAM(ctiTrampoline) "\n"
SYMBOL_STRING(ctiTrampoline) ":" "\n"
"sub sp, sp, #0x3c" "\n"
"str lr, [sp, #0x20]" "\n"
......@@ -230,7 +236,7 @@ asm volatile (
".align 2" "\n"
".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
".thumb" "\n"
".thumb_func " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n"
SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
"cpy r0, sp" "\n"
"bl " SYMBOL_STRING(cti_vm_throw) "\n"
......@@ -247,7 +253,7 @@ asm volatile (
".align 2" "\n"
".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
".thumb" "\n"
".thumb_func " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
".thumb_func " THUMB_FUNC_PARAM(ctiOpThrowNotCaught) "\n"
SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
"ldr r6, [sp, #0x2c]" "\n"
"ldr r5, [sp, #0x28]" "\n"
......@@ -463,7 +469,7 @@ asm volatile (
".align 2" "\n"
".globl " SYMBOL_STRING(ctiTrampoline) "\n"
".thumb" "\n"
".thumb_func " SYMBOL_STRING(ctiTrampoline) "\n"
".thumb_func " THUMB_FUNC_PARAM(ctiTrampoline) "\n"
SYMBOL_STRING(ctiTrampoline) ":" "\n"
"sub sp, sp, #0x3c" "\n"
"str lr, [sp, #0x20]" "\n"
......@@ -489,7 +495,7 @@ asm volatile (
".align 2" "\n"
".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
".thumb" "\n"
".thumb_func " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
".thumb_func " THUMB_FUNC_PARAM(ctiVMThrowTrampoline) "\n"
SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
"cpy r0, sp" "\n"
"bl " SYMBOL_STRING(cti_vm_throw) "\n"
......@@ -506,7 +512,7 @@ asm volatile (
".align 2" "\n"
".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
".thumb" "\n"
".thumb_func " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
".thumb_func " THUMB_FUNC_PARAM(ctiOpThrowNotCaught) "\n"
SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
"ldr r6, [sp, #0x2c]" "\n"
"ldr r5, [sp, #0x28]" "\n"
......@@ -887,7 +893,7 @@ static NEVER_INLINE void throwStackOverflowError(CallFrame* callFrame, JSGlobalD
".align 2" "\n" \
".globl " SYMBOL_STRING(cti_##op) "\n" \
".thumb" "\n" \
".thumb_func " SYMBOL_STRING(cti_##op) "\n" \
".thumb_func " THUMB_FUNC_PARAM(cti_##op) "\n" \
SYMBOL_STRING(cti_##op) ":" "\n" \
"str lr, [sp, #0x1c]" "\n" \
"bl " SYMBOL_STRING(JITStubThunked_##op) "\n" \
......
......@@ -673,6 +673,9 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
#define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1
#elif PLATFORM(ARM_TRADITIONAL) && PLATFORM(LINUX)
#define ENABLE_JIT 1
#if PLATFORM(ARM_THUMB2)
#define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 0
#endif
#endif
#endif /* PLATFORM(QT) */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment