erik.corry@gmail.com | f2038fb | 2012-01-16 11:42:08 +0000 | [diff] [blame] | 1 | // Copyright 2012 the V8 project authors. All rights reserved. |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 2 | // Redistribution and use in source and binary forms, with or without |
| 3 | // modification, are permitted provided that the following conditions are |
| 4 | // met: |
| 5 | // |
| 6 | // * Redistributions of source code must retain the above copyright |
| 7 | // notice, this list of conditions and the following disclaimer. |
| 8 | // * Redistributions in binary form must reproduce the above |
| 9 | // copyright notice, this list of conditions and the following |
| 10 | // disclaimer in the documentation and/or other materials provided |
| 11 | // with the distribution. |
| 12 | // * Neither the name of Google Inc. nor the names of its |
| 13 | // contributors may be used to endorse or promote products derived |
| 14 | // from this software without specific prior written permission. |
| 15 | // |
| 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 20 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 21 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | |
| 28 | #ifndef V8_MIPS_LITHIUM_MIPS_H_ |
| 29 | #define V8_MIPS_LITHIUM_MIPS_H_ |
| 30 | |
| 31 | #include "hydrogen.h" |
| 32 | #include "lithium-allocator.h" |
| 33 | #include "lithium.h" |
| 34 | #include "safepoint-table.h" |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 35 | #include "utils.h" |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 36 | |
| 37 | namespace v8 { |
| 38 | namespace internal { |
| 39 | |
| 40 | // Forward declarations. |
| 41 | class LCodeGen; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 42 | |
| 43 | #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ |
| 44 | V(ControlInstruction) \ |
| 45 | V(Call) \ |
| 46 | LITHIUM_CONCRETE_INSTRUCTION_LIST(V) |
| 47 | |
| 48 | |
| 49 | #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ |
| 50 | V(AccessArgumentsAt) \ |
| 51 | V(AddI) \ |
ulan@chromium.org | 967e270 | 2012-02-28 09:49:15 +0000 | [diff] [blame] | 52 | V(AllocateObject) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 53 | V(ApplyArguments) \ |
| 54 | V(ArgumentsElements) \ |
| 55 | V(ArgumentsLength) \ |
| 56 | V(ArithmeticD) \ |
| 57 | V(ArithmeticT) \ |
| 58 | V(ArrayLiteral) \ |
| 59 | V(BitI) \ |
| 60 | V(BitNotI) \ |
| 61 | V(BoundsCheck) \ |
| 62 | V(Branch) \ |
| 63 | V(CallConstantFunction) \ |
| 64 | V(CallFunction) \ |
| 65 | V(CallGlobal) \ |
| 66 | V(CallKeyed) \ |
| 67 | V(CallKnownGlobal) \ |
| 68 | V(CallNamed) \ |
| 69 | V(CallNew) \ |
| 70 | V(CallRuntime) \ |
| 71 | V(CallStub) \ |
| 72 | V(CheckFunction) \ |
| 73 | V(CheckInstanceType) \ |
jkummerow@chromium.org | 1456e70 | 2012-03-30 08:38:13 +0000 | [diff] [blame] | 74 | V(CheckMaps) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 75 | V(CheckNonSmi) \ |
| 76 | V(CheckPrototypeMaps) \ |
| 77 | V(CheckSmi) \ |
| 78 | V(ClampDToUint8) \ |
| 79 | V(ClampIToUint8) \ |
| 80 | V(ClampTToUint8) \ |
| 81 | V(ClassOfTestAndBranch) \ |
| 82 | V(CmpConstantEqAndBranch) \ |
| 83 | V(CmpIDAndBranch) \ |
| 84 | V(CmpObjectEqAndBranch) \ |
| 85 | V(CmpMapAndBranch) \ |
| 86 | V(CmpT) \ |
| 87 | V(ConstantD) \ |
| 88 | V(ConstantI) \ |
| 89 | V(ConstantT) \ |
| 90 | V(Context) \ |
jkummerow@chromium.org | f7a5884 | 2012-02-21 10:08:21 +0000 | [diff] [blame] | 91 | V(DeclareGlobals) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 92 | V(DeleteProperty) \ |
| 93 | V(Deoptimize) \ |
| 94 | V(DivI) \ |
| 95 | V(DoubleToI) \ |
| 96 | V(ElementsKind) \ |
jkummerow@chromium.org | f7a5884 | 2012-02-21 10:08:21 +0000 | [diff] [blame] | 97 | V(FastLiteral) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 98 | V(FixedArrayBaseLength) \ |
| 99 | V(FunctionLiteral) \ |
| 100 | V(GetCachedArrayIndex) \ |
| 101 | V(GlobalObject) \ |
| 102 | V(GlobalReceiver) \ |
| 103 | V(Goto) \ |
| 104 | V(HasCachedArrayIndexAndBranch) \ |
| 105 | V(HasInstanceTypeAndBranch) \ |
| 106 | V(In) \ |
| 107 | V(InstanceOf) \ |
| 108 | V(InstanceOfKnownGlobal) \ |
| 109 | V(InstructionGap) \ |
| 110 | V(Integer32ToDouble) \ |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 111 | V(Uint32ToDouble) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 112 | V(InvokeFunction) \ |
| 113 | V(IsConstructCallAndBranch) \ |
| 114 | V(IsNilAndBranch) \ |
| 115 | V(IsObjectAndBranch) \ |
mstarzinger@chromium.org | f8c6bd5 | 2011-11-23 12:13:52 +0000 | [diff] [blame] | 116 | V(IsStringAndBranch) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 117 | V(IsSmiAndBranch) \ |
| 118 | V(IsUndetectableAndBranch) \ |
| 119 | V(JSArrayLength) \ |
| 120 | V(Label) \ |
| 121 | V(LazyBailout) \ |
| 122 | V(LoadContextSlot) \ |
| 123 | V(LoadElements) \ |
| 124 | V(LoadExternalArrayPointer) \ |
| 125 | V(LoadFunctionPrototype) \ |
| 126 | V(LoadGlobalCell) \ |
| 127 | V(LoadGlobalGeneric) \ |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 128 | V(LoadKeyed) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 129 | V(LoadKeyedGeneric) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 130 | V(LoadNamedField) \ |
| 131 | V(LoadNamedFieldPolymorphic) \ |
| 132 | V(LoadNamedGeneric) \ |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 133 | V(MapEnumLength) \ |
svenpanne@chromium.org | 83130cf | 2012-11-30 10:13:25 +0000 | [diff] [blame^] | 134 | V(MathExp) \ |
mstarzinger@chromium.org | 471f2f1 | 2012-08-10 14:46:33 +0000 | [diff] [blame] | 135 | V(MathMinMax) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 136 | V(ModI) \ |
| 137 | V(MulI) \ |
| 138 | V(NumberTagD) \ |
| 139 | V(NumberTagI) \ |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 140 | V(NumberTagU) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 141 | V(NumberUntagD) \ |
jkummerow@chromium.org | f7a5884 | 2012-02-21 10:08:21 +0000 | [diff] [blame] | 142 | V(ObjectLiteral) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 143 | V(OsrEntry) \ |
| 144 | V(OuterContext) \ |
| 145 | V(Parameter) \ |
| 146 | V(Power) \ |
| 147 | V(PushArgument) \ |
erik.corry@gmail.com | f2038fb | 2012-01-16 11:42:08 +0000 | [diff] [blame] | 148 | V(Random) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 149 | V(RegExpLiteral) \ |
| 150 | V(Return) \ |
| 151 | V(ShiftI) \ |
| 152 | V(SmiTag) \ |
| 153 | V(SmiUntag) \ |
| 154 | V(StackCheck) \ |
| 155 | V(StoreContextSlot) \ |
| 156 | V(StoreGlobalCell) \ |
| 157 | V(StoreGlobalGeneric) \ |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 158 | V(StoreKeyed) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 159 | V(StoreKeyedGeneric) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 160 | V(StoreNamedField) \ |
| 161 | V(StoreNamedGeneric) \ |
| 162 | V(StringAdd) \ |
| 163 | V(StringCharCodeAt) \ |
| 164 | V(StringCharFromCode) \ |
mstarzinger@chromium.org | 471f2f1 | 2012-08-10 14:46:33 +0000 | [diff] [blame] | 165 | V(StringCompareAndBranch) \ |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 166 | V(StringLength) \ |
| 167 | V(SubI) \ |
| 168 | V(TaggedToI) \ |
| 169 | V(ThisFunction) \ |
| 170 | V(Throw) \ |
| 171 | V(ToFastProperties) \ |
| 172 | V(TransitionElementsKind) \ |
| 173 | V(Typeof) \ |
| 174 | V(TypeofIsAndBranch) \ |
| 175 | V(UnaryMathOperation) \ |
| 176 | V(UnknownOSRValue) \ |
ulan@chromium.org | 812308e | 2012-02-29 15:58:45 +0000 | [diff] [blame] | 177 | V(ValueOf) \ |
| 178 | V(ForInPrepareMap) \ |
| 179 | V(ForInCacheArray) \ |
| 180 | V(CheckMapValue) \ |
yangguo@chromium.org | 154ff99 | 2012-03-13 08:09:54 +0000 | [diff] [blame] | 181 | V(LoadFieldByIndex) \ |
rossberg@chromium.org | 2c067b1 | 2012-03-19 11:01:52 +0000 | [diff] [blame] | 182 | V(DateField) \ |
jkummerow@chromium.org | 28faa98 | 2012-04-13 09:58:30 +0000 | [diff] [blame] | 183 | V(WrapReceiver) \ |
| 184 | V(Drop) |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 185 | |
| 186 | #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
| 187 | virtual Opcode opcode() const { return LInstruction::k##type; } \ |
| 188 | virtual void CompileToNative(LCodeGen* generator); \ |
| 189 | virtual const char* Mnemonic() const { return mnemonic; } \ |
| 190 | static L##type* cast(LInstruction* instr) { \ |
| 191 | ASSERT(instr->Is##type()); \ |
| 192 | return reinterpret_cast<L##type*>(instr); \ |
| 193 | } |
| 194 | |
| 195 | |
| 196 | #define DECLARE_HYDROGEN_ACCESSOR(type) \ |
| 197 | H##type* hydrogen() const { \ |
| 198 | return H##type::cast(hydrogen_value()); \ |
| 199 | } |
| 200 | |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 201 | |
| 202 | class LInstruction: public ZoneObject { |
| 203 | public: |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 204 | LInstruction() |
| 205 | : environment_(NULL), |
| 206 | hydrogen_value_(NULL), |
danno@chromium.org | 1044a4d | 2012-04-30 12:34:39 +0000 | [diff] [blame] | 207 | is_call_(false) { } |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 208 | virtual ~LInstruction() { } |
| 209 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 210 | virtual void CompileToNative(LCodeGen* generator) = 0; |
| 211 | virtual const char* Mnemonic() const = 0; |
| 212 | virtual void PrintTo(StringStream* stream); |
mstarzinger@chromium.org | 88d326b | 2012-04-23 12:57:22 +0000 | [diff] [blame] | 213 | virtual void PrintDataTo(StringStream* stream); |
| 214 | virtual void PrintOutputOperandTo(StringStream* stream); |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 215 | |
| 216 | enum Opcode { |
| 217 | // Declare a unique enum value for each instruction. |
| 218 | #define DECLARE_OPCODE(type) k##type, |
| 219 | LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE) |
| 220 | kNumberOfInstructions |
| 221 | #undef DECLARE_OPCODE |
| 222 | }; |
| 223 | |
| 224 | virtual Opcode opcode() const = 0; |
| 225 | |
| 226 | // Declare non-virtual type testers for all leaf IR classes. |
| 227 | #define DECLARE_PREDICATE(type) \ |
| 228 | bool Is##type() const { return opcode() == k##type; } |
| 229 | LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE) |
| 230 | #undef DECLARE_PREDICATE |
| 231 | |
| 232 | // Declare virtual predicates for instructions that don't have |
| 233 | // an opcode. |
| 234 | virtual bool IsGap() const { return false; } |
| 235 | |
| 236 | virtual bool IsControl() const { return false; } |
| 237 | |
| 238 | void set_environment(LEnvironment* env) { environment_ = env; } |
| 239 | LEnvironment* environment() const { return environment_; } |
| 240 | bool HasEnvironment() const { return environment_ != NULL; } |
| 241 | |
| 242 | void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } |
| 243 | LPointerMap* pointer_map() const { return pointer_map_.get(); } |
| 244 | bool HasPointerMap() const { return pointer_map_.is_set(); } |
| 245 | |
| 246 | void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
| 247 | HValue* hydrogen_value() const { return hydrogen_value_; } |
| 248 | |
danno@chromium.org | 1044a4d | 2012-04-30 12:34:39 +0000 | [diff] [blame] | 249 | virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 250 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 251 | void MarkAsCall() { is_call_ = true; } |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 252 | |
| 253 | // Interface to the register allocator and iterators. |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 254 | bool IsMarkedAsCall() const { return is_call_; } |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 255 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 256 | virtual bool HasResult() const = 0; |
| 257 | virtual LOperand* result() = 0; |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 258 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 259 | LOperand* FirstInput() { return InputAt(0); } |
| 260 | LOperand* Output() { return HasResult() ? result() : NULL; } |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 261 | |
| 262 | #ifdef DEBUG |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 263 | void VerifyCall(); |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 264 | #endif |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 265 | |
| 266 | private: |
yangguo@chromium.org | 46839fb | 2012-08-28 09:06:19 +0000 | [diff] [blame] | 267 | // Iterator interface. |
| 268 | friend class InputIterator; |
| 269 | virtual int InputCount() = 0; |
| 270 | virtual LOperand* InputAt(int i) = 0; |
| 271 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 272 | friend class TempIterator; |
| 273 | virtual int TempCount() = 0; |
| 274 | virtual LOperand* TempAt(int i) = 0; |
| 275 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 276 | LEnvironment* environment_; |
| 277 | SetOncePointer<LPointerMap> pointer_map_; |
| 278 | HValue* hydrogen_value_; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 279 | bool is_call_; |
| 280 | bool is_save_doubles_; |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 281 | }; |
| 282 | |
| 283 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 284 | // R = number of result operands (0 or 1). |
| 285 | // I = number of input operands. |
| 286 | // T = number of temporary operands. |
| 287 | template<int R, int I, int T> |
| 288 | class LTemplateInstruction: public LInstruction { |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 289 | public: |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 290 | // Allow 0 or 1 output operands. |
| 291 | STATIC_ASSERT(R == 0 || R == 1); |
| 292 | virtual bool HasResult() const { return R != 0; } |
| 293 | void set_result(LOperand* operand) { results_[0] = operand; } |
| 294 | LOperand* result() { return results_[0]; } |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 295 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 296 | protected: |
| 297 | EmbeddedContainer<LOperand*, R> results_; |
| 298 | EmbeddedContainer<LOperand*, I> inputs_; |
| 299 | EmbeddedContainer<LOperand*, T> temps_; |
yangguo@chromium.org | 46839fb | 2012-08-28 09:06:19 +0000 | [diff] [blame] | 300 | |
| 301 | private: |
| 302 | virtual int InputCount() { return I; } |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 303 | virtual LOperand* InputAt(int i) { return inputs_[i]; } |
| 304 | |
| 305 | virtual int TempCount() { return T; } |
| 306 | virtual LOperand* TempAt(int i) { return temps_[i]; } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 307 | }; |
| 308 | |
| 309 | |
| 310 | class LGap: public LTemplateInstruction<0, 0, 0> { |
| 311 | public: |
| 312 | explicit LGap(HBasicBlock* block) |
| 313 | : block_(block) { |
| 314 | parallel_moves_[BEFORE] = NULL; |
| 315 | parallel_moves_[START] = NULL; |
| 316 | parallel_moves_[END] = NULL; |
| 317 | parallel_moves_[AFTER] = NULL; |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 318 | } |
| 319 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 320 | // Can't use the DECLARE-macro here because of sub-classes. |
| 321 | virtual bool IsGap() const { return true; } |
| 322 | virtual void PrintDataTo(StringStream* stream); |
| 323 | static LGap* cast(LInstruction* instr) { |
| 324 | ASSERT(instr->IsGap()); |
| 325 | return reinterpret_cast<LGap*>(instr); |
| 326 | } |
| 327 | |
| 328 | bool IsRedundant() const; |
| 329 | |
| 330 | HBasicBlock* block() const { return block_; } |
| 331 | |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 332 | enum InnerPosition { |
| 333 | BEFORE, |
| 334 | START, |
| 335 | END, |
| 336 | AFTER, |
| 337 | FIRST_INNER_POSITION = BEFORE, |
| 338 | LAST_INNER_POSITION = AFTER |
| 339 | }; |
| 340 | |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 341 | LParallelMove* GetOrCreateParallelMove(InnerPosition pos, Zone* zone) { |
| 342 | if (parallel_moves_[pos] == NULL) { |
| 343 | parallel_moves_[pos] = new(zone) LParallelMove(zone); |
| 344 | } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 345 | return parallel_moves_[pos]; |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 346 | } |
| 347 | |
| 348 | LParallelMove* GetParallelMove(InnerPosition pos) { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 349 | return parallel_moves_[pos]; |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 350 | } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 351 | |
| 352 | private: |
| 353 | LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; |
| 354 | HBasicBlock* block_; |
| 355 | }; |
| 356 | |
| 357 | |
| 358 | class LInstructionGap: public LGap { |
| 359 | public: |
| 360 | explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } |
| 361 | |
| 362 | DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") |
| 363 | }; |
| 364 | |
| 365 | |
| 366 | class LGoto: public LTemplateInstruction<0, 0, 0> { |
| 367 | public: |
| 368 | explicit LGoto(int block_id) : block_id_(block_id) { } |
| 369 | |
| 370 | DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") |
| 371 | virtual void PrintDataTo(StringStream* stream); |
| 372 | virtual bool IsControl() const { return true; } |
| 373 | |
| 374 | int block_id() const { return block_id_; } |
| 375 | |
| 376 | private: |
| 377 | int block_id_; |
| 378 | }; |
| 379 | |
| 380 | |
| 381 | class LLazyBailout: public LTemplateInstruction<0, 0, 0> { |
| 382 | public: |
| 383 | LLazyBailout() : gap_instructions_size_(0) { } |
| 384 | |
| 385 | DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") |
| 386 | |
| 387 | void set_gap_instructions_size(int gap_instructions_size) { |
| 388 | gap_instructions_size_ = gap_instructions_size; |
| 389 | } |
| 390 | int gap_instructions_size() { return gap_instructions_size_; } |
| 391 | |
| 392 | private: |
| 393 | int gap_instructions_size_; |
| 394 | }; |
| 395 | |
| 396 | |
| 397 | class LDeoptimize: public LTemplateInstruction<0, 0, 0> { |
| 398 | public: |
| 399 | DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 400 | }; |
| 401 | |
| 402 | |
| 403 | class LLabel: public LGap { |
| 404 | public: |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 405 | explicit LLabel(HBasicBlock* block) |
| 406 | : LGap(block), replacement_(NULL) { } |
| 407 | |
| 408 | DECLARE_CONCRETE_INSTRUCTION(Label, "label") |
| 409 | |
| 410 | virtual void PrintDataTo(StringStream* stream); |
| 411 | |
| 412 | int block_id() const { return block()->block_id(); } |
| 413 | bool is_loop_header() const { return block()->IsLoopHeader(); } |
| 414 | Label* label() { return &label_; } |
| 415 | LLabel* replacement() const { return replacement_; } |
| 416 | void set_replacement(LLabel* label) { replacement_ = label; } |
| 417 | bool HasReplacement() const { return replacement_ != NULL; } |
| 418 | |
| 419 | private: |
| 420 | Label label_; |
| 421 | LLabel* replacement_; |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 422 | }; |
| 423 | |
| 424 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 425 | class LParameter: public LTemplateInstruction<1, 0, 0> { |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 426 | public: |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 427 | DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") |
| 428 | }; |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 429 | |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 430 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 431 | class LCallStub: public LTemplateInstruction<1, 0, 0> { |
| 432 | public: |
| 433 | DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") |
| 434 | DECLARE_HYDROGEN_ACCESSOR(CallStub) |
| 435 | |
| 436 | TranscendentalCache::Type transcendental_type() { |
| 437 | return hydrogen()->transcendental_type(); |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 438 | } |
| 439 | }; |
| 440 | |
| 441 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 442 | class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { |
| 443 | public: |
| 444 | DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
| 445 | }; |
| 446 | |
| 447 | |
| 448 | template<int I, int T> |
| 449 | class LControlInstruction: public LTemplateInstruction<0, I, T> { |
| 450 | public: |
| 451 | virtual bool IsControl() const { return true; } |
| 452 | |
| 453 | int SuccessorCount() { return hydrogen()->SuccessorCount(); } |
| 454 | HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); } |
| 455 | int true_block_id() { return hydrogen()->SuccessorAt(0)->block_id(); } |
| 456 | int false_block_id() { return hydrogen()->SuccessorAt(1)->block_id(); } |
| 457 | |
| 458 | private: |
| 459 | HControlInstruction* hydrogen() { |
| 460 | return HControlInstruction::cast(this->hydrogen_value()); |
| 461 | } |
| 462 | }; |
| 463 | |
| 464 | |
rossberg@chromium.org | 2c067b1 | 2012-03-19 11:01:52 +0000 | [diff] [blame] | 465 | class LWrapReceiver: public LTemplateInstruction<1, 2, 0> { |
| 466 | public: |
| 467 | LWrapReceiver(LOperand* receiver, LOperand* function) { |
| 468 | inputs_[0] = receiver; |
| 469 | inputs_[1] = function; |
| 470 | } |
| 471 | |
| 472 | DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver") |
| 473 | |
| 474 | LOperand* receiver() { return inputs_[0]; } |
| 475 | LOperand* function() { return inputs_[1]; } |
| 476 | }; |
| 477 | |
| 478 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 479 | class LApplyArguments: public LTemplateInstruction<1, 4, 0> { |
| 480 | public: |
| 481 | LApplyArguments(LOperand* function, |
| 482 | LOperand* receiver, |
| 483 | LOperand* length, |
| 484 | LOperand* elements) { |
| 485 | inputs_[0] = function; |
| 486 | inputs_[1] = receiver; |
| 487 | inputs_[2] = length; |
| 488 | inputs_[3] = elements; |
| 489 | } |
| 490 | |
| 491 | DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments") |
| 492 | |
| 493 | LOperand* function() { return inputs_[0]; } |
| 494 | LOperand* receiver() { return inputs_[1]; } |
| 495 | LOperand* length() { return inputs_[2]; } |
| 496 | LOperand* elements() { return inputs_[3]; } |
| 497 | }; |
| 498 | |
| 499 | |
| 500 | class LAccessArgumentsAt: public LTemplateInstruction<1, 3, 0> { |
| 501 | public: |
| 502 | LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) { |
| 503 | inputs_[0] = arguments; |
| 504 | inputs_[1] = length; |
| 505 | inputs_[2] = index; |
| 506 | } |
| 507 | |
| 508 | DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at") |
| 509 | |
| 510 | LOperand* arguments() { return inputs_[0]; } |
| 511 | LOperand* length() { return inputs_[1]; } |
| 512 | LOperand* index() { return inputs_[2]; } |
| 513 | |
| 514 | virtual void PrintDataTo(StringStream* stream); |
| 515 | }; |
| 516 | |
| 517 | |
| 518 | class LArgumentsLength: public LTemplateInstruction<1, 1, 0> { |
| 519 | public: |
| 520 | explicit LArgumentsLength(LOperand* elements) { |
| 521 | inputs_[0] = elements; |
| 522 | } |
| 523 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 524 | LOperand* elements() { return inputs_[0]; } |
| 525 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 526 | DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") |
| 527 | }; |
| 528 | |
| 529 | |
| 530 | class LArgumentsElements: public LTemplateInstruction<1, 0, 0> { |
| 531 | public: |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 532 | DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements") |
jkummerow@chromium.org | 28faa98 | 2012-04-13 09:58:30 +0000 | [diff] [blame] | 533 | DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements) |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 534 | }; |
| 535 | |
| 536 | |
| 537 | class LModI: public LTemplateInstruction<1, 2, 3> { |
| 538 | public: |
| 539 | // Used when the right hand is a constant power of 2. |
| 540 | LModI(LOperand* left, |
| 541 | LOperand* right) { |
| 542 | inputs_[0] = left; |
| 543 | inputs_[1] = right; |
| 544 | temps_[0] = NULL; |
| 545 | temps_[1] = NULL; |
| 546 | temps_[2] = NULL; |
| 547 | } |
| 548 | |
| 549 | // Used for the standard case. |
| 550 | LModI(LOperand* left, |
| 551 | LOperand* right, |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 552 | LOperand* temp, |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 553 | LOperand* temp2, |
| 554 | LOperand* temp3) { |
| 555 | inputs_[0] = left; |
| 556 | inputs_[1] = right; |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 557 | temps_[0] = temp; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 558 | temps_[1] = temp2; |
| 559 | temps_[2] = temp3; |
| 560 | } |
| 561 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 562 | LOperand* left() { return inputs_[0]; } |
| 563 | LOperand* right() { return inputs_[1]; } |
| 564 | LOperand* temp() { return temps_[0]; } |
| 565 | LOperand* temp2() { return temps_[1]; } |
| 566 | LOperand* temp3() { return temps_[2]; } |
| 567 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 568 | DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") |
| 569 | DECLARE_HYDROGEN_ACCESSOR(Mod) |
| 570 | }; |
| 571 | |
| 572 | |
| 573 | class LDivI: public LTemplateInstruction<1, 2, 0> { |
| 574 | public: |
| 575 | LDivI(LOperand* left, LOperand* right) { |
| 576 | inputs_[0] = left; |
| 577 | inputs_[1] = right; |
| 578 | } |
| 579 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 580 | LOperand* left() { return inputs_[0]; } |
| 581 | LOperand* right() { return inputs_[1]; } |
| 582 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 583 | DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") |
| 584 | DECLARE_HYDROGEN_ACCESSOR(Div) |
| 585 | }; |
| 586 | |
| 587 | |
| 588 | class LMulI: public LTemplateInstruction<1, 2, 1> { |
| 589 | public: |
| 590 | LMulI(LOperand* left, LOperand* right, LOperand* temp) { |
| 591 | inputs_[0] = left; |
| 592 | inputs_[1] = right; |
| 593 | temps_[0] = temp; |
| 594 | } |
| 595 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 596 | LOperand* left() { return inputs_[0]; } |
| 597 | LOperand* right() { return inputs_[1]; } |
| 598 | LOperand* temp() { return temps_[0]; } |
| 599 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 600 | DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") |
| 601 | DECLARE_HYDROGEN_ACCESSOR(Mul) |
| 602 | }; |
| 603 | |
| 604 | |
| 605 | class LCmpIDAndBranch: public LControlInstruction<2, 0> { |
| 606 | public: |
| 607 | LCmpIDAndBranch(LOperand* left, LOperand* right) { |
| 608 | inputs_[0] = left; |
| 609 | inputs_[1] = right; |
| 610 | } |
| 611 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 612 | LOperand* left() { return inputs_[0]; } |
| 613 | LOperand* right() { return inputs_[1]; } |
| 614 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 615 | DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") |
| 616 | DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch) |
| 617 | |
| 618 | Token::Value op() const { return hydrogen()->token(); } |
| 619 | bool is_double() const { |
ulan@chromium.org | 8e8d882 | 2012-11-23 14:36:46 +0000 | [diff] [blame] | 620 | return hydrogen()->representation().IsDouble(); |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 621 | } |
| 622 | |
| 623 | virtual void PrintDataTo(StringStream* stream); |
| 624 | }; |
| 625 | |
| 626 | |
| 627 | class LUnaryMathOperation: public LTemplateInstruction<1, 1, 1> { |
| 628 | public: |
| 629 | LUnaryMathOperation(LOperand* value, LOperand* temp) { |
| 630 | inputs_[0] = value; |
| 631 | temps_[0] = temp; |
| 632 | } |
| 633 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 634 | LOperand* value() { return inputs_[0]; } |
| 635 | LOperand* temp() { return temps_[0]; } |
| 636 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 637 | DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") |
| 638 | DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 639 | |
| 640 | virtual void PrintDataTo(StringStream* stream); |
| 641 | BuiltinFunctionId op() const { return hydrogen()->op(); } |
| 642 | }; |
| 643 | |
| 644 | |
svenpanne@chromium.org | 83130cf | 2012-11-30 10:13:25 +0000 | [diff] [blame^] | 645 | class LMathExp: public LTemplateInstruction<1, 1, 3> { |
| 646 | public: |
| 647 | LMathExp(LOperand* value, |
| 648 | LOperand* double_temp, |
| 649 | LOperand* temp1, |
| 650 | LOperand* temp2) { |
| 651 | inputs_[0] = value; |
| 652 | temps_[0] = temp1; |
| 653 | temps_[1] = temp2; |
| 654 | temps_[2] = double_temp; |
| 655 | ExternalReference::InitializeMathExpData(); |
| 656 | } |
| 657 | |
| 658 | LOperand* value() { return inputs_[0]; } |
| 659 | LOperand* temp1() { return temps_[0]; } |
| 660 | LOperand* temp2() { return temps_[1]; } |
| 661 | LOperand* double_temp() { return temps_[2]; } |
| 662 | |
| 663 | DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") |
| 664 | |
| 665 | virtual void PrintDataTo(StringStream* stream); |
| 666 | }; |
| 667 | |
| 668 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 669 | class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { |
| 670 | public: |
| 671 | LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { |
| 672 | inputs_[0] = left; |
| 673 | inputs_[1] = right; |
| 674 | } |
| 675 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 676 | LOperand* left() { return inputs_[0]; } |
| 677 | LOperand* right() { return inputs_[1]; } |
| 678 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 679 | DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, |
| 680 | "cmp-object-eq-and-branch") |
| 681 | DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch) |
| 682 | }; |
| 683 | |
| 684 | |
| 685 | class LCmpConstantEqAndBranch: public LControlInstruction<1, 0> { |
| 686 | public: |
| 687 | explicit LCmpConstantEqAndBranch(LOperand* left) { |
| 688 | inputs_[0] = left; |
| 689 | } |
| 690 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 691 | LOperand* left() { return inputs_[0]; } |
| 692 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 693 | DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch, |
| 694 | "cmp-constant-eq-and-branch") |
| 695 | DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch) |
| 696 | }; |
| 697 | |
| 698 | |
| 699 | class LIsNilAndBranch: public LControlInstruction<1, 0> { |
| 700 | public: |
| 701 | explicit LIsNilAndBranch(LOperand* value) { |
| 702 | inputs_[0] = value; |
| 703 | } |
| 704 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 705 | LOperand* value() { return inputs_[0]; } |
| 706 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 707 | DECLARE_CONCRETE_INSTRUCTION(IsNilAndBranch, "is-nil-and-branch") |
| 708 | DECLARE_HYDROGEN_ACCESSOR(IsNilAndBranch) |
| 709 | |
| 710 | EqualityKind kind() const { return hydrogen()->kind(); } |
| 711 | NilValue nil() const { return hydrogen()->nil(); } |
| 712 | |
| 713 | virtual void PrintDataTo(StringStream* stream); |
| 714 | }; |
| 715 | |
| 716 | |
| 717 | class LIsObjectAndBranch: public LControlInstruction<1, 1> { |
| 718 | public: |
| 719 | LIsObjectAndBranch(LOperand* value, LOperand* temp) { |
| 720 | inputs_[0] = value; |
| 721 | temps_[0] = temp; |
| 722 | } |
| 723 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 724 | LOperand* value() { return inputs_[0]; } |
| 725 | LOperand* temp() { return temps_[0]; } |
| 726 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 727 | DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") |
| 728 | DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch) |
| 729 | |
| 730 | virtual void PrintDataTo(StringStream* stream); |
| 731 | }; |
| 732 | |
| 733 | |
mstarzinger@chromium.org | f8c6bd5 | 2011-11-23 12:13:52 +0000 | [diff] [blame] | 734 | class LIsStringAndBranch: public LControlInstruction<1, 1> { |
| 735 | public: |
| 736 | LIsStringAndBranch(LOperand* value, LOperand* temp) { |
| 737 | inputs_[0] = value; |
| 738 | temps_[0] = temp; |
| 739 | } |
| 740 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 741 | LOperand* value() { return inputs_[0]; } |
| 742 | LOperand* temp() { return temps_[0]; } |
| 743 | |
mstarzinger@chromium.org | f8c6bd5 | 2011-11-23 12:13:52 +0000 | [diff] [blame] | 744 | DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch") |
| 745 | DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch) |
| 746 | |
| 747 | virtual void PrintDataTo(StringStream* stream); |
| 748 | }; |
| 749 | |
| 750 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 751 | class LIsSmiAndBranch: public LControlInstruction<1, 0> { |
| 752 | public: |
| 753 | explicit LIsSmiAndBranch(LOperand* value) { |
| 754 | inputs_[0] = value; |
| 755 | } |
| 756 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 757 | LOperand* value() { return inputs_[0]; } |
| 758 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 759 | DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") |
| 760 | DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) |
| 761 | |
| 762 | virtual void PrintDataTo(StringStream* stream); |
| 763 | }; |
| 764 | |
| 765 | |
| 766 | class LIsUndetectableAndBranch: public LControlInstruction<1, 1> { |
| 767 | public: |
| 768 | explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) { |
| 769 | inputs_[0] = value; |
| 770 | temps_[0] = temp; |
| 771 | } |
| 772 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 773 | LOperand* value() { return inputs_[0]; } |
| 774 | LOperand* temp() { return temps_[0]; } |
| 775 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 776 | DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch, |
| 777 | "is-undetectable-and-branch") |
| 778 | DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch) |
| 779 | |
| 780 | virtual void PrintDataTo(StringStream* stream); |
| 781 | }; |
| 782 | |
| 783 | |
mstarzinger@chromium.org | f8c6bd5 | 2011-11-23 12:13:52 +0000 | [diff] [blame] | 784 | class LStringCompareAndBranch: public LControlInstruction<2, 0> { |
| 785 | public: |
| 786 | LStringCompareAndBranch(LOperand* left, LOperand* right) { |
| 787 | inputs_[0] = left; |
| 788 | inputs_[1] = right; |
| 789 | } |
| 790 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 791 | LOperand* left() { return inputs_[0]; } |
| 792 | LOperand* right() { return inputs_[1]; } |
| 793 | |
mstarzinger@chromium.org | f8c6bd5 | 2011-11-23 12:13:52 +0000 | [diff] [blame] | 794 | DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch, |
| 795 | "string-compare-and-branch") |
| 796 | DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch) |
| 797 | |
| 798 | Token::Value op() const { return hydrogen()->token(); } |
| 799 | |
| 800 | virtual void PrintDataTo(StringStream* stream); |
| 801 | }; |
| 802 | |
| 803 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 804 | class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> { |
| 805 | public: |
| 806 | explicit LHasInstanceTypeAndBranch(LOperand* value) { |
| 807 | inputs_[0] = value; |
| 808 | } |
| 809 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 810 | LOperand* value() { return inputs_[0]; } |
| 811 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 812 | DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, |
| 813 | "has-instance-type-and-branch") |
| 814 | DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch) |
| 815 | |
| 816 | virtual void PrintDataTo(StringStream* stream); |
| 817 | }; |
| 818 | |
| 819 | |
| 820 | class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> { |
| 821 | public: |
| 822 | explicit LGetCachedArrayIndex(LOperand* value) { |
| 823 | inputs_[0] = value; |
| 824 | } |
| 825 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 826 | LOperand* value() { return inputs_[0]; } |
| 827 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 828 | DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") |
| 829 | DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) |
| 830 | }; |
| 831 | |
| 832 | |
| 833 | class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> { |
| 834 | public: |
| 835 | explicit LHasCachedArrayIndexAndBranch(LOperand* value) { |
| 836 | inputs_[0] = value; |
| 837 | } |
| 838 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 839 | LOperand* value() { return inputs_[0]; } |
| 840 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 841 | DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, |
| 842 | "has-cached-array-index-and-branch") |
| 843 | DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch) |
| 844 | |
| 845 | virtual void PrintDataTo(StringStream* stream); |
| 846 | }; |
| 847 | |
| 848 | |
| 849 | class LClassOfTestAndBranch: public LControlInstruction<1, 1> { |
| 850 | public: |
| 851 | LClassOfTestAndBranch(LOperand* value, LOperand* temp) { |
| 852 | inputs_[0] = value; |
| 853 | temps_[0] = temp; |
| 854 | } |
| 855 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 856 | LOperand* value() { return inputs_[0]; } |
| 857 | LOperand* temp() { return temps_[0]; } |
| 858 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 859 | DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, |
| 860 | "class-of-test-and-branch") |
| 861 | DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) |
| 862 | |
| 863 | virtual void PrintDataTo(StringStream* stream); |
| 864 | }; |
| 865 | |
| 866 | |
| 867 | class LCmpT: public LTemplateInstruction<1, 2, 0> { |
| 868 | public: |
| 869 | LCmpT(LOperand* left, LOperand* right) { |
| 870 | inputs_[0] = left; |
| 871 | inputs_[1] = right; |
| 872 | } |
| 873 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 874 | LOperand* left() { return inputs_[0]; } |
| 875 | LOperand* right() { return inputs_[1]; } |
| 876 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 877 | DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") |
| 878 | DECLARE_HYDROGEN_ACCESSOR(CompareGeneric) |
| 879 | |
| 880 | Token::Value op() const { return hydrogen()->token(); } |
| 881 | }; |
| 882 | |
| 883 | |
| 884 | class LInstanceOf: public LTemplateInstruction<1, 2, 0> { |
| 885 | public: |
| 886 | LInstanceOf(LOperand* left, LOperand* right) { |
| 887 | inputs_[0] = left; |
| 888 | inputs_[1] = right; |
| 889 | } |
| 890 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 891 | LOperand* left() { return inputs_[0]; } |
| 892 | LOperand* right() { return inputs_[1]; } |
| 893 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 894 | DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") |
| 895 | }; |
| 896 | |
| 897 | |
| 898 | class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> { |
| 899 | public: |
| 900 | LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) { |
| 901 | inputs_[0] = value; |
| 902 | temps_[0] = temp; |
| 903 | } |
| 904 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 905 | LOperand* value() { return inputs_[0]; } |
| 906 | LOperand* temp() { return temps_[0]; } |
| 907 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 908 | DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, |
| 909 | "instance-of-known-global") |
| 910 | DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) |
| 911 | |
| 912 | Handle<JSFunction> function() const { return hydrogen()->function(); } |
danno@chromium.org | 1044a4d | 2012-04-30 12:34:39 +0000 | [diff] [blame] | 913 | LEnvironment* GetDeferredLazyDeoptimizationEnvironment() { |
| 914 | return lazy_deopt_env_; |
| 915 | } |
| 916 | virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { |
| 917 | lazy_deopt_env_ = env; |
| 918 | } |
| 919 | |
| 920 | private: |
| 921 | LEnvironment* lazy_deopt_env_; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 922 | }; |
| 923 | |
| 924 | |
| 925 | class LBoundsCheck: public LTemplateInstruction<0, 2, 0> { |
| 926 | public: |
| 927 | LBoundsCheck(LOperand* index, LOperand* length) { |
| 928 | inputs_[0] = index; |
| 929 | inputs_[1] = length; |
| 930 | } |
| 931 | |
| 932 | LOperand* index() { return inputs_[0]; } |
| 933 | LOperand* length() { return inputs_[1]; } |
| 934 | |
| 935 | DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check") |
danno@chromium.org | 129d398 | 2012-07-25 15:01:47 +0000 | [diff] [blame] | 936 | DECLARE_HYDROGEN_ACCESSOR(BoundsCheck) |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 937 | }; |
| 938 | |
| 939 | |
| 940 | class LBitI: public LTemplateInstruction<1, 2, 0> { |
| 941 | public: |
| 942 | LBitI(LOperand* left, LOperand* right) { |
| 943 | inputs_[0] = left; |
| 944 | inputs_[1] = right; |
| 945 | } |
| 946 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 947 | LOperand* left() { return inputs_[0]; } |
| 948 | LOperand* right() { return inputs_[1]; } |
| 949 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 950 | Token::Value op() const { return hydrogen()->op(); } |
| 951 | |
| 952 | DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i") |
| 953 | DECLARE_HYDROGEN_ACCESSOR(Bitwise) |
| 954 | }; |
| 955 | |
| 956 | |
| 957 | class LShiftI: public LTemplateInstruction<1, 2, 0> { |
| 958 | public: |
| 959 | LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt) |
| 960 | : op_(op), can_deopt_(can_deopt) { |
| 961 | inputs_[0] = left; |
| 962 | inputs_[1] = right; |
| 963 | } |
| 964 | |
| 965 | Token::Value op() const { return op_; } |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 966 | LOperand* left() { return inputs_[0]; } |
| 967 | LOperand* right() { return inputs_[1]; } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 968 | bool can_deopt() const { return can_deopt_; } |
| 969 | |
| 970 | DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i") |
| 971 | |
| 972 | private: |
| 973 | Token::Value op_; |
| 974 | bool can_deopt_; |
| 975 | }; |
| 976 | |
| 977 | |
| 978 | class LSubI: public LTemplateInstruction<1, 2, 0> { |
| 979 | public: |
| 980 | LSubI(LOperand* left, LOperand* right) { |
| 981 | inputs_[0] = left; |
| 982 | inputs_[1] = right; |
| 983 | } |
| 984 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 985 | LOperand* left() { return inputs_[0]; } |
| 986 | LOperand* right() { return inputs_[1]; } |
| 987 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 988 | DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") |
| 989 | DECLARE_HYDROGEN_ACCESSOR(Sub) |
| 990 | }; |
| 991 | |
| 992 | |
| 993 | class LConstantI: public LTemplateInstruction<1, 0, 0> { |
| 994 | public: |
| 995 | DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i") |
| 996 | DECLARE_HYDROGEN_ACCESSOR(Constant) |
| 997 | |
| 998 | int32_t value() const { return hydrogen()->Integer32Value(); } |
| 999 | }; |
| 1000 | |
| 1001 | |
| 1002 | class LConstantD: public LTemplateInstruction<1, 0, 0> { |
| 1003 | public: |
| 1004 | DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") |
| 1005 | DECLARE_HYDROGEN_ACCESSOR(Constant) |
| 1006 | |
| 1007 | double value() const { return hydrogen()->DoubleValue(); } |
| 1008 | }; |
| 1009 | |
| 1010 | |
| 1011 | class LConstantT: public LTemplateInstruction<1, 0, 0> { |
| 1012 | public: |
| 1013 | DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") |
| 1014 | DECLARE_HYDROGEN_ACCESSOR(Constant) |
| 1015 | |
| 1016 | Handle<Object> value() const { return hydrogen()->handle(); } |
| 1017 | }; |
| 1018 | |
| 1019 | |
| 1020 | class LBranch: public LControlInstruction<1, 0> { |
| 1021 | public: |
| 1022 | explicit LBranch(LOperand* value) { |
| 1023 | inputs_[0] = value; |
| 1024 | } |
| 1025 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1026 | LOperand* value() { return inputs_[0]; } |
| 1027 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1028 | DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") |
| 1029 | DECLARE_HYDROGEN_ACCESSOR(Branch) |
| 1030 | |
| 1031 | virtual void PrintDataTo(StringStream* stream); |
| 1032 | }; |
| 1033 | |
| 1034 | |
| 1035 | class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 1> { |
| 1036 | public: |
| 1037 | LCmpMapAndBranch(LOperand* value, LOperand* temp) { |
| 1038 | inputs_[0] = value; |
| 1039 | temps_[0] = temp; |
| 1040 | } |
| 1041 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1042 | LOperand* value() { return inputs_[0]; } |
| 1043 | LOperand* temp() { return temps_[0]; } |
| 1044 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1045 | DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") |
| 1046 | DECLARE_HYDROGEN_ACCESSOR(CompareMap) |
| 1047 | |
| 1048 | virtual bool IsControl() const { return true; } |
| 1049 | |
| 1050 | Handle<Map> map() const { return hydrogen()->map(); } |
| 1051 | int true_block_id() const { |
| 1052 | return hydrogen()->FirstSuccessor()->block_id(); |
| 1053 | } |
| 1054 | int false_block_id() const { |
| 1055 | return hydrogen()->SecondSuccessor()->block_id(); |
| 1056 | } |
| 1057 | }; |
| 1058 | |
| 1059 | |
| 1060 | class LJSArrayLength: public LTemplateInstruction<1, 1, 0> { |
| 1061 | public: |
| 1062 | explicit LJSArrayLength(LOperand* value) { |
| 1063 | inputs_[0] = value; |
| 1064 | } |
| 1065 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1066 | LOperand* value() { return inputs_[0]; } |
| 1067 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1068 | DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length") |
| 1069 | DECLARE_HYDROGEN_ACCESSOR(JSArrayLength) |
| 1070 | }; |
| 1071 | |
| 1072 | |
| 1073 | class LFixedArrayBaseLength: public LTemplateInstruction<1, 1, 0> { |
| 1074 | public: |
| 1075 | explicit LFixedArrayBaseLength(LOperand* value) { |
| 1076 | inputs_[0] = value; |
| 1077 | } |
| 1078 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1079 | LOperand* value() { return inputs_[0]; } |
| 1080 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1081 | DECLARE_CONCRETE_INSTRUCTION(FixedArrayBaseLength, |
| 1082 | "fixed-array-base-length") |
| 1083 | DECLARE_HYDROGEN_ACCESSOR(FixedArrayBaseLength) |
| 1084 | }; |
| 1085 | |
| 1086 | |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 1087 | class LMapEnumLength: public LTemplateInstruction<1, 1, 0> { |
| 1088 | public: |
| 1089 | explicit LMapEnumLength(LOperand* value) { |
| 1090 | inputs_[0] = value; |
| 1091 | } |
| 1092 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1093 | LOperand* value() { return inputs_[0]; } |
| 1094 | |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 1095 | DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length") |
| 1096 | }; |
| 1097 | |
| 1098 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1099 | class LElementsKind: public LTemplateInstruction<1, 1, 0> { |
| 1100 | public: |
| 1101 | explicit LElementsKind(LOperand* value) { |
| 1102 | inputs_[0] = value; |
| 1103 | } |
| 1104 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1105 | LOperand* value() { return inputs_[0]; } |
| 1106 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1107 | DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind") |
| 1108 | DECLARE_HYDROGEN_ACCESSOR(ElementsKind) |
| 1109 | }; |
| 1110 | |
| 1111 | |
| 1112 | class LValueOf: public LTemplateInstruction<1, 1, 1> { |
| 1113 | public: |
| 1114 | LValueOf(LOperand* value, LOperand* temp) { |
| 1115 | inputs_[0] = value; |
| 1116 | temps_[0] = temp; |
| 1117 | } |
| 1118 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1119 | LOperand* value() { return inputs_[0]; } |
| 1120 | LOperand* temp() { return temps_[0]; } |
| 1121 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1122 | DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") |
| 1123 | DECLARE_HYDROGEN_ACCESSOR(ValueOf) |
| 1124 | }; |
| 1125 | |
| 1126 | |
yangguo@chromium.org | 154ff99 | 2012-03-13 08:09:54 +0000 | [diff] [blame] | 1127 | class LDateField: public LTemplateInstruction<1, 1, 1> { |
| 1128 | public: |
| 1129 | LDateField(LOperand* date, LOperand* temp, Smi* index) : index_(index) { |
| 1130 | inputs_[0] = date; |
| 1131 | temps_[0] = temp; |
| 1132 | } |
| 1133 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1134 | LOperand* date() { return inputs_[0]; } |
| 1135 | LOperand* temp() { return temps_[0]; } |
| 1136 | Smi* index() const { return index_; } |
| 1137 | |
yangguo@chromium.org | 154ff99 | 2012-03-13 08:09:54 +0000 | [diff] [blame] | 1138 | DECLARE_CONCRETE_INSTRUCTION(ValueOf, "date-field") |
| 1139 | DECLARE_HYDROGEN_ACCESSOR(ValueOf) |
yangguo@chromium.org | 154ff99 | 2012-03-13 08:09:54 +0000 | [diff] [blame] | 1140 | |
| 1141 | private: |
| 1142 | Smi* index_; |
| 1143 | }; |
| 1144 | |
| 1145 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1146 | class LThrow: public LTemplateInstruction<0, 1, 0> { |
| 1147 | public: |
| 1148 | explicit LThrow(LOperand* value) { |
| 1149 | inputs_[0] = value; |
| 1150 | } |
| 1151 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1152 | LOperand* value() { return inputs_[0]; } |
| 1153 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1154 | DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") |
| 1155 | }; |
| 1156 | |
| 1157 | |
| 1158 | class LBitNotI: public LTemplateInstruction<1, 1, 0> { |
| 1159 | public: |
| 1160 | explicit LBitNotI(LOperand* value) { |
| 1161 | inputs_[0] = value; |
| 1162 | } |
| 1163 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1164 | LOperand* value() { return inputs_[0]; } |
| 1165 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1166 | DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i") |
| 1167 | }; |
| 1168 | |
| 1169 | |
| 1170 | class LAddI: public LTemplateInstruction<1, 2, 0> { |
| 1171 | public: |
| 1172 | LAddI(LOperand* left, LOperand* right) { |
| 1173 | inputs_[0] = left; |
| 1174 | inputs_[1] = right; |
| 1175 | } |
| 1176 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1177 | LOperand* left() { return inputs_[0]; } |
| 1178 | LOperand* right() { return inputs_[1]; } |
| 1179 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1180 | DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") |
| 1181 | DECLARE_HYDROGEN_ACCESSOR(Add) |
| 1182 | }; |
| 1183 | |
| 1184 | |
mstarzinger@chromium.org | 471f2f1 | 2012-08-10 14:46:33 +0000 | [diff] [blame] | 1185 | class LMathMinMax: public LTemplateInstruction<1, 2, 0> { |
| 1186 | public: |
| 1187 | LMathMinMax(LOperand* left, LOperand* right) { |
| 1188 | inputs_[0] = left; |
| 1189 | inputs_[1] = right; |
| 1190 | } |
| 1191 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1192 | LOperand* left() { return inputs_[0]; } |
| 1193 | LOperand* right() { return inputs_[1]; } |
| 1194 | |
mstarzinger@chromium.org | 471f2f1 | 2012-08-10 14:46:33 +0000 | [diff] [blame] | 1195 | DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "min-max") |
| 1196 | DECLARE_HYDROGEN_ACCESSOR(MathMinMax) |
| 1197 | }; |
| 1198 | |
| 1199 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1200 | class LPower: public LTemplateInstruction<1, 2, 0> { |
| 1201 | public: |
| 1202 | LPower(LOperand* left, LOperand* right) { |
| 1203 | inputs_[0] = left; |
| 1204 | inputs_[1] = right; |
| 1205 | } |
| 1206 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1207 | LOperand* left() { return inputs_[0]; } |
| 1208 | LOperand* right() { return inputs_[1]; } |
| 1209 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1210 | DECLARE_CONCRETE_INSTRUCTION(Power, "power") |
| 1211 | DECLARE_HYDROGEN_ACCESSOR(Power) |
| 1212 | }; |
| 1213 | |
| 1214 | |
erik.corry@gmail.com | f2038fb | 2012-01-16 11:42:08 +0000 | [diff] [blame] | 1215 | class LRandom: public LTemplateInstruction<1, 1, 0> { |
| 1216 | public: |
| 1217 | explicit LRandom(LOperand* global_object) { |
| 1218 | inputs_[0] = global_object; |
| 1219 | } |
| 1220 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1221 | LOperand* global_object() { return inputs_[0]; } |
| 1222 | |
erik.corry@gmail.com | f2038fb | 2012-01-16 11:42:08 +0000 | [diff] [blame] | 1223 | DECLARE_CONCRETE_INSTRUCTION(Random, "random") |
| 1224 | DECLARE_HYDROGEN_ACCESSOR(Random) |
| 1225 | }; |
| 1226 | |
| 1227 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1228 | class LArithmeticD: public LTemplateInstruction<1, 2, 0> { |
| 1229 | public: |
| 1230 | LArithmeticD(Token::Value op, LOperand* left, LOperand* right) |
| 1231 | : op_(op) { |
| 1232 | inputs_[0] = left; |
| 1233 | inputs_[1] = right; |
| 1234 | } |
| 1235 | |
| 1236 | Token::Value op() const { return op_; } |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1237 | LOperand* left() { return inputs_[0]; } |
| 1238 | LOperand* right() { return inputs_[1]; } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1239 | |
| 1240 | virtual Opcode opcode() const { return LInstruction::kArithmeticD; } |
| 1241 | virtual void CompileToNative(LCodeGen* generator); |
| 1242 | virtual const char* Mnemonic() const; |
| 1243 | |
| 1244 | private: |
| 1245 | Token::Value op_; |
| 1246 | }; |
| 1247 | |
| 1248 | |
| 1249 | class LArithmeticT: public LTemplateInstruction<1, 2, 0> { |
| 1250 | public: |
| 1251 | LArithmeticT(Token::Value op, LOperand* left, LOperand* right) |
| 1252 | : op_(op) { |
| 1253 | inputs_[0] = left; |
| 1254 | inputs_[1] = right; |
| 1255 | } |
| 1256 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1257 | LOperand* left() { return inputs_[0]; } |
| 1258 | LOperand* right() { return inputs_[1]; } |
| 1259 | Token::Value op() const { return op_; } |
| 1260 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1261 | virtual Opcode opcode() const { return LInstruction::kArithmeticT; } |
| 1262 | virtual void CompileToNative(LCodeGen* generator); |
| 1263 | virtual const char* Mnemonic() const; |
| 1264 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1265 | private: |
| 1266 | Token::Value op_; |
| 1267 | }; |
| 1268 | |
| 1269 | |
| 1270 | class LReturn: public LTemplateInstruction<0, 1, 0> { |
| 1271 | public: |
| 1272 | explicit LReturn(LOperand* value) { |
| 1273 | inputs_[0] = value; |
| 1274 | } |
| 1275 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1276 | LOperand* value() { return inputs_[0]; } |
| 1277 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1278 | DECLARE_CONCRETE_INSTRUCTION(Return, "return") |
| 1279 | }; |
| 1280 | |
| 1281 | |
| 1282 | class LLoadNamedField: public LTemplateInstruction<1, 1, 0> { |
| 1283 | public: |
| 1284 | explicit LLoadNamedField(LOperand* object) { |
| 1285 | inputs_[0] = object; |
| 1286 | } |
| 1287 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1288 | LOperand* object() { return inputs_[0]; } |
| 1289 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1290 | DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") |
| 1291 | DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) |
| 1292 | }; |
| 1293 | |
| 1294 | |
| 1295 | class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 1, 0> { |
| 1296 | public: |
| 1297 | explicit LLoadNamedFieldPolymorphic(LOperand* object) { |
| 1298 | inputs_[0] = object; |
| 1299 | } |
| 1300 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1301 | LOperand* object() { return inputs_[0]; } |
| 1302 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1303 | DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field-polymorphic") |
| 1304 | DECLARE_HYDROGEN_ACCESSOR(LoadNamedFieldPolymorphic) |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1305 | }; |
| 1306 | |
| 1307 | |
| 1308 | class LLoadNamedGeneric: public LTemplateInstruction<1, 1, 0> { |
| 1309 | public: |
| 1310 | explicit LLoadNamedGeneric(LOperand* object) { |
| 1311 | inputs_[0] = object; |
| 1312 | } |
| 1313 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1314 | LOperand* object() { return inputs_[0]; } |
| 1315 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1316 | DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") |
| 1317 | DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) |
| 1318 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1319 | Handle<Object> name() const { return hydrogen()->name(); } |
| 1320 | }; |
| 1321 | |
| 1322 | |
| 1323 | class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 0> { |
| 1324 | public: |
| 1325 | explicit LLoadFunctionPrototype(LOperand* function) { |
| 1326 | inputs_[0] = function; |
| 1327 | } |
| 1328 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1329 | LOperand* function() { return inputs_[0]; } |
| 1330 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1331 | DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") |
| 1332 | DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1333 | }; |
| 1334 | |
| 1335 | |
| 1336 | class LLoadElements: public LTemplateInstruction<1, 1, 0> { |
| 1337 | public: |
| 1338 | explicit LLoadElements(LOperand* object) { |
| 1339 | inputs_[0] = object; |
| 1340 | } |
| 1341 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1342 | LOperand* object() { return inputs_[0]; } |
| 1343 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1344 | DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") |
| 1345 | }; |
| 1346 | |
| 1347 | |
| 1348 | class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> { |
| 1349 | public: |
| 1350 | explicit LLoadExternalArrayPointer(LOperand* object) { |
| 1351 | inputs_[0] = object; |
| 1352 | } |
| 1353 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1354 | LOperand* object() { return inputs_[0]; } |
| 1355 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1356 | DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer, |
| 1357 | "load-external-array-pointer") |
| 1358 | }; |
| 1359 | |
| 1360 | |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 1361 | class LLoadKeyed: public LTemplateInstruction<1, 2, 0> { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1362 | public: |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 1363 | LLoadKeyed(LOperand* elements, LOperand* key) { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1364 | inputs_[0] = elements; |
| 1365 | inputs_[1] = key; |
| 1366 | } |
| 1367 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1368 | LOperand* elements() { return inputs_[0]; } |
| 1369 | LOperand* key() { return inputs_[1]; } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1370 | ElementsKind elements_kind() const { |
| 1371 | return hydrogen()->elements_kind(); |
| 1372 | } |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 1373 | bool is_external() const { |
| 1374 | return hydrogen()->is_external(); |
| 1375 | } |
| 1376 | |
| 1377 | DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
| 1378 | DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
| 1379 | |
ulan@chromium.org | 8e8d882 | 2012-11-23 14:36:46 +0000 | [diff] [blame] | 1380 | virtual void PrintDataTo(StringStream* stream); |
jkummerow@chromium.org | 777db6f | 2012-05-24 09:33:09 +0000 | [diff] [blame] | 1381 | uint32_t additional_index() const { return hydrogen()->index_offset(); } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1382 | }; |
| 1383 | |
| 1384 | |
| 1385 | class LLoadKeyedGeneric: public LTemplateInstruction<1, 2, 0> { |
| 1386 | public: |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1387 | LLoadKeyedGeneric(LOperand* object, LOperand* key) { |
| 1388 | inputs_[0] = object; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1389 | inputs_[1] = key; |
| 1390 | } |
| 1391 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1392 | LOperand* object() { return inputs_[0]; } |
| 1393 | LOperand* key() { return inputs_[1]; } |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1394 | |
| 1395 | DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic") |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1396 | }; |
| 1397 | |
| 1398 | |
| 1399 | class LLoadGlobalCell: public LTemplateInstruction<1, 0, 0> { |
| 1400 | public: |
| 1401 | DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell") |
| 1402 | DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell) |
| 1403 | }; |
| 1404 | |
| 1405 | |
| 1406 | class LLoadGlobalGeneric: public LTemplateInstruction<1, 1, 0> { |
| 1407 | public: |
| 1408 | explicit LLoadGlobalGeneric(LOperand* global_object) { |
| 1409 | inputs_[0] = global_object; |
| 1410 | } |
| 1411 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1412 | LOperand* global_object() { return inputs_[0]; } |
| 1413 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1414 | DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic") |
| 1415 | DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric) |
| 1416 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1417 | Handle<Object> name() const { return hydrogen()->name(); } |
| 1418 | bool for_typeof() const { return hydrogen()->for_typeof(); } |
| 1419 | }; |
| 1420 | |
| 1421 | |
| 1422 | class LStoreGlobalCell: public LTemplateInstruction<0, 1, 1> { |
| 1423 | public: |
| 1424 | LStoreGlobalCell(LOperand* value, LOperand* temp) { |
| 1425 | inputs_[0] = value; |
| 1426 | temps_[0] = temp; |
| 1427 | } |
| 1428 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1429 | LOperand* value() { return inputs_[0]; } |
| 1430 | LOperand* temp() { return temps_[0]; } |
| 1431 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1432 | DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") |
| 1433 | DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) |
| 1434 | }; |
| 1435 | |
| 1436 | |
| 1437 | class LStoreGlobalGeneric: public LTemplateInstruction<0, 2, 0> { |
| 1438 | public: |
| 1439 | explicit LStoreGlobalGeneric(LOperand* global_object, |
| 1440 | LOperand* value) { |
| 1441 | inputs_[0] = global_object; |
| 1442 | inputs_[1] = value; |
| 1443 | } |
| 1444 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1445 | LOperand* global_object() { return inputs_[0]; } |
| 1446 | LOperand* value() { return inputs_[1]; } |
| 1447 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1448 | DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic") |
| 1449 | DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric) |
| 1450 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1451 | Handle<Object> name() const { return hydrogen()->name(); } |
mstarzinger@chromium.org | 1b3afd1 | 2011-11-29 14:28:56 +0000 | [diff] [blame] | 1452 | StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1453 | }; |
| 1454 | |
| 1455 | |
| 1456 | class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> { |
| 1457 | public: |
| 1458 | explicit LLoadContextSlot(LOperand* context) { |
| 1459 | inputs_[0] = context; |
| 1460 | } |
| 1461 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1462 | LOperand* context() { return inputs_[0]; } |
| 1463 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1464 | DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") |
| 1465 | DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) |
| 1466 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1467 | int slot_index() { return hydrogen()->slot_index(); } |
| 1468 | |
| 1469 | virtual void PrintDataTo(StringStream* stream); |
| 1470 | }; |
| 1471 | |
| 1472 | |
| 1473 | class LStoreContextSlot: public LTemplateInstruction<0, 2, 0> { |
| 1474 | public: |
| 1475 | LStoreContextSlot(LOperand* context, LOperand* value) { |
| 1476 | inputs_[0] = context; |
| 1477 | inputs_[1] = value; |
| 1478 | } |
| 1479 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1480 | LOperand* context() { return inputs_[0]; } |
| 1481 | LOperand* value() { return inputs_[1]; } |
| 1482 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1483 | DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot") |
| 1484 | DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot) |
| 1485 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1486 | int slot_index() { return hydrogen()->slot_index(); } |
| 1487 | |
| 1488 | virtual void PrintDataTo(StringStream* stream); |
| 1489 | }; |
| 1490 | |
| 1491 | |
| 1492 | class LPushArgument: public LTemplateInstruction<0, 1, 0> { |
| 1493 | public: |
| 1494 | explicit LPushArgument(LOperand* value) { |
| 1495 | inputs_[0] = value; |
| 1496 | } |
| 1497 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1498 | LOperand* value() { return inputs_[0]; } |
| 1499 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1500 | DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") |
| 1501 | }; |
| 1502 | |
| 1503 | |
jkummerow@chromium.org | 28faa98 | 2012-04-13 09:58:30 +0000 | [diff] [blame] | 1504 | class LDrop: public LTemplateInstruction<0, 0, 0> { |
| 1505 | public: |
| 1506 | explicit LDrop(int count) : count_(count) { } |
| 1507 | |
| 1508 | int count() const { return count_; } |
| 1509 | |
| 1510 | DECLARE_CONCRETE_INSTRUCTION(Drop, "drop") |
| 1511 | |
| 1512 | private: |
| 1513 | int count_; |
| 1514 | }; |
| 1515 | |
| 1516 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1517 | class LThisFunction: public LTemplateInstruction<1, 0, 0> { |
| 1518 | public: |
| 1519 | DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function") |
| 1520 | DECLARE_HYDROGEN_ACCESSOR(ThisFunction) |
| 1521 | }; |
| 1522 | |
| 1523 | |
| 1524 | class LContext: public LTemplateInstruction<1, 0, 0> { |
| 1525 | public: |
| 1526 | DECLARE_CONCRETE_INSTRUCTION(Context, "context") |
| 1527 | }; |
| 1528 | |
| 1529 | |
| 1530 | class LOuterContext: public LTemplateInstruction<1, 1, 0> { |
| 1531 | public: |
| 1532 | explicit LOuterContext(LOperand* context) { |
| 1533 | inputs_[0] = context; |
| 1534 | } |
| 1535 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1536 | LOperand* context() { return inputs_[0]; } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1537 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1538 | DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context") |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1539 | }; |
| 1540 | |
| 1541 | |
jkummerow@chromium.org | f7a5884 | 2012-02-21 10:08:21 +0000 | [diff] [blame] | 1542 | class LDeclareGlobals: public LTemplateInstruction<0, 0, 0> { |
| 1543 | public: |
| 1544 | DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals") |
| 1545 | DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals) |
| 1546 | }; |
| 1547 | |
| 1548 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1549 | class LGlobalObject: public LTemplateInstruction<1, 1, 0> { |
| 1550 | public: |
| 1551 | explicit LGlobalObject(LOperand* context) { |
| 1552 | inputs_[0] = context; |
| 1553 | } |
| 1554 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1555 | LOperand* context() { return inputs_[0]; } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1556 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1557 | DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object") |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1558 | }; |
| 1559 | |
| 1560 | |
| 1561 | class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> { |
| 1562 | public: |
| 1563 | explicit LGlobalReceiver(LOperand* global_object) { |
| 1564 | inputs_[0] = global_object; |
| 1565 | } |
| 1566 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1567 | LOperand* global_object() { return inputs_[0]; } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1568 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1569 | DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver") |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1570 | }; |
| 1571 | |
| 1572 | |
| 1573 | class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> { |
| 1574 | public: |
| 1575 | DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function") |
| 1576 | DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction) |
| 1577 | |
| 1578 | virtual void PrintDataTo(StringStream* stream); |
| 1579 | |
| 1580 | Handle<JSFunction> function() { return hydrogen()->function(); } |
| 1581 | int arity() const { return hydrogen()->argument_count() - 1; } |
| 1582 | }; |
| 1583 | |
| 1584 | |
| 1585 | class LInvokeFunction: public LTemplateInstruction<1, 1, 0> { |
| 1586 | public: |
| 1587 | explicit LInvokeFunction(LOperand* function) { |
| 1588 | inputs_[0] = function; |
| 1589 | } |
| 1590 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1591 | LOperand* function() { return inputs_[0]; } |
| 1592 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1593 | DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function") |
| 1594 | DECLARE_HYDROGEN_ACCESSOR(InvokeFunction) |
| 1595 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1596 | virtual void PrintDataTo(StringStream* stream); |
| 1597 | |
| 1598 | int arity() const { return hydrogen()->argument_count() - 1; } |
svenpanne@chromium.org | fb04633 | 2012-04-19 12:02:44 +0000 | [diff] [blame] | 1599 | Handle<JSFunction> known_function() { return hydrogen()->known_function(); } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1600 | }; |
| 1601 | |
| 1602 | |
| 1603 | class LCallKeyed: public LTemplateInstruction<1, 1, 0> { |
| 1604 | public: |
| 1605 | explicit LCallKeyed(LOperand* key) { |
| 1606 | inputs_[0] = key; |
| 1607 | } |
| 1608 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1609 | LOperand* key() { return inputs_[0]; } |
| 1610 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1611 | DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed") |
| 1612 | DECLARE_HYDROGEN_ACCESSOR(CallKeyed) |
| 1613 | |
| 1614 | virtual void PrintDataTo(StringStream* stream); |
| 1615 | |
| 1616 | int arity() const { return hydrogen()->argument_count() - 1; } |
| 1617 | }; |
| 1618 | |
| 1619 | |
| 1620 | |
| 1621 | class LCallNamed: public LTemplateInstruction<1, 0, 0> { |
| 1622 | public: |
| 1623 | DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named") |
| 1624 | DECLARE_HYDROGEN_ACCESSOR(CallNamed) |
| 1625 | |
| 1626 | virtual void PrintDataTo(StringStream* stream); |
| 1627 | |
| 1628 | Handle<String> name() const { return hydrogen()->name(); } |
| 1629 | int arity() const { return hydrogen()->argument_count() - 1; } |
| 1630 | }; |
| 1631 | |
| 1632 | |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 1633 | class LCallFunction: public LTemplateInstruction<1, 1, 0> { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1634 | public: |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 1635 | explicit LCallFunction(LOperand* function) { |
| 1636 | inputs_[0] = function; |
| 1637 | } |
| 1638 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1639 | LOperand* function() { return inputs_[0]; } |
| 1640 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1641 | DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function") |
| 1642 | DECLARE_HYDROGEN_ACCESSOR(CallFunction) |
| 1643 | |
danno@chromium.org | c612e02 | 2011-11-10 11:38:15 +0000 | [diff] [blame] | 1644 | int arity() const { return hydrogen()->argument_count() - 1; } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1645 | }; |
| 1646 | |
| 1647 | |
| 1648 | class LCallGlobal: public LTemplateInstruction<1, 0, 0> { |
| 1649 | public: |
| 1650 | DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global") |
| 1651 | DECLARE_HYDROGEN_ACCESSOR(CallGlobal) |
| 1652 | |
| 1653 | virtual void PrintDataTo(StringStream* stream); |
| 1654 | |
| 1655 | Handle<String> name() const {return hydrogen()->name(); } |
| 1656 | int arity() const { return hydrogen()->argument_count() - 1; } |
| 1657 | }; |
| 1658 | |
| 1659 | |
| 1660 | class LCallKnownGlobal: public LTemplateInstruction<1, 0, 0> { |
| 1661 | public: |
| 1662 | DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global") |
| 1663 | DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal) |
| 1664 | |
| 1665 | virtual void PrintDataTo(StringStream* stream); |
| 1666 | |
| 1667 | Handle<JSFunction> target() const { return hydrogen()->target(); } |
| 1668 | int arity() const { return hydrogen()->argument_count() - 1; } |
| 1669 | }; |
| 1670 | |
| 1671 | |
| 1672 | class LCallNew: public LTemplateInstruction<1, 1, 0> { |
| 1673 | public: |
| 1674 | explicit LCallNew(LOperand* constructor) { |
| 1675 | inputs_[0] = constructor; |
| 1676 | } |
| 1677 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1678 | LOperand* constructor() { return inputs_[0]; } |
| 1679 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1680 | DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new") |
| 1681 | DECLARE_HYDROGEN_ACCESSOR(CallNew) |
| 1682 | |
| 1683 | virtual void PrintDataTo(StringStream* stream); |
| 1684 | |
| 1685 | int arity() const { return hydrogen()->argument_count() - 1; } |
| 1686 | }; |
| 1687 | |
| 1688 | |
| 1689 | class LCallRuntime: public LTemplateInstruction<1, 0, 0> { |
| 1690 | public: |
| 1691 | DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") |
| 1692 | DECLARE_HYDROGEN_ACCESSOR(CallRuntime) |
| 1693 | |
| 1694 | const Runtime::Function* function() const { return hydrogen()->function(); } |
| 1695 | int arity() const { return hydrogen()->argument_count(); } |
| 1696 | }; |
| 1697 | |
| 1698 | |
| 1699 | class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> { |
| 1700 | public: |
| 1701 | explicit LInteger32ToDouble(LOperand* value) { |
| 1702 | inputs_[0] = value; |
| 1703 | } |
| 1704 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1705 | LOperand* value() { return inputs_[0]; } |
| 1706 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1707 | DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") |
| 1708 | }; |
| 1709 | |
| 1710 | |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 1711 | class LUint32ToDouble: public LTemplateInstruction<1, 1, 0> { |
| 1712 | public: |
| 1713 | explicit LUint32ToDouble(LOperand* value) { |
| 1714 | inputs_[0] = value; |
| 1715 | } |
| 1716 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1717 | LOperand* value() { return inputs_[0]; } |
| 1718 | |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 1719 | DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") |
| 1720 | }; |
| 1721 | |
| 1722 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1723 | class LNumberTagI: public LTemplateInstruction<1, 1, 0> { |
| 1724 | public: |
| 1725 | explicit LNumberTagI(LOperand* value) { |
| 1726 | inputs_[0] = value; |
| 1727 | } |
| 1728 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1729 | LOperand* value() { return inputs_[0]; } |
| 1730 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1731 | DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") |
| 1732 | }; |
| 1733 | |
| 1734 | |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 1735 | class LNumberTagU: public LTemplateInstruction<1, 1, 0> { |
| 1736 | public: |
| 1737 | explicit LNumberTagU(LOperand* value) { |
| 1738 | inputs_[0] = value; |
| 1739 | } |
| 1740 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1741 | LOperand* value() { return inputs_[0]; } |
| 1742 | |
jkummerow@chromium.org | 78502a9 | 2012-09-06 13:50:42 +0000 | [diff] [blame] | 1743 | DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u") |
| 1744 | }; |
| 1745 | |
| 1746 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1747 | class LNumberTagD: public LTemplateInstruction<1, 1, 2> { |
| 1748 | public: |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1749 | LNumberTagD(LOperand* value, LOperand* temp, LOperand* temp2) { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1750 | inputs_[0] = value; |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1751 | temps_[0] = temp; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1752 | temps_[1] = temp2; |
| 1753 | } |
| 1754 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1755 | LOperand* value() { return inputs_[0]; } |
| 1756 | LOperand* temp() { return temps_[0]; } |
| 1757 | LOperand* temp2() { return temps_[1]; } |
| 1758 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1759 | DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") |
| 1760 | }; |
| 1761 | |
| 1762 | |
| 1763 | // Sometimes truncating conversion from a tagged value to an int32. |
| 1764 | class LDoubleToI: public LTemplateInstruction<1, 1, 2> { |
| 1765 | public: |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1766 | LDoubleToI(LOperand* value, LOperand* temp, LOperand* temp2) { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1767 | inputs_[0] = value; |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1768 | temps_[0] = temp; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1769 | temps_[1] = temp2; |
| 1770 | } |
| 1771 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1772 | LOperand* value() { return inputs_[0]; } |
| 1773 | LOperand* temp() { return temps_[0]; } |
| 1774 | LOperand* temp2() { return temps_[1]; } |
| 1775 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1776 | DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") |
| 1777 | DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) |
| 1778 | |
| 1779 | bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
| 1780 | }; |
| 1781 | |
| 1782 | |
| 1783 | // Truncating conversion from a tagged value to an int32. |
| 1784 | class LTaggedToI: public LTemplateInstruction<1, 1, 3> { |
| 1785 | public: |
| 1786 | LTaggedToI(LOperand* value, |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1787 | LOperand* temp, |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1788 | LOperand* temp2, |
| 1789 | LOperand* temp3) { |
| 1790 | inputs_[0] = value; |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1791 | temps_[0] = temp; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1792 | temps_[1] = temp2; |
| 1793 | temps_[2] = temp3; |
| 1794 | } |
| 1795 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1796 | LOperand* value() { return inputs_[0]; } |
| 1797 | LOperand* temp() { return temps_[0]; } |
| 1798 | LOperand* temp2() { return temps_[1]; } |
| 1799 | LOperand* temp3() { return temps_[2]; } |
| 1800 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1801 | DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") |
| 1802 | DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) |
| 1803 | |
| 1804 | bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
| 1805 | }; |
| 1806 | |
| 1807 | |
| 1808 | class LSmiTag: public LTemplateInstruction<1, 1, 0> { |
| 1809 | public: |
| 1810 | explicit LSmiTag(LOperand* value) { |
| 1811 | inputs_[0] = value; |
| 1812 | } |
| 1813 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1814 | LOperand* value() { return inputs_[0]; } |
| 1815 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1816 | DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") |
| 1817 | }; |
| 1818 | |
| 1819 | |
| 1820 | class LNumberUntagD: public LTemplateInstruction<1, 1, 0> { |
| 1821 | public: |
| 1822 | explicit LNumberUntagD(LOperand* value) { |
| 1823 | inputs_[0] = value; |
| 1824 | } |
| 1825 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1826 | LOperand* value() { return inputs_[0]; } |
| 1827 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1828 | DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") |
| 1829 | DECLARE_HYDROGEN_ACCESSOR(Change) |
| 1830 | }; |
| 1831 | |
| 1832 | |
| 1833 | class LSmiUntag: public LTemplateInstruction<1, 1, 0> { |
| 1834 | public: |
| 1835 | LSmiUntag(LOperand* value, bool needs_check) |
| 1836 | : needs_check_(needs_check) { |
| 1837 | inputs_[0] = value; |
| 1838 | } |
| 1839 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1840 | LOperand* value() { return inputs_[0]; } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1841 | bool needs_check() const { return needs_check_; } |
| 1842 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1843 | DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") |
| 1844 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1845 | private: |
| 1846 | bool needs_check_; |
| 1847 | }; |
| 1848 | |
| 1849 | |
verwaest@chromium.org | 3714139 | 2012-05-31 13:27:02 +0000 | [diff] [blame] | 1850 | class LStoreNamedField: public LTemplateInstruction<0, 2, 1> { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1851 | public: |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1852 | LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) { |
| 1853 | inputs_[0] = object; |
| 1854 | inputs_[1] = value; |
verwaest@chromium.org | 3714139 | 2012-05-31 13:27:02 +0000 | [diff] [blame] | 1855 | temps_[0] = temp; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1856 | } |
| 1857 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1858 | LOperand* object() { return inputs_[0]; } |
| 1859 | LOperand* value() { return inputs_[1]; } |
| 1860 | LOperand* temp() { return temps_[0]; } |
| 1861 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1862 | DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") |
| 1863 | DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) |
| 1864 | |
| 1865 | virtual void PrintDataTo(StringStream* stream); |
| 1866 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1867 | Handle<Object> name() const { return hydrogen()->name(); } |
| 1868 | bool is_in_object() { return hydrogen()->is_in_object(); } |
| 1869 | int offset() { return hydrogen()->offset(); } |
| 1870 | Handle<Map> transition() const { return hydrogen()->transition(); } |
| 1871 | }; |
| 1872 | |
| 1873 | |
| 1874 | class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> { |
| 1875 | public: |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1876 | LStoreNamedGeneric(LOperand* object, LOperand* value) { |
| 1877 | inputs_[0] = object; |
| 1878 | inputs_[1] = value; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1879 | } |
| 1880 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1881 | LOperand* object() { return inputs_[0]; } |
| 1882 | LOperand* value() { return inputs_[1]; } |
| 1883 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1884 | DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") |
| 1885 | DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) |
| 1886 | |
| 1887 | virtual void PrintDataTo(StringStream* stream); |
| 1888 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1889 | Handle<Object> name() const { return hydrogen()->name(); } |
| 1890 | StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1891 | }; |
| 1892 | |
| 1893 | |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 1894 | class LStoreKeyed: public LTemplateInstruction<0, 3, 0> { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1895 | public: |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 1896 | LStoreKeyed(LOperand* object, LOperand* key, LOperand* value) { |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1897 | inputs_[0] = object; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1898 | inputs_[1] = key; |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1899 | inputs_[2] = value; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1900 | } |
| 1901 | |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 1902 | bool is_external() const { return hydrogen()->is_external(); } |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1903 | LOperand* elements() { return inputs_[0]; } |
| 1904 | LOperand* key() { return inputs_[1]; } |
| 1905 | LOperand* value() { return inputs_[2]; } |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 1906 | ElementsKind elements_kind() const { |
| 1907 | return hydrogen()->elements_kind(); |
| 1908 | } |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1909 | |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 1910 | DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") |
| 1911 | DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1912 | |
| 1913 | virtual void PrintDataTo(StringStream* stream); |
svenpanne@chromium.org | fb04633 | 2012-04-19 12:02:44 +0000 | [diff] [blame] | 1914 | bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } |
mvstanton@chromium.org | e4ac3ef | 2012-11-12 14:53:34 +0000 | [diff] [blame] | 1915 | uint32_t additional_index() const { return hydrogen()->index_offset(); } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1916 | }; |
| 1917 | |
| 1918 | |
| 1919 | class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> { |
| 1920 | public: |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1921 | LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* value) { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1922 | inputs_[0] = obj; |
| 1923 | inputs_[1] = key; |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1924 | inputs_[2] = value; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1925 | } |
| 1926 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1927 | LOperand* object() { return inputs_[0]; } |
| 1928 | LOperand* key() { return inputs_[1]; } |
| 1929 | LOperand* value() { return inputs_[2]; } |
| 1930 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1931 | DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") |
| 1932 | DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) |
| 1933 | |
| 1934 | virtual void PrintDataTo(StringStream* stream); |
| 1935 | |
mstarzinger@chromium.org | 1b3afd1 | 2011-11-29 14:28:56 +0000 | [diff] [blame] | 1936 | StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1937 | }; |
| 1938 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1939 | |
| 1940 | class LTransitionElementsKind: public LTemplateInstruction<1, 1, 2> { |
| 1941 | public: |
| 1942 | LTransitionElementsKind(LOperand* object, |
| 1943 | LOperand* new_map_temp, |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1944 | LOperand* temp) { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1945 | inputs_[0] = object; |
| 1946 | temps_[0] = new_map_temp; |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1947 | temps_[1] = temp; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1948 | } |
| 1949 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1950 | LOperand* object() { return inputs_[0]; } |
| 1951 | LOperand* new_map_temp() { return temps_[0]; } |
| 1952 | LOperand* temp() { return temps_[1]; } |
| 1953 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1954 | DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, |
| 1955 | "transition-elements-kind") |
| 1956 | DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) |
| 1957 | |
| 1958 | virtual void PrintDataTo(StringStream* stream); |
| 1959 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1960 | Handle<Map> original_map() { return hydrogen()->original_map(); } |
| 1961 | Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); } |
| 1962 | }; |
| 1963 | |
| 1964 | |
| 1965 | class LStringAdd: public LTemplateInstruction<1, 2, 0> { |
| 1966 | public: |
| 1967 | LStringAdd(LOperand* left, LOperand* right) { |
| 1968 | inputs_[0] = left; |
| 1969 | inputs_[1] = right; |
| 1970 | } |
| 1971 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1972 | LOperand* left() { return inputs_[0]; } |
| 1973 | LOperand* right() { return inputs_[1]; } |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1974 | |
| 1975 | DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add") |
| 1976 | DECLARE_HYDROGEN_ACCESSOR(StringAdd) |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1977 | }; |
| 1978 | |
| 1979 | |
| 1980 | |
| 1981 | class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> { |
| 1982 | public: |
| 1983 | LStringCharCodeAt(LOperand* string, LOperand* index) { |
| 1984 | inputs_[0] = string; |
| 1985 | inputs_[1] = index; |
| 1986 | } |
| 1987 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1988 | LOperand* string() { return inputs_[0]; } |
| 1989 | LOperand* index() { return inputs_[1]; } |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 1990 | |
| 1991 | DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at") |
| 1992 | DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt) |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 1993 | }; |
| 1994 | |
| 1995 | |
| 1996 | class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> { |
| 1997 | public: |
| 1998 | explicit LStringCharFromCode(LOperand* char_code) { |
| 1999 | inputs_[0] = char_code; |
| 2000 | } |
| 2001 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2002 | LOperand* char_code() { return inputs_[0]; } |
| 2003 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2004 | DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") |
| 2005 | DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2006 | }; |
| 2007 | |
| 2008 | |
| 2009 | class LStringLength: public LTemplateInstruction<1, 1, 0> { |
| 2010 | public: |
| 2011 | explicit LStringLength(LOperand* string) { |
| 2012 | inputs_[0] = string; |
| 2013 | } |
| 2014 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2015 | LOperand* string() { return inputs_[0]; } |
| 2016 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2017 | DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length") |
| 2018 | DECLARE_HYDROGEN_ACCESSOR(StringLength) |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2019 | }; |
| 2020 | |
| 2021 | |
| 2022 | class LCheckFunction: public LTemplateInstruction<0, 1, 0> { |
| 2023 | public: |
| 2024 | explicit LCheckFunction(LOperand* value) { |
| 2025 | inputs_[0] = value; |
| 2026 | } |
| 2027 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2028 | LOperand* value() { return inputs_[0]; } |
ricow@chromium.org | 64e3a4b | 2011-12-13 08:07:27 +0000 | [diff] [blame] | 2029 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2030 | DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") |
| 2031 | DECLARE_HYDROGEN_ACCESSOR(CheckFunction) |
| 2032 | }; |
| 2033 | |
| 2034 | |
| 2035 | class LCheckInstanceType: public LTemplateInstruction<0, 1, 0> { |
| 2036 | public: |
| 2037 | explicit LCheckInstanceType(LOperand* value) { |
| 2038 | inputs_[0] = value; |
| 2039 | } |
| 2040 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2041 | LOperand* value() { return inputs_[0]; } |
| 2042 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2043 | DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") |
| 2044 | DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) |
| 2045 | }; |
| 2046 | |
| 2047 | |
jkummerow@chromium.org | 1456e70 | 2012-03-30 08:38:13 +0000 | [diff] [blame] | 2048 | class LCheckMaps: public LTemplateInstruction<0, 1, 0> { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2049 | public: |
jkummerow@chromium.org | 1456e70 | 2012-03-30 08:38:13 +0000 | [diff] [blame] | 2050 | explicit LCheckMaps(LOperand* value) { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2051 | inputs_[0] = value; |
| 2052 | } |
| 2053 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2054 | LOperand* value() { return inputs_[0]; } |
| 2055 | |
jkummerow@chromium.org | 1456e70 | 2012-03-30 08:38:13 +0000 | [diff] [blame] | 2056 | DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps") |
| 2057 | DECLARE_HYDROGEN_ACCESSOR(CheckMaps) |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2058 | }; |
| 2059 | |
| 2060 | |
verwaest@chromium.org | e4ee6de | 2012-11-06 12:13:00 +0000 | [diff] [blame] | 2061 | class LCheckPrototypeMaps: public LTemplateInstruction<1, 0, 2> { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2062 | public: |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2063 | LCheckPrototypeMaps(LOperand* temp, LOperand* temp2) { |
| 2064 | temps_[0] = temp; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2065 | temps_[1] = temp2; |
| 2066 | } |
| 2067 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2068 | LOperand* temp() { return temps_[0]; } |
| 2069 | LOperand* temp2() { return temps_[1]; } |
| 2070 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2071 | DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps") |
| 2072 | DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps) |
| 2073 | |
| 2074 | Handle<JSObject> prototype() const { return hydrogen()->prototype(); } |
| 2075 | Handle<JSObject> holder() const { return hydrogen()->holder(); } |
| 2076 | }; |
| 2077 | |
| 2078 | |
| 2079 | class LCheckSmi: public LTemplateInstruction<0, 1, 0> { |
| 2080 | public: |
| 2081 | explicit LCheckSmi(LOperand* value) { |
| 2082 | inputs_[0] = value; |
| 2083 | } |
| 2084 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2085 | LOperand* value() { return inputs_[0]; } |
| 2086 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2087 | DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi") |
| 2088 | }; |
| 2089 | |
| 2090 | |
| 2091 | class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> { |
| 2092 | public: |
| 2093 | explicit LCheckNonSmi(LOperand* value) { |
| 2094 | inputs_[0] = value; |
| 2095 | } |
| 2096 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2097 | LOperand* value() { return inputs_[0]; } |
| 2098 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2099 | DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") |
| 2100 | }; |
| 2101 | |
| 2102 | |
| 2103 | class LClampDToUint8: public LTemplateInstruction<1, 1, 1> { |
| 2104 | public: |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2105 | LClampDToUint8(LOperand* unclamped, LOperand* temp) { |
| 2106 | inputs_[0] = unclamped; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2107 | temps_[0] = temp; |
| 2108 | } |
| 2109 | |
| 2110 | LOperand* unclamped() { return inputs_[0]; } |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2111 | LOperand* temp() { return temps_[0]; } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2112 | |
| 2113 | DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8") |
| 2114 | }; |
| 2115 | |
| 2116 | |
| 2117 | class LClampIToUint8: public LTemplateInstruction<1, 1, 0> { |
| 2118 | public: |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2119 | explicit LClampIToUint8(LOperand* unclamped) { |
| 2120 | inputs_[0] = unclamped; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2121 | } |
| 2122 | |
| 2123 | LOperand* unclamped() { return inputs_[0]; } |
| 2124 | |
| 2125 | DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8") |
| 2126 | }; |
| 2127 | |
| 2128 | |
| 2129 | class LClampTToUint8: public LTemplateInstruction<1, 1, 1> { |
| 2130 | public: |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2131 | LClampTToUint8(LOperand* unclamped, LOperand* temp) { |
| 2132 | inputs_[0] = unclamped; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2133 | temps_[0] = temp; |
| 2134 | } |
| 2135 | |
| 2136 | LOperand* unclamped() { return inputs_[0]; } |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2137 | LOperand* temp() { return temps_[0]; } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2138 | |
| 2139 | DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") |
| 2140 | }; |
| 2141 | |
| 2142 | |
fschneider@chromium.org | 35814e5 | 2012-03-01 15:43:35 +0000 | [diff] [blame] | 2143 | class LAllocateObject: public LTemplateInstruction<1, 0, 2> { |
ulan@chromium.org | 967e270 | 2012-02-28 09:49:15 +0000 | [diff] [blame] | 2144 | public: |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2145 | LAllocateObject(LOperand* temp, LOperand* temp2) { |
| 2146 | temps_[0] = temp; |
fschneider@chromium.org | 35814e5 | 2012-03-01 15:43:35 +0000 | [diff] [blame] | 2147 | temps_[1] = temp2; |
| 2148 | } |
| 2149 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2150 | LOperand* temp() { return temps_[0]; } |
| 2151 | LOperand* temp2() { return temps_[1]; } |
| 2152 | |
ulan@chromium.org | 967e270 | 2012-02-28 09:49:15 +0000 | [diff] [blame] | 2153 | DECLARE_CONCRETE_INSTRUCTION(AllocateObject, "allocate-object") |
| 2154 | DECLARE_HYDROGEN_ACCESSOR(AllocateObject) |
| 2155 | }; |
| 2156 | |
| 2157 | |
jkummerow@chromium.org | f7a5884 | 2012-02-21 10:08:21 +0000 | [diff] [blame] | 2158 | class LFastLiteral: public LTemplateInstruction<1, 0, 0> { |
| 2159 | public: |
| 2160 | DECLARE_CONCRETE_INSTRUCTION(FastLiteral, "fast-literal") |
| 2161 | DECLARE_HYDROGEN_ACCESSOR(FastLiteral) |
| 2162 | }; |
| 2163 | |
| 2164 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2165 | class LArrayLiteral: public LTemplateInstruction<1, 0, 0> { |
| 2166 | public: |
| 2167 | DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array-literal") |
| 2168 | DECLARE_HYDROGEN_ACCESSOR(ArrayLiteral) |
| 2169 | }; |
| 2170 | |
| 2171 | |
jkummerow@chromium.org | f7a5884 | 2012-02-21 10:08:21 +0000 | [diff] [blame] | 2172 | class LObjectLiteral: public LTemplateInstruction<1, 0, 0> { |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2173 | public: |
jkummerow@chromium.org | f7a5884 | 2012-02-21 10:08:21 +0000 | [diff] [blame] | 2174 | DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal") |
| 2175 | DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral) |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2176 | }; |
| 2177 | |
| 2178 | |
| 2179 | class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> { |
| 2180 | public: |
| 2181 | DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal") |
| 2182 | DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral) |
| 2183 | }; |
| 2184 | |
| 2185 | |
| 2186 | class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> { |
| 2187 | public: |
| 2188 | DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") |
| 2189 | DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) |
| 2190 | |
| 2191 | Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); } |
| 2192 | }; |
| 2193 | |
| 2194 | |
| 2195 | class LToFastProperties: public LTemplateInstruction<1, 1, 0> { |
| 2196 | public: |
| 2197 | explicit LToFastProperties(LOperand* value) { |
| 2198 | inputs_[0] = value; |
| 2199 | } |
| 2200 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2201 | LOperand* value() { return inputs_[0]; } |
| 2202 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2203 | DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties") |
| 2204 | DECLARE_HYDROGEN_ACCESSOR(ToFastProperties) |
| 2205 | }; |
| 2206 | |
| 2207 | |
| 2208 | class LTypeof: public LTemplateInstruction<1, 1, 0> { |
| 2209 | public: |
| 2210 | explicit LTypeof(LOperand* value) { |
| 2211 | inputs_[0] = value; |
| 2212 | } |
| 2213 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2214 | LOperand* value() { return inputs_[0]; } |
| 2215 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2216 | DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") |
| 2217 | }; |
| 2218 | |
| 2219 | |
| 2220 | class LTypeofIsAndBranch: public LControlInstruction<1, 0> { |
| 2221 | public: |
| 2222 | explicit LTypeofIsAndBranch(LOperand* value) { |
| 2223 | inputs_[0] = value; |
| 2224 | } |
| 2225 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2226 | LOperand* value() { return inputs_[0]; } |
| 2227 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2228 | DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") |
| 2229 | DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) |
| 2230 | |
| 2231 | Handle<String> type_literal() { return hydrogen()->type_literal(); } |
| 2232 | |
| 2233 | virtual void PrintDataTo(StringStream* stream); |
| 2234 | }; |
| 2235 | |
| 2236 | |
| 2237 | class LIsConstructCallAndBranch: public LControlInstruction<0, 1> { |
| 2238 | public: |
| 2239 | explicit LIsConstructCallAndBranch(LOperand* temp) { |
| 2240 | temps_[0] = temp; |
| 2241 | } |
| 2242 | |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2243 | LOperand* temp() { return temps_[0]; } |
| 2244 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2245 | DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch, |
| 2246 | "is-construct-call-and-branch") |
| 2247 | }; |
| 2248 | |
| 2249 | |
| 2250 | class LDeleteProperty: public LTemplateInstruction<1, 2, 0> { |
| 2251 | public: |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2252 | LDeleteProperty(LOperand* object, LOperand* key) { |
| 2253 | inputs_[0] = object; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2254 | inputs_[1] = key; |
| 2255 | } |
| 2256 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2257 | LOperand* object() { return inputs_[0]; } |
| 2258 | LOperand* key() { return inputs_[1]; } |
svenpanne@chromium.org | c859c4f | 2012-10-15 11:51:39 +0000 | [diff] [blame] | 2259 | |
| 2260 | DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2261 | }; |
| 2262 | |
| 2263 | |
| 2264 | class LOsrEntry: public LTemplateInstruction<0, 0, 0> { |
| 2265 | public: |
| 2266 | LOsrEntry(); |
| 2267 | |
| 2268 | DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") |
| 2269 | |
| 2270 | LOperand** SpilledRegisterArray() { return register_spills_; } |
| 2271 | LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } |
| 2272 | |
| 2273 | void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); |
| 2274 | void MarkSpilledDoubleRegister(int allocation_index, |
| 2275 | LOperand* spill_operand); |
| 2276 | |
| 2277 | private: |
| 2278 | // Arrays of spill slot operands for registers with an assigned spill |
| 2279 | // slot, i.e., that must also be restored to the spill slot on OSR entry. |
| 2280 | // NULL if the register has no assigned spill slot. Indexed by allocation |
| 2281 | // index. |
| 2282 | LOperand* register_spills_[Register::kNumAllocatableRegisters]; |
| 2283 | LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters]; |
| 2284 | }; |
| 2285 | |
| 2286 | |
| 2287 | class LStackCheck: public LTemplateInstruction<0, 0, 0> { |
| 2288 | public: |
| 2289 | DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") |
| 2290 | DECLARE_HYDROGEN_ACCESSOR(StackCheck) |
| 2291 | |
| 2292 | Label* done_label() { return &done_label_; } |
| 2293 | |
| 2294 | private: |
| 2295 | Label done_label_; |
| 2296 | }; |
| 2297 | |
| 2298 | |
| 2299 | class LIn: public LTemplateInstruction<1, 2, 0> { |
| 2300 | public: |
| 2301 | LIn(LOperand* key, LOperand* object) { |
| 2302 | inputs_[0] = key; |
| 2303 | inputs_[1] = object; |
| 2304 | } |
| 2305 | |
| 2306 | LOperand* key() { return inputs_[0]; } |
| 2307 | LOperand* object() { return inputs_[1]; } |
| 2308 | |
| 2309 | DECLARE_CONCRETE_INSTRUCTION(In, "in") |
| 2310 | }; |
| 2311 | |
| 2312 | |
ulan@chromium.org | 812308e | 2012-02-29 15:58:45 +0000 | [diff] [blame] | 2313 | class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> { |
| 2314 | public: |
| 2315 | explicit LForInPrepareMap(LOperand* object) { |
| 2316 | inputs_[0] = object; |
| 2317 | } |
| 2318 | |
| 2319 | LOperand* object() { return inputs_[0]; } |
| 2320 | |
| 2321 | DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map") |
| 2322 | }; |
| 2323 | |
| 2324 | |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 2325 | class LForInCacheArray: public LTemplateInstruction<1, 1, 0> { |
ulan@chromium.org | 812308e | 2012-02-29 15:58:45 +0000 | [diff] [blame] | 2326 | public: |
rossberg@chromium.org | 89e18f5 | 2012-10-22 13:09:53 +0000 | [diff] [blame] | 2327 | explicit LForInCacheArray(LOperand* map) { |
ulan@chromium.org | 812308e | 2012-02-29 15:58:45 +0000 | [diff] [blame] | 2328 | inputs_[0] = map; |
| 2329 | } |
| 2330 | |
| 2331 | LOperand* map() { return inputs_[0]; } |
| 2332 | |
| 2333 | DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") |
| 2334 | |
| 2335 | int idx() { |
| 2336 | return HForInCacheArray::cast(this->hydrogen_value())->idx(); |
| 2337 | } |
| 2338 | }; |
| 2339 | |
| 2340 | |
| 2341 | class LCheckMapValue: public LTemplateInstruction<0, 2, 0> { |
| 2342 | public: |
| 2343 | LCheckMapValue(LOperand* value, LOperand* map) { |
| 2344 | inputs_[0] = value; |
| 2345 | inputs_[1] = map; |
| 2346 | } |
| 2347 | |
| 2348 | LOperand* value() { return inputs_[0]; } |
| 2349 | LOperand* map() { return inputs_[1]; } |
| 2350 | |
| 2351 | DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value") |
| 2352 | }; |
| 2353 | |
| 2354 | |
| 2355 | class LLoadFieldByIndex: public LTemplateInstruction<1, 2, 0> { |
| 2356 | public: |
| 2357 | LLoadFieldByIndex(LOperand* object, LOperand* index) { |
| 2358 | inputs_[0] = object; |
| 2359 | inputs_[1] = index; |
| 2360 | } |
| 2361 | |
| 2362 | LOperand* object() { return inputs_[0]; } |
| 2363 | LOperand* index() { return inputs_[1]; } |
| 2364 | |
| 2365 | DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") |
| 2366 | }; |
| 2367 | |
| 2368 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2369 | class LChunkBuilder; |
jkummerow@chromium.org | 28583c9 | 2012-07-16 11:31:55 +0000 | [diff] [blame] | 2370 | class LPlatformChunk: public LChunk { |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 2371 | public: |
jkummerow@chromium.org | 28583c9 | 2012-07-16 11:31:55 +0000 | [diff] [blame] | 2372 | LPlatformChunk(CompilationInfo* info, HGraph* graph) |
| 2373 | : LChunk(info, graph) { } |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 2374 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2375 | int GetNextSpillIndex(bool is_double); |
| 2376 | LOperand* GetNextSpillSlot(bool is_double); |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 2377 | }; |
| 2378 | |
| 2379 | |
| 2380 | class LChunkBuilder BASE_EMBEDDED { |
| 2381 | public: |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2382 | LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
| 2383 | : chunk_(NULL), |
| 2384 | info_(info), |
| 2385 | graph_(graph), |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 2386 | zone_(graph->zone()), |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2387 | status_(UNUSED), |
| 2388 | current_instruction_(NULL), |
| 2389 | current_block_(NULL), |
| 2390 | next_block_(NULL), |
| 2391 | argument_count_(0), |
| 2392 | allocator_(allocator), |
| 2393 | position_(RelocInfo::kNoPosition), |
| 2394 | instruction_pending_deoptimization_environment_(NULL), |
mstarzinger@chromium.org | 471f2f1 | 2012-08-10 14:46:33 +0000 | [diff] [blame] | 2395 | pending_deoptimization_ast_id_(BailoutId::None()) { } |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 2396 | |
| 2397 | // Build the sequence for the graph. |
jkummerow@chromium.org | 28583c9 | 2012-07-16 11:31:55 +0000 | [diff] [blame] | 2398 | LPlatformChunk* Build(); |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 2399 | |
| 2400 | // Declare methods that deal with the individual node types. |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2401 | #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 2402 | HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
| 2403 | #undef DECLARE_DO |
| 2404 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2405 | private: |
| 2406 | enum Status { |
| 2407 | UNUSED, |
| 2408 | BUILDING, |
| 2409 | DONE, |
| 2410 | ABORTED |
| 2411 | }; |
| 2412 | |
jkummerow@chromium.org | 28583c9 | 2012-07-16 11:31:55 +0000 | [diff] [blame] | 2413 | LPlatformChunk* chunk() const { return chunk_; } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2414 | CompilationInfo* info() const { return info_; } |
| 2415 | HGraph* graph() const { return graph_; } |
ulan@chromium.org | 812308e | 2012-02-29 15:58:45 +0000 | [diff] [blame] | 2416 | Zone* zone() const { return zone_; } |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2417 | |
| 2418 | bool is_unused() const { return status_ == UNUSED; } |
| 2419 | bool is_building() const { return status_ == BUILDING; } |
| 2420 | bool is_done() const { return status_ == DONE; } |
| 2421 | bool is_aborted() const { return status_ == ABORTED; } |
| 2422 | |
yangguo@chromium.org | 46839fb | 2012-08-28 09:06:19 +0000 | [diff] [blame] | 2423 | void Abort(const char* reason); |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2424 | |
| 2425 | // Methods for getting operands for Use / Define / Temp. |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2426 | LUnallocated* ToUnallocated(Register reg); |
| 2427 | LUnallocated* ToUnallocated(DoubleRegister reg); |
| 2428 | |
| 2429 | // Methods for setting up define-use relationships. |
| 2430 | MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); |
| 2431 | MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); |
| 2432 | MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, |
| 2433 | DoubleRegister fixed_register); |
| 2434 | |
| 2435 | // A value that is guaranteed to be allocated to a register. |
| 2436 | // Operand created by UseRegister is guaranteed to be live until the end of |
| 2437 | // instruction. This means that register allocator will not reuse it's |
| 2438 | // register for any other operand inside instruction. |
| 2439 | // Operand created by UseRegisterAtStart is guaranteed to be live only at |
| 2440 | // instruction start. Register allocator is free to assign the same register |
| 2441 | // to some other operand used inside instruction (i.e. temporary or |
| 2442 | // output). |
| 2443 | MUST_USE_RESULT LOperand* UseRegister(HValue* value); |
| 2444 | MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value); |
| 2445 | |
| 2446 | // An input operand in a register that may be trashed. |
| 2447 | MUST_USE_RESULT LOperand* UseTempRegister(HValue* value); |
| 2448 | |
| 2449 | // An input operand in a register or stack slot. |
| 2450 | MUST_USE_RESULT LOperand* Use(HValue* value); |
| 2451 | MUST_USE_RESULT LOperand* UseAtStart(HValue* value); |
| 2452 | |
| 2453 | // An input operand in a register, stack slot or a constant operand. |
| 2454 | MUST_USE_RESULT LOperand* UseOrConstant(HValue* value); |
| 2455 | MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value); |
| 2456 | |
| 2457 | // An input operand in a register or a constant operand. |
| 2458 | MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value); |
| 2459 | MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value); |
| 2460 | |
| 2461 | // An input operand in register, stack slot or a constant operand. |
| 2462 | // Will not be moved to a register even if one is freely available. |
| 2463 | MUST_USE_RESULT LOperand* UseAny(HValue* value); |
| 2464 | |
| 2465 | // Temporary operand that must be in a register. |
| 2466 | MUST_USE_RESULT LUnallocated* TempRegister(); |
| 2467 | MUST_USE_RESULT LOperand* FixedTemp(Register reg); |
| 2468 | MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg); |
| 2469 | |
| 2470 | // Methods for setting up define-use relationships. |
| 2471 | // Return the same instruction that they are passed. |
| 2472 | template<int I, int T> |
| 2473 | LInstruction* Define(LTemplateInstruction<1, I, T>* instr, |
| 2474 | LUnallocated* result); |
| 2475 | template<int I, int T> |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2476 | LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr); |
| 2477 | template<int I, int T> |
| 2478 | LInstruction* DefineAsSpilled(LTemplateInstruction<1, I, T>* instr, |
| 2479 | int index); |
| 2480 | template<int I, int T> |
| 2481 | LInstruction* DefineSameAsFirst(LTemplateInstruction<1, I, T>* instr); |
| 2482 | template<int I, int T> |
| 2483 | LInstruction* DefineFixed(LTemplateInstruction<1, I, T>* instr, |
| 2484 | Register reg); |
| 2485 | template<int I, int T> |
| 2486 | LInstruction* DefineFixedDouble(LTemplateInstruction<1, I, T>* instr, |
| 2487 | DoubleRegister reg); |
| 2488 | LInstruction* AssignEnvironment(LInstruction* instr); |
| 2489 | LInstruction* AssignPointerMap(LInstruction* instr); |
| 2490 | |
| 2491 | enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; |
| 2492 | |
| 2493 | // By default we assume that instruction sequences generated for calls |
| 2494 | // cannot deoptimize eagerly and we do not attach environment to this |
| 2495 | // instruction. |
| 2496 | LInstruction* MarkAsCall( |
| 2497 | LInstruction* instr, |
| 2498 | HInstruction* hinstr, |
| 2499 | CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2500 | |
| 2501 | LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env, |
| 2502 | int* argument_index_accumulator); |
| 2503 | |
| 2504 | void VisitInstruction(HInstruction* current); |
| 2505 | |
| 2506 | void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
| 2507 | LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); |
| 2508 | LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
| 2509 | LInstruction* DoArithmeticD(Token::Value op, |
| 2510 | HArithmeticBinaryOperation* instr); |
| 2511 | LInstruction* DoArithmeticT(Token::Value op, |
| 2512 | HArithmeticBinaryOperation* instr); |
| 2513 | |
jkummerow@chromium.org | 28583c9 | 2012-07-16 11:31:55 +0000 | [diff] [blame] | 2514 | LPlatformChunk* chunk_; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2515 | CompilationInfo* info_; |
| 2516 | HGraph* const graph_; |
ulan@chromium.org | 812308e | 2012-02-29 15:58:45 +0000 | [diff] [blame] | 2517 | Zone* zone_; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2518 | Status status_; |
| 2519 | HInstruction* current_instruction_; |
| 2520 | HBasicBlock* current_block_; |
| 2521 | HBasicBlock* next_block_; |
| 2522 | int argument_count_; |
| 2523 | LAllocator* allocator_; |
| 2524 | int position_; |
| 2525 | LInstruction* instruction_pending_deoptimization_environment_; |
mstarzinger@chromium.org | 471f2f1 | 2012-08-10 14:46:33 +0000 | [diff] [blame] | 2526 | BailoutId pending_deoptimization_ast_id_; |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2527 | |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 2528 | DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2529 | }; |
| 2530 | |
jkummerow@chromium.org | c3b3712 | 2011-11-07 10:14:12 +0000 | [diff] [blame] | 2531 | #undef DECLARE_HYDROGEN_ACCESSOR |
| 2532 | #undef DECLARE_CONCRETE_INSTRUCTION |
lrn@chromium.org | 7516f05 | 2011-03-30 08:52:27 +0000 | [diff] [blame] | 2533 | |
| 2534 | } } // namespace v8::internal |
| 2535 | |
| 2536 | #endif // V8_MIPS_LITHIUM_MIPS_H_ |