X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/93a3786624b2768d89bfa27e46598dc64e2fb70a..cb9aa2694aba0ae4f946ed34b8e0f6c99c1cfe44:/assembler/MacroAssemblerMIPS.h diff --git a/assembler/MacroAssemblerMIPS.h b/assembler/MacroAssemblerMIPS.h index 298a25c..71b5fa9 100644 --- a/assembler/MacroAssemblerMIPS.h +++ b/assembler/MacroAssemblerMIPS.h @@ -101,6 +101,7 @@ public: }; static const RegisterID stackPointerRegister = MIPSRegisters::sp; + static const RegisterID framePointerRegister = MIPSRegisters::fp; static const RegisterID returnAddressRegister = MIPSRegisters::ra; // Integer arithmetic operations: @@ -691,6 +692,21 @@ public: } } + ALWAYS_INLINE void load8(AbsoluteAddress address, RegisterID dest) + { + load8(address.m_ptr, dest); + } + + void load8(const void* address, RegisterID dest) + { + /* + li addrTemp, address + lbu dest, 0(addrTemp) + */ + move(TrustedImmPtr(address), addrTempRegister); + m_assembler.lbu(dest, addrTempRegister, 0); + } + void load8Signed(BaseIndex address, RegisterID dest) { if (address.offset >= -32768 && address.offset <= 32767 @@ -976,6 +992,12 @@ public: } } + void store8(RegisterID src, void* address) + { + move(TrustedImmPtr(address), addrTempRegister); + m_assembler.sb(src, addrTempRegister, 0); + } + void store8(TrustedImm32 imm, void* address) { /* @@ -1292,6 +1314,15 @@ public: return branch32(cond, dataTempRegister, immTempRegister); } + Jump branch8(RelationalCondition cond, AbsoluteAddress left, TrustedImm32 right) + { + // Make sure the immediate value is unsigned 8 bits. + ASSERT(!(right.m_value & 0xFFFFFF00)); + load8(left, dataTempRegister); + move(right, immTempRegister); + return branch32(cond, dataTempRegister, immTempRegister); + } + void compare8(RelationalCondition cond, Address left, TrustedImm32 right, RegisterID dest) { // Make sure the immediate value is unsigned 8 bits. @@ -1444,6 +1475,12 @@ public: return branchTest32(cond, dataTempRegister, mask); } + Jump branchTest8(ResultCondition cond, BaseIndex address, TrustedImm32 mask = TrustedImm32(-1)) + { + load8(address, dataTempRegister); + return branchTest32(cond, dataTempRegister, mask); + } + Jump branchTest8(ResultCondition cond, Address address, TrustedImm32 mask = TrustedImm32(-1)) { load8(address, dataTempRegister); @@ -2231,7 +2268,7 @@ public: #endif } - void loadDouble(const void* address, FPRegisterID dest) + void loadDouble(TrustedImmPtr address, FPRegisterID dest) { #if WTF_MIPS_ISA(1) /* @@ -2239,7 +2276,7 @@ public: lwc1 dest, 0(addrTemp) lwc1 dest+1, 4(addrTemp) */ - move(TrustedImmPtr(address), addrTempRegister); + move(address, addrTempRegister); m_assembler.lwc1(dest, addrTempRegister, 0); m_assembler.lwc1(FPRegisterID(dest + 1), addrTempRegister, 4); #else @@ -2247,7 +2284,7 @@ public: li addrTemp, address ldc1 dest, 0(addrTemp) */ - move(TrustedImmPtr(address), addrTempRegister); + move(address, addrTempRegister); m_assembler.ldc1(dest, addrTempRegister, 0); #endif } @@ -2369,14 +2406,14 @@ public: #endif } - void storeDouble(FPRegisterID src, const void* address) + void storeDouble(FPRegisterID src, TrustedImmPtr address) { #if WTF_MIPS_ISA(1) - move(TrustedImmPtr(address), addrTempRegister); + move(address, addrTempRegister); m_assembler.swc1(src, addrTempRegister, 0); m_assembler.swc1(FPRegisterID(src + 1), addrTempRegister, 4); #else - move(TrustedImmPtr(address), addrTempRegister); + move(address, addrTempRegister); m_assembler.sdc1(src, addrTempRegister, 0); #endif } @@ -2412,7 +2449,7 @@ public: void addDouble(AbsoluteAddress address, FPRegisterID dest) { - loadDouble(address.m_ptr, fpTempRegister); + loadDouble(TrustedImmPtr(address.m_ptr), fpTempRegister); m_assembler.addd(dest, dest, fpTempRegister); } @@ -2698,6 +2735,11 @@ public: m_assembler.nop(); } + void memoryFence() + { + m_assembler.sync(); + } + static FunctionPtr readCallTarget(CodeLocationCall call) { return FunctionPtr(reinterpret_cast(MIPSAssembler::readCallTarget(call.dataLocation()))); @@ -2732,7 +2774,7 @@ public: return CodeLocationLabel(); } - static void revertJumpReplacementToPatchableBranchPtrWithPatch(CodeLocationLabel instructionStart, Address, void* initialValue) + static void revertJumpReplacementToPatchableBranchPtrWithPatch(CodeLocationLabel, Address, void*) { UNREACHABLE_FOR_PLATFORM(); }