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