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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial