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