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