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