js/src/jit/x64/Lowering-x64.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit/x64/Lowering-x64.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,71 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     1.5 + * vim: set ts=8 sts=4 et sw=4 tw=99:
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef jit_x64_Lowering_x64_h
    1.11 +#define jit_x64_Lowering_x64_h
    1.12 +
    1.13 +#include "jit/shared/Lowering-x86-shared.h"
    1.14 +
    1.15 +namespace js {
    1.16 +namespace jit {
    1.17 +
    1.18 +class LIRGeneratorX64 : public LIRGeneratorX86Shared
    1.19 +{
    1.20 +  public:
    1.21 +    LIRGeneratorX64(MIRGenerator *gen, MIRGraph &graph, LIRGraph &lirGraph)
    1.22 +      : LIRGeneratorX86Shared(gen, graph, lirGraph)
    1.23 +    { }
    1.24 +
    1.25 +  protected:
    1.26 +    void lowerUntypedPhiInput(MPhi *phi, uint32_t inputPosition, LBlock *block, size_t lirIndex);
    1.27 +    bool defineUntypedPhi(MPhi *phi, size_t lirIndex);
    1.28 +
    1.29 +    // Adds a use at operand |n| of a value-typed insturction.
    1.30 +    bool useBox(LInstruction *lir, size_t n, MDefinition *mir,
    1.31 +                LUse::Policy policy = LUse::REGISTER, bool useAtStart = false);
    1.32 +    bool useBoxFixed(LInstruction *lir, size_t n, MDefinition *mir, Register reg1, Register);
    1.33 +
    1.34 +    // x86 has constraints on what registers can be formatted for 1-byte
    1.35 +    // stores and loads; on x64 all registers are okay.
    1.36 +    LAllocation useByteOpRegister(MDefinition *mir);
    1.37 +    LAllocation useByteOpRegisterOrNonDoubleConstant(MDefinition *mir);
    1.38 +
    1.39 +    LDefinition tempToUnbox();
    1.40 +
    1.41 +    bool needTempForPostBarrier() { return false; }
    1.42 +
    1.43 +    // x64 has a scratch register, so no need for another temp for dispatch
    1.44 +    // ICs.
    1.45 +    LDefinition tempForDispatchCache(MIRType outputType = MIRType_None) {
    1.46 +        return LDefinition::BogusTemp();
    1.47 +    }
    1.48 +
    1.49 +  public:
    1.50 +    bool visitBox(MBox *box);
    1.51 +    bool visitUnbox(MUnbox *unbox);
    1.52 +    bool visitReturn(MReturn *ret);
    1.53 +    bool visitAsmJSUnsignedToDouble(MAsmJSUnsignedToDouble *ins);
    1.54 +    bool visitAsmJSUnsignedToFloat32(MAsmJSUnsignedToFloat32 *ins);
    1.55 +    bool visitAsmJSLoadHeap(MAsmJSLoadHeap *ins);
    1.56 +    bool visitAsmJSStoreHeap(MAsmJSStoreHeap *ins);
    1.57 +    bool visitAsmJSLoadFuncPtr(MAsmJSLoadFuncPtr *ins);
    1.58 +    bool visitStoreTypedArrayElementStatic(MStoreTypedArrayElementStatic *ins);
    1.59 +
    1.60 +    static bool allowFloat32Optimizations() {
    1.61 +        return true;
    1.62 +    }
    1.63 +
    1.64 +    static bool allowInlineForkJoinGetSlice() {
    1.65 +        return true;
    1.66 +    }
    1.67 +};
    1.68 +
    1.69 +typedef LIRGeneratorX64 LIRGeneratorSpecific;
    1.70 +
    1.71 +} // namespace jit
    1.72 +} // namespace js
    1.73 +
    1.74 +#endif /* jit_x64_Lowering_x64_h */

mercurial