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