Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
michael@0 | 2 | * vim: set ts=8 sts=4 et sw=4 tw=99: |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef jit_x86_LIR_x86_h |
michael@0 | 8 | #define jit_x86_LIR_x86_h |
michael@0 | 9 | |
michael@0 | 10 | namespace js { |
michael@0 | 11 | namespace jit { |
michael@0 | 12 | |
michael@0 | 13 | class LBox : public LInstructionHelper<2, 1, 0> |
michael@0 | 14 | { |
michael@0 | 15 | MIRType type_; |
michael@0 | 16 | |
michael@0 | 17 | public: |
michael@0 | 18 | LIR_HEADER(Box); |
michael@0 | 19 | |
michael@0 | 20 | LBox(const LAllocation &in_payload, MIRType type) |
michael@0 | 21 | : type_(type) |
michael@0 | 22 | { |
michael@0 | 23 | setOperand(0, in_payload); |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | MIRType type() const { |
michael@0 | 27 | return type_; |
michael@0 | 28 | } |
michael@0 | 29 | const char *extraName() const { |
michael@0 | 30 | return StringFromMIRType(type_); |
michael@0 | 31 | } |
michael@0 | 32 | }; |
michael@0 | 33 | |
michael@0 | 34 | class LBoxFloatingPoint : public LInstructionHelper<2, 1, 1> |
michael@0 | 35 | { |
michael@0 | 36 | MIRType type_; |
michael@0 | 37 | |
michael@0 | 38 | public: |
michael@0 | 39 | LIR_HEADER(BoxFloatingPoint); |
michael@0 | 40 | |
michael@0 | 41 | LBoxFloatingPoint(const LAllocation &in, const LDefinition &temp, MIRType type) |
michael@0 | 42 | : type_(type) |
michael@0 | 43 | { |
michael@0 | 44 | JS_ASSERT(IsFloatingPointType(type)); |
michael@0 | 45 | setOperand(0, in); |
michael@0 | 46 | setTemp(0, temp); |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | MIRType type() const { |
michael@0 | 50 | return type_; |
michael@0 | 51 | } |
michael@0 | 52 | const char *extraName() const { |
michael@0 | 53 | return StringFromMIRType(type_); |
michael@0 | 54 | } |
michael@0 | 55 | }; |
michael@0 | 56 | |
michael@0 | 57 | class LUnbox : public LInstructionHelper<1, 2, 0> |
michael@0 | 58 | { |
michael@0 | 59 | public: |
michael@0 | 60 | LIR_HEADER(Unbox); |
michael@0 | 61 | |
michael@0 | 62 | MUnbox *mir() const { |
michael@0 | 63 | return mir_->toUnbox(); |
michael@0 | 64 | } |
michael@0 | 65 | const LAllocation *payload() { |
michael@0 | 66 | return getOperand(0); |
michael@0 | 67 | } |
michael@0 | 68 | const LAllocation *type() { |
michael@0 | 69 | return getOperand(1); |
michael@0 | 70 | } |
michael@0 | 71 | const char *extraName() const { |
michael@0 | 72 | return StringFromMIRType(mir()->type()); |
michael@0 | 73 | } |
michael@0 | 74 | }; |
michael@0 | 75 | |
michael@0 | 76 | class LUnboxFloatingPoint : public LInstructionHelper<1, 2, 0> |
michael@0 | 77 | { |
michael@0 | 78 | MIRType type_; |
michael@0 | 79 | |
michael@0 | 80 | public: |
michael@0 | 81 | LIR_HEADER(UnboxFloatingPoint); |
michael@0 | 82 | |
michael@0 | 83 | static const size_t Input = 0; |
michael@0 | 84 | |
michael@0 | 85 | LUnboxFloatingPoint(MIRType type) |
michael@0 | 86 | : type_(type) |
michael@0 | 87 | { } |
michael@0 | 88 | |
michael@0 | 89 | MUnbox *mir() const { |
michael@0 | 90 | return mir_->toUnbox(); |
michael@0 | 91 | } |
michael@0 | 92 | |
michael@0 | 93 | MIRType type() const { |
michael@0 | 94 | return type_; |
michael@0 | 95 | } |
michael@0 | 96 | const char *extraName() const { |
michael@0 | 97 | return StringFromMIRType(type_); |
michael@0 | 98 | } |
michael@0 | 99 | }; |
michael@0 | 100 | |
michael@0 | 101 | // Convert a 32-bit unsigned integer to a double. |
michael@0 | 102 | class LAsmJSUInt32ToDouble : public LInstructionHelper<1, 1, 1> |
michael@0 | 103 | { |
michael@0 | 104 | public: |
michael@0 | 105 | LIR_HEADER(AsmJSUInt32ToDouble) |
michael@0 | 106 | |
michael@0 | 107 | LAsmJSUInt32ToDouble(const LAllocation &input, const LDefinition &temp) { |
michael@0 | 108 | setOperand(0, input); |
michael@0 | 109 | setTemp(0, temp); |
michael@0 | 110 | } |
michael@0 | 111 | const LDefinition *temp() { |
michael@0 | 112 | return getTemp(0); |
michael@0 | 113 | } |
michael@0 | 114 | }; |
michael@0 | 115 | |
michael@0 | 116 | // Convert a 32-bit unsigned integer to a float32. |
michael@0 | 117 | class LAsmJSUInt32ToFloat32: public LInstructionHelper<1, 1, 1> |
michael@0 | 118 | { |
michael@0 | 119 | public: |
michael@0 | 120 | LIR_HEADER(AsmJSUInt32ToFloat32) |
michael@0 | 121 | |
michael@0 | 122 | LAsmJSUInt32ToFloat32(const LAllocation &input, const LDefinition &temp) { |
michael@0 | 123 | setOperand(0, input); |
michael@0 | 124 | setTemp(0, temp); |
michael@0 | 125 | } |
michael@0 | 126 | const LDefinition *temp() { |
michael@0 | 127 | return getTemp(0); |
michael@0 | 128 | } |
michael@0 | 129 | }; |
michael@0 | 130 | |
michael@0 | 131 | class LAsmJSLoadFuncPtr : public LInstructionHelper<1, 1, 0> |
michael@0 | 132 | { |
michael@0 | 133 | public: |
michael@0 | 134 | LIR_HEADER(AsmJSLoadFuncPtr); |
michael@0 | 135 | LAsmJSLoadFuncPtr(const LAllocation &index) { |
michael@0 | 136 | setOperand(0, index); |
michael@0 | 137 | } |
michael@0 | 138 | MAsmJSLoadFuncPtr *mir() const { |
michael@0 | 139 | return mir_->toAsmJSLoadFuncPtr(); |
michael@0 | 140 | } |
michael@0 | 141 | const LAllocation *index() { |
michael@0 | 142 | return getOperand(0); |
michael@0 | 143 | } |
michael@0 | 144 | }; |
michael@0 | 145 | |
michael@0 | 146 | } // namespace jit |
michael@0 | 147 | } // namespace js |
michael@0 | 148 | |
michael@0 | 149 | #endif /* jit_x86_LIR_x86_h */ |