diff options
author | Balazs Kilvady <kilvadyb@homejinni.com> | 2013-01-07 19:40:10 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-23 13:38:48 +0200 |
commit | 9147a90a7bdf8a0791efa9d677a0f36ffdb75533 (patch) | |
tree | b5b8f2bc485afc532ab8730c482bcf9d68fd58b3 /Source/JavaScriptCore/llint | |
parent | d7fff220c897ab0eebcd6ca8087efd4b9477beb9 (diff) | |
download | qtwebkit-9147a90a7bdf8a0791efa9d677a0f36ffdb75533.tar.gz |
MIPS LLInt implementation.
https://bugs.webkit.org/show_bug.cgi?id=99706
Patch by Balazs Kilvady <kilvadyb@homejinni.com> on 2013-01-07
Reviewed by Filip Pizlo.
LLInt implementation for MIPS.
Source/JavaScriptCore:
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::jump):
* dfg/DFGOperations.cpp:
(JSC):
* jit/JITStubs.cpp:
(JSC):
* jit/JITStubs.h:
(JITStackFrame):
* llint/LLIntOfflineAsmConfig.h:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* offlineasm/backends.rb:
* offlineasm/instructions.rb:
* offlineasm/mips.rb: Added.
Source/WTF:
* wtf/Platform.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138970 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Conflicts:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/jit/JITStubs.h
Change-Id: I1677d54c1641cf60e517772944582c8f387eeb6d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/llint')
-rw-r--r-- | Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h | 20 | ||||
-rw-r--r-- | Source/JavaScriptCore/llint/LowLevelInterpreter.asm | 12 | ||||
-rw-r--r-- | Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm | 24 |
3 files changed, 48 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h b/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h index da2d510b5..157521373 100644 --- a/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h +++ b/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h @@ -38,6 +38,7 @@ #define OFFLINE_ASM_ARMv7 0 #define OFFLINE_ASM_X86_64 0 #define OFFLINE_ASM_ARMv7s 0 +#define OFFLINE_ASM_MIPS 0 #else // !ENABLE(LLINT_C_LOOP) @@ -67,6 +68,12 @@ #define OFFLINE_ASM_X86_64 0 #endif +#if CPU(MIPS) +#define OFFLINE_ASM_MIPS 1 +#else +#define OFFLINE_ASM_MIPS 0 +#endif + #endif // !ENABLE(LLINT_C_LOOP) #if USE(JSVALUE64) @@ -111,4 +118,17 @@ #define OFFLINE_ASM_VALUE_PROFILER 0 #endif +#if CPU(MIPS) +#ifdef WTF_MIPS_PIC +#define S(x) #x +#define SX(x) S(x) +#define OFFLINE_ASM_CPLOAD(reg) \ + ".set noreorder\n" \ + ".cpload " SX(reg) "\n" \ + ".set reorder\n" +#else +#define OFFLINE_ASM_CPLOAD(reg) +#endif +#endif + #endif // LLIntOfflineAsmConfig_h diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm index 00d5c4f6f..9de48f1f6 100644 --- a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm +++ b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm @@ -182,10 +182,8 @@ macro assert(assertion) end macro preserveReturnAddressAfterCall(destinationRegister) - if C_LOOP - # In our case, we're only preserving the bytecode vPC. - move lr, destinationRegister - elsif ARMv7 + if C_LOOP or ARMv7 or MIPS + # In C_LOOP case, we're only preserving the bytecode vPC. move lr, destinationRegister elsif X86 or X86_64 pop destinationRegister @@ -195,10 +193,8 @@ macro preserveReturnAddressAfterCall(destinationRegister) end macro restoreReturnAddressBeforeReturn(sourceRegister) - if C_LOOP - # In our case, we're only restoring the bytecode vPC. - move sourceRegister, lr - elsif ARMv7 + if C_LOOP or ARMv7 or MIPS + # In C_LOOP case, we're only restoring the bytecode vPC. move sourceRegister, lr elsif X86 or X86_64 push sourceRegister diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm index 8d5cdf108..9a17985bc 100644 --- a/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm +++ b/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm @@ -113,6 +113,10 @@ macro cCall2(function, arg1, arg2) poke arg1, 0 poke arg2, 1 call function + elsif MIPS + move arg1, a0 + move arg2, a1 + call function elsif C_LOOP cloopCallSlowPath function, arg1, arg2 else @@ -134,6 +138,12 @@ macro cCall4(function, arg1, arg2, arg3, arg4) poke arg3, 2 poke arg4, 3 call function + elsif MIPS + move arg1, a0 + move arg2, a1 + move arg3, a2 + move arg4, a3 + call function elsif C_LOOP error else @@ -1818,6 +1828,20 @@ macro nativeCallTrampoline(executableOffsetToFunction) call executableOffsetToFunction[t1] restoreReturnAddressBeforeReturn(t3) loadp JITStackFrame::globalData[sp], t3 + elsif MIPS + loadp JITStackFrame::globalData[sp], t3 + storep cfr, JSGlobalData::topCallFrame[t3] + move t0, t2 + preserveReturnAddressAfterCall(t3) + storep t3, ReturnPC[cfr] + move cfr, t0 + loadi Callee + PayloadOffset[cfr], t1 + loadp JSFunction::m_executable[t1], t1 + move t2, cfr + move t0, a0 + call executableOffsetToFunction[t1] + restoreReturnAddressBeforeReturn(t3) + loadp JITStackFrame::globalData[sp], t3 elsif C_LOOP loadp JITStackFrame::globalData[sp], t3 storep cfr, JSGlobalData::topCallFrame[t3] |