mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
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. --HG-- extra : rebase_source : 7985a847bad5bfde2b696e1ff81420aa981d426c
This commit is contained in:
parent
f592a41614
commit
9421e197a2
@ -634,20 +634,17 @@ Assembler::finish()
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -659,12 +656,6 @@ Assembler::executableCopy(uint8_t* 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
|
||||
{
|
||||
@ -678,12 +669,6 @@ 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_;
|
||||
|
@ -1271,10 +1271,9 @@ class Assembler : public AssemblerShared
|
||||
|
||||
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;
|
||||
|
@ -263,9 +263,7 @@ class Assembler : public vixl::Assembler
|
||||
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);
|
||||
@ -349,7 +347,7 @@ class Assembler : public vixl::Assembler
|
||||
|
||||
// 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:
|
||||
|
@ -599,11 +599,6 @@ struct AssemblerBufferWithConstantPools : public AssemblerBuffer<SliceSize, Inst
|
||||
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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user