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_x64_Lowering_x64_h |
michael@0 | 8 | #define jit_x64_Lowering_x64_h |
michael@0 | 9 | |
michael@0 | 10 | #include "jit/shared/Lowering-x86-shared.h" |
michael@0 | 11 | |
michael@0 | 12 | namespace js { |
michael@0 | 13 | namespace jit { |
michael@0 | 14 | |
michael@0 | 15 | class LIRGeneratorX64 : public LIRGeneratorX86Shared |
michael@0 | 16 | { |
michael@0 | 17 | public: |
michael@0 | 18 | LIRGeneratorX64(MIRGenerator *gen, MIRGraph &graph, LIRGraph &lirGraph) |
michael@0 | 19 | : LIRGeneratorX86Shared(gen, graph, lirGraph) |
michael@0 | 20 | { } |
michael@0 | 21 | |
michael@0 | 22 | protected: |
michael@0 | 23 | void lowerUntypedPhiInput(MPhi *phi, uint32_t inputPosition, LBlock *block, size_t lirIndex); |
michael@0 | 24 | bool defineUntypedPhi(MPhi *phi, size_t lirIndex); |
michael@0 | 25 | |
michael@0 | 26 | // Adds a use at operand |n| of a value-typed insturction. |
michael@0 | 27 | bool useBox(LInstruction *lir, size_t n, MDefinition *mir, |
michael@0 | 28 | LUse::Policy policy = LUse::REGISTER, bool useAtStart = false); |
michael@0 | 29 | bool useBoxFixed(LInstruction *lir, size_t n, MDefinition *mir, Register reg1, Register); |
michael@0 | 30 | |
michael@0 | 31 | // x86 has constraints on what registers can be formatted for 1-byte |
michael@0 | 32 | // stores and loads; on x64 all registers are okay. |
michael@0 | 33 | LAllocation useByteOpRegister(MDefinition *mir); |
michael@0 | 34 | LAllocation useByteOpRegisterOrNonDoubleConstant(MDefinition *mir); |
michael@0 | 35 | |
michael@0 | 36 | LDefinition tempToUnbox(); |
michael@0 | 37 | |
michael@0 | 38 | bool needTempForPostBarrier() { return false; } |
michael@0 | 39 | |
michael@0 | 40 | // x64 has a scratch register, so no need for another temp for dispatch |
michael@0 | 41 | // ICs. |
michael@0 | 42 | LDefinition tempForDispatchCache(MIRType outputType = MIRType_None) { |
michael@0 | 43 | return LDefinition::BogusTemp(); |
michael@0 | 44 | } |
michael@0 | 45 | |
michael@0 | 46 | public: |
michael@0 | 47 | bool visitBox(MBox *box); |
michael@0 | 48 | bool visitUnbox(MUnbox *unbox); |
michael@0 | 49 | bool visitReturn(MReturn *ret); |
michael@0 | 50 | bool visitAsmJSUnsignedToDouble(MAsmJSUnsignedToDouble *ins); |
michael@0 | 51 | bool visitAsmJSUnsignedToFloat32(MAsmJSUnsignedToFloat32 *ins); |
michael@0 | 52 | bool visitAsmJSLoadHeap(MAsmJSLoadHeap *ins); |
michael@0 | 53 | bool visitAsmJSStoreHeap(MAsmJSStoreHeap *ins); |
michael@0 | 54 | bool visitAsmJSLoadFuncPtr(MAsmJSLoadFuncPtr *ins); |
michael@0 | 55 | bool visitStoreTypedArrayElementStatic(MStoreTypedArrayElementStatic *ins); |
michael@0 | 56 | |
michael@0 | 57 | static bool allowFloat32Optimizations() { |
michael@0 | 58 | return true; |
michael@0 | 59 | } |
michael@0 | 60 | |
michael@0 | 61 | static bool allowInlineForkJoinGetSlice() { |
michael@0 | 62 | return true; |
michael@0 | 63 | } |
michael@0 | 64 | }; |
michael@0 | 65 | |
michael@0 | 66 | typedef LIRGeneratorX64 LIRGeneratorSpecific; |
michael@0 | 67 | |
michael@0 | 68 | } // namespace jit |
michael@0 | 69 | } // namespace js |
michael@0 | 70 | |
michael@0 | 71 | #endif /* jit_x64_Lowering_x64_h */ |