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