diff options
Diffstat (limited to 'js/src/jit/mips32')
-rw-r--r-- | js/src/jit/mips32/Assembler-mips32.cpp | 33 | ||||
-rw-r--r-- | js/src/jit/mips32/Assembler-mips32.h | 9 |
2 files changed, 3 insertions, 39 deletions
diff --git a/js/src/jit/mips32/Assembler-mips32.cpp b/js/src/jit/mips32/Assembler-mips32.cpp index 89c7a8c44..f1fb71609 100644 --- a/js/src/jit/mips32/Assembler-mips32.cpp +++ b/js/src/jit/mips32/Assembler-mips32.cpp @@ -297,31 +297,6 @@ Assembler::Bind(uint8_t* rawCode, CodeOffset* label, const void* address) } uint32_t -Assembler::PatchWrite_NearCallSize() -{ - return 4 * sizeof(uint32_t); -} - -void -Assembler::PatchWrite_NearCall(CodeLocationLabel start, CodeLocationLabel toCall) -{ - Instruction* inst = (Instruction*) start.raw(); - uint8_t* dest = toCall.raw(); - - // Overwrite whatever instruction used to be here with a call. - // Always use long jump for two reasons: - // - Jump has to be the same size because of PatchWrite_NearCallSize. - // - Return address has to be at the end of replaced block. - // Short jump wouldn't be more efficient. - Assembler::WriteLuiOriInstructions(inst, &inst[1], ScratchRegister, (uint32_t)dest); - inst[2] = InstReg(op_special, ScratchRegister, zero, ra, ff_jalr); - inst[3] = InstNOP(); - - // Ensure everyone sees the code that was just written into memory. - AutoFlushICache::flush(uintptr_t(inst), PatchWrite_NearCallSize()); -} - -uint32_t Assembler::ExtractLuiOriValue(Instruction* inst0, Instruction* inst1) { InstImm* i0 = (InstImm*) inst0; @@ -335,14 +310,6 @@ Assembler::ExtractLuiOriValue(Instruction* inst0, Instruction* inst1) } void -Assembler::WriteLuiOriInstructions(Instruction* inst0, Instruction* inst1, - Register reg, uint32_t value) -{ - *inst0 = InstImm(op_lui, zero, reg, Imm16::Upper(Imm32(value))); - *inst1 = InstImm(op_ori, reg, reg, Imm16::Lower(Imm32(value))); -} - -void Assembler::PatchDataWithValueCheck(CodeLocationLabel label, ImmPtr newValue, ImmPtr expectedValue) { diff --git a/js/src/jit/mips32/Assembler-mips32.h b/js/src/jit/mips32/Assembler-mips32.h index 2bfb61e8e..6988d23a5 100644 --- a/js/src/jit/mips32/Assembler-mips32.h +++ b/js/src/jit/mips32/Assembler-mips32.h @@ -149,13 +149,10 @@ class Assembler : public AssemblerMIPSShared static void TraceJumpRelocations(JSTracer* trc, JitCode* code, CompactBufferReader& reader); static void TraceDataRelocations(JSTracer* trc, JitCode* code, CompactBufferReader& reader); - static uint32_t PatchWrite_NearCallSize(); - + static uint32_t InstructionImmediateSize() { + return 2 * sizeof(uint32_t); + } static uint32_t ExtractLuiOriValue(Instruction* inst0, Instruction* inst1); - static void WriteLuiOriInstructions(Instruction* inst, Instruction* inst1, - Register reg, uint32_t value); - - static void PatchWrite_NearCall(CodeLocationLabel start, CodeLocationLabel toCall); static void PatchDataWithValueCheck(CodeLocationLabel label, ImmPtr newValue, ImmPtr expectedValue); static void PatchDataWithValueCheck(CodeLocationLabel label, PatchedImmPtr newValue, |