js/src/jit/x86/LIR-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_LIR_x86_h
     8 #define jit_x86_LIR_x86_h
    10 namespace js {
    11 namespace jit {
    13 class LBox : public LInstructionHelper<2, 1, 0>
    14 {
    15     MIRType type_;
    17   public:
    18     LIR_HEADER(Box);
    20     LBox(const LAllocation &in_payload, MIRType type)
    21       : type_(type)
    22     {
    23         setOperand(0, in_payload);
    24     }
    26     MIRType type() const {
    27         return type_;
    28     }
    29     const char *extraName() const {
    30         return StringFromMIRType(type_);
    31     }
    32 };
    34 class LBoxFloatingPoint : public LInstructionHelper<2, 1, 1>
    35 {
    36     MIRType type_;
    38   public:
    39     LIR_HEADER(BoxFloatingPoint);
    41     LBoxFloatingPoint(const LAllocation &in, const LDefinition &temp, MIRType type)
    42       : type_(type)
    43     {
    44         JS_ASSERT(IsFloatingPointType(type));
    45         setOperand(0, in);
    46         setTemp(0, temp);
    47     }
    49     MIRType type() const {
    50         return type_;
    51     }
    52     const char *extraName() const {
    53         return StringFromMIRType(type_);
    54     }
    55 };
    57 class LUnbox : public LInstructionHelper<1, 2, 0>
    58 {
    59   public:
    60     LIR_HEADER(Unbox);
    62     MUnbox *mir() const {
    63         return mir_->toUnbox();
    64     }
    65     const LAllocation *payload() {
    66         return getOperand(0);
    67     }
    68     const LAllocation *type() {
    69         return getOperand(1);
    70     }
    71     const char *extraName() const {
    72         return StringFromMIRType(mir()->type());
    73     }
    74 };
    76 class LUnboxFloatingPoint : public LInstructionHelper<1, 2, 0>
    77 {
    78     MIRType type_;
    80   public:
    81     LIR_HEADER(UnboxFloatingPoint);
    83     static const size_t Input = 0;
    85     LUnboxFloatingPoint(MIRType type)
    86       : type_(type)
    87     { }
    89     MUnbox *mir() const {
    90         return mir_->toUnbox();
    91     }
    93     MIRType type() const {
    94         return type_;
    95     }
    96     const char *extraName() const {
    97         return StringFromMIRType(type_);
    98     }
    99 };
   101 // Convert a 32-bit unsigned integer to a double.
   102 class LAsmJSUInt32ToDouble : public LInstructionHelper<1, 1, 1>
   103 {
   104   public:
   105     LIR_HEADER(AsmJSUInt32ToDouble)
   107     LAsmJSUInt32ToDouble(const LAllocation &input, const LDefinition &temp) {
   108         setOperand(0, input);
   109         setTemp(0, temp);
   110     }
   111     const LDefinition *temp() {
   112         return getTemp(0);
   113     }
   114 };
   116 // Convert a 32-bit unsigned integer to a float32.
   117 class LAsmJSUInt32ToFloat32: public LInstructionHelper<1, 1, 1>
   118 {
   119   public:
   120     LIR_HEADER(AsmJSUInt32ToFloat32)
   122     LAsmJSUInt32ToFloat32(const LAllocation &input, const LDefinition &temp) {
   123         setOperand(0, input);
   124         setTemp(0, temp);
   125     }
   126     const LDefinition *temp() {
   127         return getTemp(0);
   128     }
   129 };
   131 class LAsmJSLoadFuncPtr : public LInstructionHelper<1, 1, 0>
   132 {
   133   public:
   134     LIR_HEADER(AsmJSLoadFuncPtr);
   135     LAsmJSLoadFuncPtr(const LAllocation &index) {
   136         setOperand(0, index);
   137     }
   138     MAsmJSLoadFuncPtr *mir() const {
   139         return mir_->toAsmJSLoadFuncPtr();
   140     }
   141     const LAllocation *index() {
   142         return getOperand(0);
   143     }
   144 };
   146 } // namespace jit
   147 } // namespace js
   149 #endif /* jit_x86_LIR_x86_h */

mercurial