#ifndef jit_mips_shared_MoveEmitter_mips_shared_h
#define jit_mips_shared_MoveEmitter_mips_shared_h
#include "jit/MacroAssembler.h"
#include "jit/MoveResolver.h"
namespace js {
namespace jit {
class MoveEmitterMIPSShared {
protected:
uint32_t inCycle_;
MacroAssembler& masm;
uint32_t pushedAtStart_;
int32_t pushedAtCycle_;
int32_t pushedAtSpill_;
Register spilledReg_;
FloatRegister spilledFloatReg_;
void assertDone();
Register tempReg();
FloatRegister tempFloatReg();
Address cycleSlot(uint32_t slot, uint32_t subslot = 0) const;
int32_t getAdjustedOffset(const MoveOperand& operand);
Address getAdjustedAddress(const MoveOperand& operand);
void emitMove(const MoveOperand& from, const MoveOperand& to);
void emitInt32Move(const MoveOperand& from, const MoveOperand& to);
void emitFloat32Move(const MoveOperand& from, const MoveOperand& to);
virtual void emitDoubleMove(const MoveOperand& from,
const MoveOperand& to) = 0;
virtual void breakCycle(const MoveOperand& from, const MoveOperand& to,
MoveOp::Type type, uint32_t slot) = 0;
virtual void completeCycle(const MoveOperand& from, const MoveOperand& to,
MoveOp::Type type, uint32_t slot) = 0;
void emit(const MoveOp& move);
public:
MoveEmitterMIPSShared(MacroAssembler& masm)
: inCycle_(0),
masm(masm),
pushedAtStart_(masm.framePushed()),
pushedAtCycle_(-1),
pushedAtSpill_(-1),
spilledReg_(InvalidReg),
spilledFloatReg_(InvalidFloatReg) {}
~MoveEmitterMIPSShared() { assertDone(); }
void emit(const MoveResolver& moves);
void finish();
void setScratchRegister(Register reg) {}
};
} }
#endif