Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
michael@0 | 2 | * vim: set ts=8 sts=4 et sw=4 tw=99: |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef jit_arm_MoveEmitter_arm_h |
michael@0 | 8 | #define jit_arm_MoveEmitter_arm_h |
michael@0 | 9 | |
michael@0 | 10 | #include "jit/IonMacroAssembler.h" |
michael@0 | 11 | #include "jit/MoveResolver.h" |
michael@0 | 12 | |
michael@0 | 13 | namespace js { |
michael@0 | 14 | namespace jit { |
michael@0 | 15 | |
michael@0 | 16 | class CodeGenerator; |
michael@0 | 17 | |
michael@0 | 18 | class MoveEmitterARM |
michael@0 | 19 | { |
michael@0 | 20 | bool inCycle_; |
michael@0 | 21 | MacroAssemblerARMCompat &masm; |
michael@0 | 22 | |
michael@0 | 23 | // Original stack push value. |
michael@0 | 24 | uint32_t pushedAtStart_; |
michael@0 | 25 | |
michael@0 | 26 | // These store stack offsets to spill locations, snapshotting |
michael@0 | 27 | // codegen->framePushed_ at the time they were allocated. They are -1 if no |
michael@0 | 28 | // stack space has been allocated for that particular spill. |
michael@0 | 29 | int32_t pushedAtCycle_; |
michael@0 | 30 | int32_t pushedAtSpill_; |
michael@0 | 31 | |
michael@0 | 32 | // These are registers that are available for temporary use. They may be |
michael@0 | 33 | // assigned InvalidReg. If no corresponding spill space has been assigned, |
michael@0 | 34 | // then these registers do not need to be spilled. |
michael@0 | 35 | Register spilledReg_; |
michael@0 | 36 | FloatRegister spilledFloatReg_; |
michael@0 | 37 | |
michael@0 | 38 | void assertDone(); |
michael@0 | 39 | Register tempReg(); |
michael@0 | 40 | FloatRegister tempFloatReg(); |
michael@0 | 41 | Operand cycleSlot() const; |
michael@0 | 42 | Operand spillSlot() const; |
michael@0 | 43 | Operand toOperand(const MoveOperand &operand, bool isFloat) const; |
michael@0 | 44 | |
michael@0 | 45 | void emitMove(const MoveOperand &from, const MoveOperand &to); |
michael@0 | 46 | void emitFloat32Move(const MoveOperand &from, const MoveOperand &to); |
michael@0 | 47 | void emitDoubleMove(const MoveOperand &from, const MoveOperand &to); |
michael@0 | 48 | void breakCycle(const MoveOperand &from, const MoveOperand &to, MoveOp::Type type); |
michael@0 | 49 | void completeCycle(const MoveOperand &from, const MoveOperand &to, MoveOp::Type type); |
michael@0 | 50 | void emit(const MoveOp &move); |
michael@0 | 51 | |
michael@0 | 52 | public: |
michael@0 | 53 | MoveEmitterARM(MacroAssemblerARMCompat &masm); |
michael@0 | 54 | ~MoveEmitterARM(); |
michael@0 | 55 | void emit(const MoveResolver &moves); |
michael@0 | 56 | void finish(); |
michael@0 | 57 | }; |
michael@0 | 58 | |
michael@0 | 59 | typedef MoveEmitterARM MoveEmitter; |
michael@0 | 60 | |
michael@0 | 61 | } // namespace jit |
michael@0 | 62 | } // namespace js |
michael@0 | 63 | |
michael@0 | 64 | #endif /* jit_arm_MoveEmitter_arm_h */ |