Bug 1207827 - Remove ARM temporary offset buffers. r=nbp

The ARM assembler no longer needs to keep track of code offsets for
later translation to 'actual' offsets. The AssemblerBuffer offsets
are directly usable now.

Remove tmpDataRelocations_, tmpPreBarriers_, and tmpJumpRelocations_.

--HG--
extra : rebase_source : c07b5a000fa94bb1bbc4220add1af7cd8cbaf22e
This commit is contained in:
Jakob Olesen 2015-10-20 12:57:39 -07:00
parent 901d32e8e5
commit 041f92a59d
2 changed files with 13 additions and 31 deletions

View File

@ -631,21 +631,6 @@ Assembler::finish()
flush();
MOZ_ASSERT(!isFinished);
isFinished = true;
for (unsigned int i = 0; i < tmpDataRelocations_.length(); i++) {
size_t offset = tmpDataRelocations_[i].getOffset();
dataRelocations_.writeUnsigned(offset);
}
for (unsigned int i = 0; i < tmpJumpRelocations_.length(); i++) {
size_t offset = tmpJumpRelocations_[i].getOffset();
jumpRelocations_.writeUnsigned(offset);
}
for (unsigned int i = 0; i < tmpPreBarriers_.length(); i++) {
size_t offset = tmpPreBarriers_[i].getOffset();
preBarriers_.writeUnsigned(offset);
}
}
void
@ -893,12 +878,11 @@ TraceDataRelocations(JSTracer* trc, uint8_t* buffer, CompactBufferReader& reader
}
static void
TraceDataRelocations(JSTracer* trc, ARMBuffer* buffer,
Vector<BufferOffset, 0, SystemAllocPolicy>* locs)
TraceDataRelocations(JSTracer* trc, ARMBuffer* buffer, CompactBufferReader& reader)
{
for (unsigned int idx = 0; idx < locs->length(); idx++) {
BufferOffset bo = (*locs)[idx];
ARMBuffer::AssemblerBufferInstIterator iter(bo, buffer);
while (reader.more()) {
BufferOffset offset(reader.readUnsigned());
ARMBuffer::AssemblerBufferInstIterator iter(offset, buffer);
TraceOneDataRelocation(trc, &iter);
}
}
@ -942,8 +926,10 @@ Assembler::trace(JSTracer* trc)
}
}
if (tmpDataRelocations_.length())
::TraceDataRelocations(trc, &m_buffer, &tmpDataRelocations_);
if (dataRelocations_.length()) {
CompactBufferReader reader(dataRelocations_);
::TraceDataRelocations(trc, &m_buffer, reader);
}
}
void
@ -951,7 +937,7 @@ Assembler::processCodeLabels(uint8_t* rawCode)
{
for (size_t i = 0; i < codeLabels_.length(); i++) {
CodeLabel label = codeLabels_[i];
Bind(rawCode, label.dest(), rawCode + actualOffset(label.src()->offset()));
Bind(rawCode, label.dest(), rawCode + label.src()->offset());
}
}
@ -973,8 +959,7 @@ void
Assembler::Bind(uint8_t* rawCode, AbsoluteLabel* label, const void* address)
{
// See writeCodePointer comment.
uint32_t off = actualOffset(label->offset());
*reinterpret_cast<const void**>(rawCode + off) = address;
*reinterpret_cast<const void**>(rawCode + label->offset()) = address;
}
Assembler::Condition

View File

@ -1294,9 +1294,6 @@ class Assembler : public AssemblerShared
// TODO: this should actually be a pool-like object. It is currently a big
// hack, and probably shouldn't exist.
js::Vector<RelativePatch, 8, SystemAllocPolicy> jumps_;
js::Vector<BufferOffset, 0, SystemAllocPolicy> tmpJumpRelocations_;
js::Vector<BufferOffset, 0, SystemAllocPolicy> tmpDataRelocations_;
js::Vector<BufferOffset, 0, SystemAllocPolicy> tmpPreBarriers_;
CompactBufferWriter jumpRelocations_;
CompactBufferWriter dataRelocations_;
@ -1361,7 +1358,7 @@ class Assembler : public AssemblerShared
// MacroAssemblers hold onto gcthings, so they are traced by the GC.
void trace(JSTracer* trc);
void writeRelocation(BufferOffset src) {
tmpJumpRelocations_.append(src);
jumpRelocations_.writeUnsigned(src.getOffset());
}
// As opposed to x86/x64 version, the data relocation has to be executed
@ -1371,11 +1368,11 @@ class Assembler : public AssemblerShared
if (gc::IsInsideNursery(ptr.value))
embedsNurseryPointers_ = true;
if (ptr.value)
tmpDataRelocations_.append(nextOffset());
dataRelocations_.writeUnsigned(nextOffset().getOffset());
}
}
void writePrebarrierOffset(CodeOffsetLabel label) {
tmpPreBarriers_.append(BufferOffset(label.offset()));
preBarriers_.writeUnsigned(label.offset());
}
enum RelocBranchStyle {