js/src/jit/x86/Lowering-x86.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_x86_Lowering_x86_h
     8 #define jit_x86_Lowering_x86_h
    10 #include "jit/shared/Lowering-x86-shared.h"
    12 namespace js {
    13 namespace jit {
    15 class LIRGeneratorX86 : public LIRGeneratorX86Shared
    16 {
    17   public:
    18     LIRGeneratorX86(MIRGenerator *gen, MIRGraph &graph, LIRGraph &lirGraph)
    19       : LIRGeneratorX86Shared(gen, graph, lirGraph)
    20     { }
    22   protected:
    23     // Adds a box input to an instruction, setting operand |n| to the type and
    24     // |n+1| to the payload.
    25     bool useBox(LInstruction *lir, size_t n, MDefinition *mir,
    26                 LUse::Policy policy = LUse::REGISTER, bool useAtStart = false);
    27     bool useBoxFixed(LInstruction *lir, size_t n, MDefinition *mir, Register reg1, Register reg2);
    29     // It's a trap! On x86, the 1-byte store can only use one of
    30     // {al,bl,cl,dl,ah,bh,ch,dh}. That means if the register allocator
    31     // gives us one of {edi,esi,ebp,esp}, we're out of luck. (The formatter
    32     // will assert on us.) Ideally, we'd just ask the register allocator to
    33     // give us one of {al,bl,cl,dl}. For now, just useFixed(al).
    34     LAllocation useByteOpRegister(MDefinition *mir);
    35     LAllocation useByteOpRegisterOrNonDoubleConstant(MDefinition *mir);
    37     inline LDefinition tempToUnbox() {
    38         return LDefinition::BogusTemp();
    39     }
    41     bool needTempForPostBarrier() { return true; }
    43     LDefinition tempForDispatchCache(MIRType outputType = MIRType_None);
    45     void lowerUntypedPhiInput(MPhi *phi, uint32_t inputPosition, LBlock *block, size_t lirIndex);
    46     bool defineUntypedPhi(MPhi *phi, size_t lirIndex);
    48   public:
    49     bool visitBox(MBox *box);
    50     bool visitUnbox(MUnbox *unbox);
    51     bool visitReturn(MReturn *ret);
    52     bool visitAsmJSUnsignedToDouble(MAsmJSUnsignedToDouble *ins);
    53     bool visitAsmJSUnsignedToFloat32(MAsmJSUnsignedToFloat32 *ins);
    54     bool visitAsmJSLoadHeap(MAsmJSLoadHeap *ins);
    55     bool visitAsmJSStoreHeap(MAsmJSStoreHeap *ins);
    56     bool visitAsmJSLoadFuncPtr(MAsmJSLoadFuncPtr *ins);
    57     bool visitStoreTypedArrayElementStatic(MStoreTypedArrayElementStatic *ins);
    58     bool lowerPhi(MPhi *phi);
    60     static bool allowTypedElementHoleCheck() {
    61         return true;
    62     }
    64     static bool allowStaticTypedArrayAccesses() {
    65         return true;
    66     }
    68     static bool allowFloat32Optimizations() {
    69         return true;
    70     }
    72     static bool allowInlineForkJoinGetSlice() {
    73         return true;
    74     }
    75 };
    77 typedef LIRGeneratorX86 LIRGeneratorSpecific;
    79 } // namespace js
    80 } // namespace jit
    82 #endif /* jit_x86_Lowering_x86_h */

mercurial