michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * vim: set ts=8 sts=4 et sw=4 tw=99: michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef jit_x64_Lowering_x64_h michael@0: #define jit_x64_Lowering_x64_h michael@0: michael@0: #include "jit/shared/Lowering-x86-shared.h" michael@0: michael@0: namespace js { michael@0: namespace jit { michael@0: michael@0: class LIRGeneratorX64 : public LIRGeneratorX86Shared michael@0: { michael@0: public: michael@0: LIRGeneratorX64(MIRGenerator *gen, MIRGraph &graph, LIRGraph &lirGraph) michael@0: : LIRGeneratorX86Shared(gen, graph, lirGraph) michael@0: { } michael@0: michael@0: protected: michael@0: void lowerUntypedPhiInput(MPhi *phi, uint32_t inputPosition, LBlock *block, size_t lirIndex); michael@0: bool defineUntypedPhi(MPhi *phi, size_t lirIndex); michael@0: michael@0: // Adds a use at operand |n| of a value-typed insturction. michael@0: bool useBox(LInstruction *lir, size_t n, MDefinition *mir, michael@0: LUse::Policy policy = LUse::REGISTER, bool useAtStart = false); michael@0: bool useBoxFixed(LInstruction *lir, size_t n, MDefinition *mir, Register reg1, Register); michael@0: michael@0: // x86 has constraints on what registers can be formatted for 1-byte michael@0: // stores and loads; on x64 all registers are okay. michael@0: LAllocation useByteOpRegister(MDefinition *mir); michael@0: LAllocation useByteOpRegisterOrNonDoubleConstant(MDefinition *mir); michael@0: michael@0: LDefinition tempToUnbox(); michael@0: michael@0: bool needTempForPostBarrier() { return false; } michael@0: michael@0: // x64 has a scratch register, so no need for another temp for dispatch michael@0: // ICs. michael@0: LDefinition tempForDispatchCache(MIRType outputType = MIRType_None) { michael@0: return LDefinition::BogusTemp(); michael@0: } michael@0: michael@0: public: michael@0: bool visitBox(MBox *box); michael@0: bool visitUnbox(MUnbox *unbox); michael@0: bool visitReturn(MReturn *ret); michael@0: bool visitAsmJSUnsignedToDouble(MAsmJSUnsignedToDouble *ins); michael@0: bool visitAsmJSUnsignedToFloat32(MAsmJSUnsignedToFloat32 *ins); michael@0: bool visitAsmJSLoadHeap(MAsmJSLoadHeap *ins); michael@0: bool visitAsmJSStoreHeap(MAsmJSStoreHeap *ins); michael@0: bool visitAsmJSLoadFuncPtr(MAsmJSLoadFuncPtr *ins); michael@0: bool visitStoreTypedArrayElementStatic(MStoreTypedArrayElementStatic *ins); michael@0: michael@0: static bool allowFloat32Optimizations() { michael@0: return true; michael@0: } michael@0: michael@0: static bool allowInlineForkJoinGetSlice() { michael@0: return true; michael@0: } michael@0: }; michael@0: michael@0: typedef LIRGeneratorX64 LIRGeneratorSpecific; michael@0: michael@0: } // namespace jit michael@0: } // namespace js michael@0: michael@0: #endif /* jit_x64_Lowering_x64_h */