js/src/jit/x64/LIR-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_LIR_x64_h
     8 #define jit_x64_LIR_x64_h
    10 namespace js {
    11 namespace jit {
    13 // Given a typed input, returns an untyped box.
    14 class LBox : public LInstructionHelper<1, 1, 0>
    15 {
    16     MIRType type_;
    18   public:
    19     LIR_HEADER(Box)
    21     LBox(MIRType type, const LAllocation &payload)
    22       : type_(type)
    23     {
    24         setOperand(0, payload);
    25     }
    27     MIRType type() const {
    28         return type_;
    29     }
    30     const char *extraName() const {
    31         return StringFromMIRType(type_);
    32     }
    33 };
    35 // Given an untyped input, guards on whether it's a specific type and returns
    36 // the unboxed payload.
    37 class LUnboxBase : public LInstructionHelper<1, 1, 0>
    38 {
    39   public:
    40     LUnboxBase(const LAllocation &input) {
    41         setOperand(0, input);
    42     }
    44     static const size_t Input = 0;
    46     MUnbox *mir() const {
    47         return mir_->toUnbox();
    48     }
    49 };
    51 class LUnbox : public LUnboxBase {
    52   public:
    53     LIR_HEADER(Unbox)
    55     LUnbox(const LAllocation &input)
    56       : LUnboxBase(input)
    57     { }
    59     const char *extraName() const {
    60         return StringFromMIRType(mir()->type());
    61     }
    62 };
    64 class LUnboxFloatingPoint : public LUnboxBase {
    65     MIRType type_;
    67   public:
    68     LIR_HEADER(UnboxFloatingPoint)
    70     LUnboxFloatingPoint(const LAllocation &input, MIRType type)
    71       : LUnboxBase(input),
    72         type_(type)
    73     { }
    75     MIRType type() const {
    76         return type_;
    77     }
    78     const char *extraName() const {
    79         return StringFromMIRType(type_);
    80     }
    81 };
    83 // Convert a 32-bit unsigned integer to a double.
    84 class LAsmJSUInt32ToDouble : public LInstructionHelper<1, 1, 0>
    85 {
    86   public:
    87     LIR_HEADER(AsmJSUInt32ToDouble)
    89     LAsmJSUInt32ToDouble(const LAllocation &input) {
    90         setOperand(0, input);
    91     }
    92 };
    94 // Convert a 32-bit unsigned integer to a float32.
    95 class LAsmJSUInt32ToFloat32 : public LInstructionHelper<1, 1, 0>
    96 {
    97   public:
    98     LIR_HEADER(AsmJSUInt32ToFloat32)
   100     LAsmJSUInt32ToFloat32(const LAllocation &input) {
   101         setOperand(0, input);
   102     }
   103 };
   105 class LAsmJSLoadFuncPtr : public LInstructionHelper<1, 1, 1>
   106 {
   107   public:
   108     LIR_HEADER(AsmJSLoadFuncPtr);
   109     LAsmJSLoadFuncPtr(const LAllocation &index, const LDefinition &temp) {
   110         setOperand(0, index);
   111         setTemp(0, temp);
   112     }
   113     MAsmJSLoadFuncPtr *mir() const {
   114         return mir_->toAsmJSLoadFuncPtr();
   115     }
   116     const LAllocation *index() {
   117         return getOperand(0);
   118     }
   119     const LDefinition *temp() {
   120         return getTemp(0);
   121     }
   122 };
   124 } // namespace jit
   125 } // namespace js
   127 #endif /* jit_x64_LIR_x64_h */

mercurial