MoveEmitter-arm.h (2197B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * vim: set ts=8 sts=2 et sw=2 tw=80: 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef jit_arm_MoveEmitter_arm_h 8 #define jit_arm_MoveEmitter_arm_h 9 10 #include <stdint.h> 11 12 #include "jit/MoveResolver.h" 13 #include "jit/Registers.h" 14 15 namespace js { 16 namespace jit { 17 18 struct Address; 19 class MacroAssembler; 20 21 class MoveEmitterARM { 22 uint32_t inCycle_; 23 MacroAssembler& masm; 24 25 // Original stack push value. 26 uint32_t pushedAtStart_; 27 28 // These store stack offsets to spill locations, snapshotting 29 // codegen->framePushed_ at the time they were allocated. They are -1 if no 30 // stack space has been allocated for that particular spill. 31 int32_t pushedAtCycle_; 32 int32_t pushedAtSpill_; 33 34 // These are registers that are available for temporary use. They may be 35 // assigned InvalidReg. If no corresponding spill space has been assigned, 36 // then these registers do not need to be spilled. 37 Register spilledReg_; 38 FloatRegister spilledFloatReg_; 39 40 void assertDone(); 41 Register tempReg(); 42 FloatRegister tempFloatReg(); 43 Address cycleSlot(uint32_t slot, uint32_t subslot) const; 44 Address spillSlot() const; 45 Address toAddress(const MoveOperand& operand) const; 46 47 void emitMove(const MoveOperand& from, const MoveOperand& to); 48 void emitFloat32Move(const MoveOperand& from, const MoveOperand& to); 49 void emitDoubleMove(const MoveOperand& from, const MoveOperand& to); 50 void breakCycle(const MoveOperand& from, const MoveOperand& to, 51 MoveOp::Type type, uint32_t slot); 52 void completeCycle(const MoveOperand& from, const MoveOperand& to, 53 MoveOp::Type type, uint32_t slot); 54 void emit(const MoveOp& move); 55 56 public: 57 explicit MoveEmitterARM(MacroAssembler& masm); 58 ~MoveEmitterARM(); 59 void emit(const MoveResolver& moves); 60 void finish(); 61 62 void setScratchRegister(Register reg) {} 63 }; 64 65 using MoveEmitter = MoveEmitterARM; 66 67 } // namespace jit 68 } // namespace js 69 70 #endif /* jit_arm_MoveEmitter_arm_h */