summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/assembler/MIPSAssembler.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
commit32761a6cee1d0dee366b885b7b9c777e67885688 (patch)
treed6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/assembler/MIPSAssembler.h
parenta4e969f4965059196ca948db781e52f7cfebf19e (diff)
downloadWebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/assembler/MIPSAssembler.h')
-rw-r--r--Source/JavaScriptCore/assembler/MIPSAssembler.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/Source/JavaScriptCore/assembler/MIPSAssembler.h b/Source/JavaScriptCore/assembler/MIPSAssembler.h
index dc518433e..b75b4d0af 100644
--- a/Source/JavaScriptCore/assembler/MIPSAssembler.h
+++ b/Source/JavaScriptCore/assembler/MIPSAssembler.h
@@ -151,11 +151,11 @@ public:
typedef MIPSRegisters::FPRegisterID FPRegisterID;
typedef SegmentedVector<AssemblerLabel, 64> Jumps;
- static constexpr RegisterID firstRegister() { return MIPSRegisters::r0; }
- static constexpr RegisterID lastRegister() { return MIPSRegisters::r31; }
+ static RegisterID firstRegister() { return MIPSRegisters::r0; }
+ static RegisterID lastRegister() { return MIPSRegisters::r31; }
- static constexpr FPRegisterID firstFPRegister() { return MIPSRegisters::f0; }
- static constexpr FPRegisterID lastFPRegister() { return MIPSRegisters::f31; }
+ static FPRegisterID firstFPRegister() { return MIPSRegisters::f0; }
+ static FPRegisterID lastFPRegister() { return MIPSRegisters::f31; }
MIPSAssembler()
: m_indexOfLastWatchpoint(INT_MIN)
@@ -240,11 +240,6 @@ public:
emitInst(0x3c000000 | (rt << OP_SH_RT) | (imm & 0xffff));
}
- void clz(RegisterID rd, RegisterID rs)
- {
- emitInst(0x70000020 | (rd << OP_SH_RD) | (rs << OP_SH_RS) | (rd << OP_SH_RT));
- }
-
void addiu(RegisterID rt, RegisterID rs, int imm)
{
emitInst(0x24000000 | (rt << OP_SH_RT) | (rs << OP_SH_RS) | (imm & 0xffff));
@@ -875,8 +870,28 @@ public:
static void cacheFlush(void* code, size_t size)
{
+#if GCC_VERSION_AT_LEAST(4, 3, 0)
+#if WTF_MIPS_ISA_REV(2) && !GCC_VERSION_AT_LEAST(4, 4, 3)
+ int lineSize;
+ asm("rdhwr %0, $1" : "=r" (lineSize));
+ //
+ // Modify "start" and "end" to avoid GCC 4.3.0-4.4.2 bug in
+ // mips_expand_synci_loop that may execute synci one more time.
+ // "start" points to the fisrt byte of the cache line.
+ // "end" points to the last byte of the line before the last cache line.
+ // Because size is always a multiple of 4, this is safe to set
+ // "end" to the last byte.
+ //
+ intptr_t start = reinterpret_cast<intptr_t>(code) & (-lineSize);
+ intptr_t end = ((reinterpret_cast<intptr_t>(code) + size - 1) & (-lineSize)) - 1;
+ __builtin___clear_cache(reinterpret_cast<char*>(start), reinterpret_cast<char*>(end));
+#else
intptr_t end = reinterpret_cast<intptr_t>(code) + size;
__builtin___clear_cache(reinterpret_cast<char*>(code), reinterpret_cast<char*>(end));
+#endif
+#else
+ _flush_cache(reinterpret_cast<char*>(code), size, BCACHE);
+#endif
}
static ptrdiff_t maxJumpReplacementSize()