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