diff options
Diffstat (limited to 'Source/JavaScriptCore/assembler/MIPSAssembler.h')
-rw-r--r-- | Source/JavaScriptCore/assembler/MIPSAssembler.h | 33 |
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() |