Bug 1165793 - Add executableCopy() back for MIPS. r=sstangl

IonAssemblerBuffer::executableCopy() was erroneously removed
in Bug 1163168.
This commit is contained in:
Aleksandar Zlicic 2015-06-15 19:55:55 +02:00
parent 2e26b7957b
commit f450b1c7e9
2 changed files with 16 additions and 2 deletions

View File

@ -641,6 +641,20 @@ PatchBackedge(CodeLocationJump& jump_, CodeLocationLabel label, JitRuntime::Back
class Assembler;
typedef js::jit::AssemblerBuffer<1024, Instruction> MIPSBuffer;
class MIPSBufferWithExecutableCopy : public MIPSBuffer
{
public:
void executableCopy(uint8_t* buffer) {
if (this->oom())
return;
for (Slice* cur = head; cur != nullptr; cur = cur->getNext()) {
memcpy(buffer, &cur->instructions, cur->length());
buffer += cur->length();
}
}
};
class Assembler : public AssemblerShared
{
public:
@ -751,7 +765,7 @@ class Assembler : public AssemblerShared
CompactBufferWriter dataRelocations_;
CompactBufferWriter preBarriers_;
MIPSBuffer m_buffer;
MIPSBufferWithExecutableCopy m_buffer;
public:
Assembler()

View File

@ -99,10 +99,10 @@ class BufferSlice
template<int SliceSize, class Inst>
class AssemblerBuffer
{
protected:
typedef BufferSlice<SliceSize> Slice;
typedef AssemblerBuffer<SliceSize, Inst> AssemblerBuffer_;
protected:
// Doubly-linked list of BufferSlices, with the most recent in tail position.
Slice* head;
Slice* tail;