Bug 1434054 - Remove unused macroassembler functions. r=bbouvier
authorLars T Hansen <lhansen@mozilla.com>
Tue, 13 Mar 2018 13:10:36 +0100
changeset 407960 e96ef96eb6a3123e0e05aa7cfeaf5e909b586835
parent 407959 73abceaedc8fa960aa8949295e885c4d8098edeb
child 407961 9a9390557aabdbca55af4a48c2183d47a7e0581a
push id33624
push userrgurzau@mozilla.com
push dateTue, 13 Mar 2018 22:40:34 +0000
treeherdermozilla-central@c56ef1c14a55 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1434054
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1434054 - Remove unused macroassembler functions. r=bbouvier
js/src/jit/MacroAssembler.h
js/src/jit/arm/MacroAssembler-arm.cpp
js/src/jit/arm64/MacroAssembler-arm64.cpp
js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
js/src/jit/x86-shared/Assembler-x86-shared.h
js/src/jit/x86-shared/MacroAssembler-x86-shared.cpp
--- a/js/src/jit/MacroAssembler.h
+++ b/js/src/jit/MacroAssembler.h
@@ -548,23 +548,16 @@ class MacroAssembler : public MacroAssem
     // ===============================================================
     // Patchable near/far jumps.
 
     // "Far jumps" provide the ability to jump to any uint32_t offset from any
     // other uint32_t offset without using a constant pool (thus returning a
     // simple CodeOffset instead of a CodeOffsetJump).
     CodeOffset farJumpWithPatch() PER_SHARED_ARCH;
     void patchFarJump(CodeOffset farJump, uint32_t targetOffset) PER_SHARED_ARCH;
-    static void repatchFarJump(uint8_t* code, uint32_t farJumpOffset, uint32_t targetOffset) PER_SHARED_ARCH;
-
-    // Emit a nop that can be patched to and from a nop and a jump with an int8
-    // relative displacement.
-    CodeOffset nopPatchableToNearJump() PER_SHARED_ARCH;
-    static void patchNopToNearJump(uint8_t* jump, uint8_t* target) PER_SHARED_ARCH;
-    static void patchNearJumpToNop(uint8_t* jump) PER_SHARED_ARCH;
 
     // Emit a nop that can be patched to and from a nop and a call with int32
     // relative displacement.
     CodeOffset nopPatchableToCall(const wasm::CallSiteDesc& desc) PER_SHARED_ARCH;
     static void patchNopToCall(uint8_t* callsite, uint8_t* target) PER_SHARED_ARCH;
     static void patchCallToNop(uint8_t* callsite) PER_SHARED_ARCH;
 
   public:
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -4477,52 +4477,16 @@ MacroAssembler::patchFarJump(CodeOffset 
     uint32_t addOffset = farJump.offset() - 4;
     MOZ_ASSERT(editSrc(BufferOffset(addOffset))->is<InstALU>());
 
     // When pc is read as the operand of the add, its value is the address of
     // the add instruction + 8.
     *u32 = (targetOffset - addOffset) - 8;
 }
 
-void
-MacroAssembler::repatchFarJump(uint8_t* code, uint32_t farJumpOffset, uint32_t targetOffset)
-{
-    uint32_t* u32 = reinterpret_cast<uint32_t*>(code + farJumpOffset);
-
-    uint32_t addOffset = farJumpOffset - 4;
-    MOZ_ASSERT(reinterpret_cast<Instruction*>(code + addOffset)->is<InstALU>());
-
-    *u32 = (targetOffset - addOffset) - 8;
-}
-
-CodeOffset
-MacroAssembler::nopPatchableToNearJump()
-{
-    // Inhibit pools so that the offset points precisely to the nop.
-    AutoForbidPools afp(this, 1);
-
-    CodeOffset offset(currentOffset());
-    ma_nop();
-    return offset;
-}
-
-void
-MacroAssembler::patchNopToNearJump(uint8_t* jump, uint8_t* target)
-{
-    MOZ_ASSERT(reinterpret_cast<Instruction*>(jump)->is<InstNOP>());
-    new (jump) InstBImm(BOffImm(target - jump), Assembler::Always);
-}
-
-void
-MacroAssembler::patchNearJumpToNop(uint8_t* jump)
-{
-    MOZ_ASSERT(reinterpret_cast<Instruction*>(jump)->is<InstBImm>());
-    new (jump) InstNOP();
-}
-
 CodeOffset
 MacroAssembler::nopPatchableToCall(const wasm::CallSiteDesc& desc)
 {
     CodeOffset offset(currentOffset());
     ma_nop();
     append(desc, CodeOffset(currentOffset()));
     return offset;
 }
--- a/js/src/jit/arm64/MacroAssembler-arm64.cpp
+++ b/js/src/jit/arm64/MacroAssembler-arm64.cpp
@@ -699,40 +699,16 @@ MacroAssembler::patchFarJump(CodeOffset 
 
     MOZ_ASSERT(inst1->InstructionBits() == UINT32_MAX);
     MOZ_ASSERT(inst2->InstructionBits() == UINT32_MAX);
 
     inst1->SetInstructionBits((uint32_t)distance);
     inst2->SetInstructionBits((uint32_t)(distance >> 32));
 }
 
-void
-MacroAssembler::repatchFarJump(uint8_t* code, uint32_t farJumpOffset, uint32_t targetOffset)
-{
-    MOZ_CRASH("Unimplemented - never used");
-}
-
-CodeOffset
-MacroAssembler::nopPatchableToNearJump()
-{
-    MOZ_CRASH("Unimplemented - never used");
-}
-
-void
-MacroAssembler::patchNopToNearJump(uint8_t* jump, uint8_t* target)
-{
-    MOZ_CRASH("Unimplemented - never used");
-}
-
-void
-MacroAssembler::patchNearJumpToNop(uint8_t* jump)
-{
-    MOZ_CRASH("Unimplemented - never used");
-}
-
 CodeOffset
 MacroAssembler::nopPatchableToCall(const wasm::CallSiteDesc& desc)
 {
     CodeOffset offset(currentOffset());
     Nop();
     append(desc, CodeOffset(currentOffset()));
     return offset;
 }
--- a/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
+++ b/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
@@ -1625,44 +1625,16 @@ void
 MacroAssembler::patchFarJump(CodeOffset farJump, uint32_t targetOffset)
 {
     uint32_t* u32 = reinterpret_cast<uint32_t*>(editSrc(BufferOffset(farJump.offset())));
     MOZ_ASSERT(*u32 == UINT32_MAX);
     *u32 = targetOffset - farJump.offset();
 }
 
 void
-MacroAssembler::repatchFarJump(uint8_t* code, uint32_t farJumpOffset, uint32_t targetOffset)
-{
-    uint32_t* u32 = reinterpret_cast<uint32_t*>(code + farJumpOffset);
-    *u32 = targetOffset - farJumpOffset;
-}
-
-CodeOffset
-MacroAssembler::nopPatchableToNearJump()
-{
-    CodeOffset offset(currentOffset());
-    as_nop();
-    as_nop();
-    return offset;
-}
-
-void
-MacroAssembler::patchNopToNearJump(uint8_t* jump, uint8_t* target)
-{
-    new (jump) InstImm(op_beq, zero, zero, BOffImm16(target - jump));
-}
-
-void
-MacroAssembler::patchNearJumpToNop(uint8_t* jump)
-{
-    new (jump) InstNOP();
-}
-
-void
 MacroAssembler::call(wasm::SymbolicAddress target)
 {
     movePtr(target, CallReg);
     call(CallReg);
 }
 
 void
 MacroAssembler::call(const Address& addr)
--- a/js/src/jit/x86-shared/Assembler-x86-shared.h
+++ b/js/src/jit/x86-shared/Assembler-x86-shared.h
@@ -1079,19 +1079,16 @@ class AssemblerX86Shared : public Assemb
     }
     CodeOffset farJumpWithPatch() {
         return CodeOffset(masm.jmp().offset());
     }
     void patchFarJump(CodeOffset farJump, uint32_t targetOffset) {
         unsigned char* code = masm.data();
         X86Encoding::SetRel32(code + farJump.offset(), code + targetOffset);
     }
-    static void repatchFarJump(uint8_t* code, uint32_t farJumpOffset, uint32_t targetOffset) {
-        X86Encoding::SetRel32(code + farJumpOffset, code + targetOffset);
-    }
 
     // This is for patching during code generation, not after.
     void patchAddl(CodeOffset offset, int32_t n) {
         unsigned char* code = masm.data();
         X86Encoding::SetInt32(code + offset.offset(), n);
     }
 
     CodeOffset twoByteNop() {
--- a/js/src/jit/x86-shared/MacroAssembler-x86-shared.cpp
+++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared.cpp
@@ -588,40 +588,16 @@ MacroAssembler::farJumpWithPatch()
 }
 
 void
 MacroAssembler::patchFarJump(CodeOffset farJump, uint32_t targetOffset)
 {
     Assembler::patchFarJump(farJump, targetOffset);
 }
 
-void
-MacroAssembler::repatchFarJump(uint8_t* code, uint32_t farJumpOffset, uint32_t targetOffset)
-{
-    Assembler::repatchFarJump(code, farJumpOffset, targetOffset);
-}
-
-CodeOffset
-MacroAssembler::nopPatchableToNearJump()
-{
-    return Assembler::twoByteNop();
-}
-
-void
-MacroAssembler::patchNopToNearJump(uint8_t* jump, uint8_t* target)
-{
-    Assembler::patchTwoByteNopToJump(jump, target);
-}
-
-void
-MacroAssembler::patchNearJumpToNop(uint8_t* jump)
-{
-    Assembler::patchJumpToTwoByteNop(jump);
-}
-
 CodeOffset
 MacroAssembler::nopPatchableToCall(const wasm::CallSiteDesc& desc)
 {
     CodeOffset offset(currentOffset());
     masm.nop_five();
     append(desc, CodeOffset(currentOffset()));
     MOZ_ASSERT_IF(!oom(), size() - offset.offset() == ToggledCallSize(nullptr));
     return offset;