Bug 1207827 - Eliminate poolSizeBefore(). r=nbp
☠☠ backed out by d3659c740f48 ☠ ☠
authorJakob Olesen <jolesen@mozilla.com>
Tue, 20 Oct 2015 12:57:39 -0700
changeset 303828 a77d26defefc0f3dcafff2dc5810d7455262c136
parent 303827 0ea4e13f313d26d34cb1762d1781a53153020800
child 303829 d518935ddd2e7fb08b267b97d1bd31d68b55e8ae
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1207827
milestone44.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 1207827 - Eliminate poolSizeBefore(). r=nbp This method was used by the Assembler::actualOffset() methods to translate buffer offsets from pre-pool to post-pool numbers. Since pools are now injected immediately, there is no need to translate offsets. All the actualOffset() methods have become no-ops in all our supported targets.
js/src/jit/arm/Assembler-arm.cpp
js/src/jit/arm/Assembler-arm.h
js/src/jit/arm64/Assembler-arm64.h
js/src/jit/shared/IonAssemblerBufferWithConstantPools.h
--- a/js/src/jit/arm/Assembler-arm.cpp
+++ b/js/src/jit/arm/Assembler-arm.cpp
@@ -629,66 +629,51 @@ void
 Assembler::finish()
 {
     flush();
     MOZ_ASSERT(!isFinished);
     isFinished = true;
 
     for (unsigned int i = 0; i < tmpDataRelocations_.length(); i++) {
         size_t offset = tmpDataRelocations_[i].getOffset();
-        size_t real_offset = offset + m_buffer.poolSizeBefore(offset);
-        dataRelocations_.writeUnsigned(real_offset);
+        dataRelocations_.writeUnsigned(offset);
     }
 
     for (unsigned int i = 0; i < tmpJumpRelocations_.length(); i++) {
         size_t offset = tmpJumpRelocations_[i].getOffset();
-        size_t real_offset = offset + m_buffer.poolSizeBefore(offset);
-        jumpRelocations_.writeUnsigned(real_offset);
+        jumpRelocations_.writeUnsigned(offset);
     }
 
     for (unsigned int i = 0; i < tmpPreBarriers_.length(); i++) {
         size_t offset = tmpPreBarriers_[i].getOffset();
-        size_t real_offset = offset + m_buffer.poolSizeBefore(offset);
-        preBarriers_.writeUnsigned(real_offset);
+        preBarriers_.writeUnsigned(offset);
     }
 }
 
 void
 Assembler::executableCopy(uint8_t* buffer)
 {
     MOZ_ASSERT(isFinished);
     m_buffer.executableCopy(buffer);
     AutoFlushICache::setRange(uintptr_t(buffer), m_buffer.size());
 }
 
 uint32_t
-Assembler::actualOffset(uint32_t off_) const
-{
-    return off_ + m_buffer.poolSizeBefore(off_);
-}
-
-uint32_t
 Assembler::actualIndex(uint32_t idx_) const
 {
     ARMBuffer::PoolEntry pe(idx_);
     return m_buffer.poolEntryOffset(pe);
 }
 
 uint8_t*
 Assembler::PatchableJumpAddress(JitCode* code, uint32_t pe_)
 {
     return code->raw() + pe_;
 }
 
-BufferOffset
-Assembler::actualOffset(BufferOffset off_) const
-{
-    return BufferOffset(off_.getOffset() + m_buffer.poolSizeBefore(off_.getOffset()));
-}
-
 class RelocationIterator
 {
     CompactBufferReader reader_;
     // Offset in bytes.
     uint32_t offset_;
 
   public:
     RelocationIterator(CompactBufferReader& reader)
--- a/js/src/jit/arm/Assembler-arm.h
+++ b/js/src/jit/arm/Assembler-arm.h
@@ -1266,20 +1266,19 @@ class Assembler : public AssemblerShared
     void spewData(BufferOffset addr, size_t numInstr, bool loadToPC);
     void spewLabel(Label* label);
     void spewRetarget(Label* label, Label* target);
     void spewTarget(Label* l);
 #endif
 
   public:
     void resetCounter();
-    uint32_t actualOffset(uint32_t) const;
+    uint32_t actualOffset(uint32_t off) const { return off; }
     uint32_t actualIndex(uint32_t) const;
     static uint8_t* PatchableJumpAddress(JitCode* code, uint32_t index);
-    BufferOffset actualOffset(BufferOffset) const;
     static uint32_t NopFill;
     static uint32_t GetNopFill();
     static uint32_t AsmPoolMaxOffset;
     static uint32_t GetPoolMaxOffset();
 
   protected:
     // Structure for fixing up pc-relative loads/jumps when a the machine code
     // gets moved (executable copy, gc, etc.).
--- a/js/src/jit/arm64/Assembler-arm64.h
+++ b/js/src/jit/arm64/Assembler-arm64.h
@@ -258,19 +258,17 @@ class Assembler : public vixl::Assembler
     void retarget(Label* cur, Label* next);
 
     // The buffer is about to be linked. Ensure any constant pools or
     // excess bookkeeping has been flushed to the instruction stream.
     void flush() {
         armbuffer_.flushPool();
     }
 
-    int actualOffset(int curOffset) {
-        return curOffset + armbuffer_.poolSizeBefore(curOffset);
-    }
+    int actualOffset(int curOffset) { return curOffset; }
     int actualIndex(int curOffset) {
         ARMBuffer::PoolEntry pe(curOffset);
         return armbuffer_.poolEntryOffset(pe);
     }
     int labelOffsetToPatchOffset(int labelOff) {
         return actualOffset(labelOff);
     }
     static uint8_t* PatchableJumpAddress(JitCode* code, uint32_t index) {
@@ -344,17 +342,17 @@ class Assembler : public vixl::Assembler
     static int32_t ExtractCodeLabelOffset(uint8_t* code);
     static void PatchInstructionImmediate(uint8_t* code, PatchedImmPtr imm);
 
     static void FixupNurseryObjects(JSContext* cx, JitCode* code, CompactBufferReader& reader,
                                     const ObjectVector& nurseryObjects);
 
     // Convert a BufferOffset to a final byte offset from the start of the code buffer.
     size_t toFinalOffset(BufferOffset offset) {
-        return size_t(offset.getOffset() + armbuffer_.poolSizeBefore(offset.getOffset()));
+        return size_t(offset.getOffset());
     }
 
   public:
     // A Jump table entry is 2 instructions, with 8 bytes of raw data
     static const size_t SizeOfJumpTableEntry = 16;
 
     struct JumpTableEntry
     {
--- a/js/src/jit/shared/IonAssemblerBufferWithConstantPools.h
+++ b/js/src/jit/shared/IonAssemblerBufferWithConstantPools.h
@@ -594,21 +594,16 @@ struct AssemblerBufferWithConstantPools 
     void leaveNoPool() {
         MOZ_ASSERT(canNotPlacePool_);
         canNotPlacePool_ = false;
 
         // Validate the maxInst argument supplied to enterNoPool().
         MOZ_ASSERT(this->nextOffset().getOffset() - canNotPlacePoolStartOffset_ <= canNotPlacePoolMaxInst_ * InstSize);
     }
 
-    size_t poolSizeBefore(size_t offset) const {
-        // Pools are emitted inline, no adjustment required.
-        return 0;
-    }
-
     void align(unsigned alignment) {
         MOZ_ASSERT(IsPowerOfTwo(alignment));
 
         // A pool many need to be dumped at this point, so insert NOP fill here.
         insertNopFill();
 
         // Check if the code position can be aligned without dumping a pool.
         unsigned requiredFill = sizeExcludingCurrentPool() & (alignment - 1);