Bug 1194072 - IonMonkey: MIPS32: Add an option to mark JIT pages as non-writable. r=nbp CLOSED TREE
authorHeiher <r@hev.cc>
Thu, 13 Aug 2015 08:23:22 -0700
changeset 257596 3341eda2963a1678b85deecaa790dbe71c963aa8
parent 257595 157a34bd309cce29c97a4398437f1e084fb4db21
child 257597 06f4591f8142ecd41089957686351eb9f18ff8f9
push id29223
push userkwierso@gmail.com
push dateThu, 13 Aug 2015 22:18:08 +0000
treeherdermozilla-central@4b35236fc76e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1194072
milestone43.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 1194072 - IonMonkey: MIPS32: Add an option to mark JIT pages as non-writable. r=nbp CLOSED TREE
js/src/jit/mips32/Assembler-mips32.cpp
js/src/jit/mips32/Assembler-mips32.h
--- a/js/src/jit/mips32/Assembler-mips32.cpp
+++ b/js/src/jit/mips32/Assembler-mips32.cpp
@@ -150,21 +150,22 @@ js::jit::toR(Instruction& i)
 void
 InstImm::extractImm16(BOffImm16* dest)
 {
     *dest = BOffImm16(*this);
 }
 
 // Used to patch jumps created by MacroAssemblerMIPSCompat::jumpWithPatch.
 void
-jit::PatchJump(CodeLocationJump& jump_, CodeLocationLabel label)
+jit::PatchJump(CodeLocationJump& jump_, CodeLocationLabel label, ReprotectCode reprotect)
 {
     Instruction* inst1 = (Instruction*)jump_.raw();
     Instruction* inst2 = inst1->next();
 
+    MaybeAutoWritableJitCode awjc(inst1, 8, reprotect);
     Assembler::UpdateLuiOriValue(inst1, inst2, (uint32_t)label.raw());
 
     AutoFlushICache::flush(uintptr_t(inst1), 8);
 }
 
 // For more infromation about backedges look at comment in
 // MacroAssemblerMIPSCompat::backedgeJump()
 void
--- a/js/src/jit/mips32/Assembler-mips32.h
+++ b/js/src/jit/mips32/Assembler-mips32.h
@@ -628,17 +628,18 @@ class Operand
     }
     Register baseReg() const {
         MOZ_ASSERT(tag == MEM);
         return Register::FromCode(reg);
     }
 };
 
 void
-PatchJump(CodeLocationJump& jump_, CodeLocationLabel label);
+PatchJump(CodeLocationJump& jump_, CodeLocationLabel label,
+          ReprotectCode reprotect = DontReprotect);
 
 void
 PatchBackedge(CodeLocationJump& jump_, CodeLocationLabel label, JitRuntime::BackedgeTarget target);
 
 class Assembler;
 typedef js::jit::AssemblerBuffer<1024, Instruction> MIPSBuffer;
 
 class MIPSBufferWithExecutableCopy : public MIPSBuffer