Bug 1277408 - Odin: don't forget to AutoForbidPools in the prologue nop either (r=bbouvier)
authorLuke Wagner <luke@mozilla.com>
Thu, 02 Jun 2016 14:36:53 -0500
changeset 339260 0df235f3ea95d90cc8101c4dadc291ac521d05a6
parent 339259 c07f91610f5716c51029ad605a75c0a9376bad22
child 339261 8a30acee45af528007141458f1314d818654a52a
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1277408
milestone49.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 1277408 - Odin: don't forget to AutoForbidPools in the prologue nop either (r=bbouvier) MozReview-Commit-ID: KHoUFpPT457
js/src/asmjs/WasmFrameIterator.cpp
js/src/jit/arm/MacroAssembler-arm.cpp
--- a/js/src/asmjs/WasmFrameIterator.cpp
+++ b/js/src/asmjs/WasmFrameIterator.cpp
@@ -377,24 +377,17 @@ wasm::GenerateFunctionEpilogue(MacroAsse
     // Flush pending pools so they do not get dumped between the profilingReturn
     // and profilingJump/profilingEpilogue offsets since the difference must be
     // less than UINT8_MAX.
     masm.flushBuffer();
 #endif
 
     // Generate a nop that is overwritten by a jump to the profiling epilogue
     // when profiling is enabled.
-    {
-#if defined(JS_CODEGEN_ARM)
-        // Forbid pools from being inserted between the profilingJump label and
-        // the nop since we need the location of the actual nop to patch it.
-        AutoForbidPools afp(&masm, 1);
-#endif
-        offsets->profilingJump = masm.nopPatchableToNearJump().offset();
-    }
+    offsets->profilingJump = masm.nopPatchableToNearJump().offset();
 
     // Normal epilogue:
     masm.addToStackPtr(Imm32(framePushed + AsmJSFrameBytesAfterReturnAddress));
     masm.ret();
     masm.setFramePushed(0);
 
     // Profiling epilogue:
     offsets->profilingEpilogue = masm.currentOffset();
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -4803,16 +4803,19 @@ MacroAssembler::repatchThunk(uint8_t* co
     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)
 {