return code->raw() + pe_;
}
-Assembler&
-AssemblerMIPSShared::asAsm()
-{
- return *static_cast<Assembler*>(this);
-}
-
void
AssemblerMIPSShared::copyJumpRelocationTable(uint8_t* dest)
{
{
for (size_t i = 0; i < codeLabels_.length(); i++) {
CodeLabel label = codeLabels_[i];
- asAsm().Bind(rawCode, label.dest(), rawCode + label.src()->offset());
+ Bind(rawCode, label.dest(), rawCode + label.src()->offset());
}
}
// Second word holds a pointer to the next branch in label's chain.
next = inst[1].encode();
- asAsm().bind(reinterpret_cast<InstImm*>(inst), b.getOffset(), dest.getOffset());
+ bind(reinterpret_cast<InstImm*>(inst), b.getOffset(), dest.getOffset());
b = BufferOffset(next);
} while (next != LabelBase::INVALID_OFFSET);
}
};
-class Assembler;
-
class AssemblerMIPSShared : public AssemblerShared
{
public:
uint32_t actualIndex(uint32_t) const;
static uint8_t* PatchableJumpAddress(JitCode* code, uint32_t index);
protected:
- Assembler& asAsm();
-
// structure for fixing up pc-relative loads/jumps when a the machine code
// gets moved (executable copy, gc, etc.)
struct RelativePatch
// label operations
void bind(Label* label, BufferOffset boff = BufferOffset());
+ virtual void bind(InstImm* inst, uint32_t branch, uint32_t target) = 0;
+ virtual void Bind(uint8_t* rawCode, AbsoluteLabel* label, const void* address) = 0;
uint32_t currentOffset() {
return nextOffset().getOffset();
}