Bug 1252326: Flush the assembly buffer at the end of codegen for plateforms which need it; r=luke
authorBenjamin Bouvier <benj@benj.me>
Wed, 02 Mar 2016 10:45:58 +0100
changeset 286677 7f52b56a1b6ce7eefd9f8620e03bbbc0c26297e6
parent 286676 76beb311155c91ae7afd19cb8e173ec9bcf8f580
child 286678 78d20ae3f50ebe4ce416bbf788a55d7b3050931d
push id18000
push usercbook@mozilla.com
push dateFri, 04 Mar 2016 12:40:23 +0000
treeherderfx-team@365dff9e6e1f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1252326
milestone47.0a1
Bug 1252326: Flush the assembly buffer at the end of codegen for plateforms which need it; r=luke MozReview-Commit-ID: CQyZ3eqiQIF
js/src/jit/CodeGenerator.cpp
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/MacroAssembler-x86-shared.cpp
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -8324,16 +8324,18 @@ CodeGenerator::generateAsmJS(wasm::FuncO
 #if defined(JS_ION_PERF)
     // Note the end of the inline code and start of the OOL code.
     gen->perfSpewer().noteEndInlineCode(masm);
 #endif
 
     if (!generateOutOfLineCode())
         return false;
 
+    masm.flush();
+
     offsets->end = masm.currentOffset();
 
     MOZ_ASSERT(!masm.failureLabel()->used());
     MOZ_ASSERT(snapshots_.listSize() == 0);
     MOZ_ASSERT(snapshots_.RVATableSize() == 0);
     MOZ_ASSERT(recovers_.size() == 0);
     MOZ_ASSERT(bailouts_.empty());
     MOZ_ASSERT(graph.numConstants() == 0);
--- a/js/src/jit/MacroAssembler.h
+++ b/js/src/jit/MacroAssembler.h
@@ -380,16 +380,22 @@ class MacroAssembler : public MacroAssem
 
     size_t instructionsSize() const {
         return size();
     }
 
     //{{{ check_macroassembler_style
   public:
     // ===============================================================
+    // MacroAssembler high-level usage.
+
+    // Flushes the assembly buffer, on platforms that need it.
+    void flush() PER_SHARED_ARCH;
+
+    // ===============================================================
     // Frame manipulation functions.
 
     inline uint32_t framePushed() const;
     inline void setFramePushed(uint32_t framePushed);
     inline void adjustFrame(int32_t value);
 
     // Adjust the frame, to account for implicit modification of the stack
     // pointer, such that callee can remove arguments on the behalf of the
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -5037,9 +5037,15 @@ MacroAssembler::branchTestValue(Conditio
     if (rhs.isMarkable())
         ma_cmp(lhs.payloadReg(), ImmGCPtr(reinterpret_cast<gc::Cell*>(rhs.toGCThing())));
     else
         ma_cmp(lhs.payloadReg(), Imm32(jv.s.payload.i32));
     ma_cmp(lhs.typeReg(), Imm32(jv.s.tag), Equal);
     ma_b(label, cond);
 }
 
+void
+MacroAssembler::flush()
+{
+    Assembler::flush();
+}
+
 //}}} check_macroassembler_style
--- a/js/src/jit/arm64/MacroAssembler-arm64.cpp
+++ b/js/src/jit/arm64/MacroAssembler-arm64.cpp
@@ -731,12 +731,18 @@ MacroAssembler::branchTestValue(Conditio
     vixl::UseScratchRegisterScope temps(this);
     const ARMRegister scratch64 = temps.AcquireX();
     MOZ_ASSERT(scratch64.asUnsized() != lhs.valueReg());
     moveValue(rhs, ValueOperand(scratch64.asUnsized()));
     Cmp(ARMRegister(lhs.valueReg(), 64), scratch64);
     B(label, cond);
 }
 
+void
+MacroAssembler::flush()
+{
+    Assembler::flush();
+}
+
 //}}} check_macroassembler_style
 
 } // namespace jit
 } // namespace js
--- a/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
+++ b/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
@@ -1286,9 +1286,13 @@ MacroAssembler::branchPtrInNurseryRange(
 
     const Nursery& nursery = GetJitContext()->runtime->gcNursery();
     movePtr(ImmWord(-ptrdiff_t(nursery.start())), SecondScratchReg);
     addPtr(ptr, SecondScratchReg);
     branchPtr(cond == Assembler::Equal ? Assembler::Below : Assembler::AboveOrEqual,
               SecondScratchReg, Imm32(nursery.nurserySize()), label);
 }
 
+void
+MacroAssembler::flush()
+{}
+
 //}}} check_macroassembler_style
--- a/js/src/jit/x86-shared/MacroAssembler-x86-shared.cpp
+++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared.cpp
@@ -586,9 +586,13 @@ MacroAssembler::pushFakeReturnAddress(Re
     Push(scratch);
     use(cl.target());
     uint32_t retAddr = currentOffset();
 
     addCodeLabel(cl);
     return retAddr;
 }
 
+void
+MacroAssembler::flush()
+{}
+
 //}}} check_macroassembler_style