| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 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_X64_LITHIUM_X64_H_ | 28 #ifndef V8_X64_LITHIUM_X64_H_ |
| 29 #define V8_X64_LITHIUM_X64_H_ | 29 #define V8_X64_LITHIUM_X64_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 | 36 |
| 36 namespace v8 { | 37 namespace v8 { |
| 37 namespace internal { | 38 namespace internal { |
| 38 | 39 |
| 39 // Forward declarations. | 40 // Forward declarations. |
| 40 class LCodeGen; | 41 class LCodeGen; |
| 41 | 42 |
| 42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ | 43 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ |
| 43 V(ControlInstruction) \ | 44 V(ControlInstruction) \ |
| 44 V(Call) \ | 45 V(Call) \ |
| (...skipping 24 matching lines...) Expand all Loading... |
| 69 V(CallStub) \ | 70 V(CallStub) \ |
| 70 V(CheckFunction) \ | 71 V(CheckFunction) \ |
| 71 V(CheckInstanceType) \ | 72 V(CheckInstanceType) \ |
| 72 V(CheckMap) \ | 73 V(CheckMap) \ |
| 73 V(CheckNonSmi) \ | 74 V(CheckNonSmi) \ |
| 74 V(CheckPrototypeMaps) \ | 75 V(CheckPrototypeMaps) \ |
| 75 V(CheckSmi) \ | 76 V(CheckSmi) \ |
| 76 V(ClampDToUint8) \ | 77 V(ClampDToUint8) \ |
| 77 V(ClampIToUint8) \ | 78 V(ClampIToUint8) \ |
| 78 V(ClampTToUint8) \ | 79 V(ClampTToUint8) \ |
| 79 V(ClassOfTest) \ | |
| 80 V(ClassOfTestAndBranch) \ | 80 V(ClassOfTestAndBranch) \ |
| 81 V(CmpID) \ | 81 V(CmpConstantEqAndBranch) \ |
| 82 V(CmpIDAndBranch) \ | 82 V(CmpIDAndBranch) \ |
| 83 V(CmpJSObjectEq) \ | 83 V(CmpObjectEqAndBranch) \ |
| 84 V(CmpJSObjectEqAndBranch) \ | |
| 85 V(CmpMapAndBranch) \ | 84 V(CmpMapAndBranch) \ |
| 86 V(CmpSymbolEq) \ | |
| 87 V(CmpSymbolEqAndBranch) \ | |
| 88 V(CmpT) \ | 85 V(CmpT) \ |
| 89 V(CmpTAndBranch) \ | |
| 90 V(ConstantD) \ | 86 V(ConstantD) \ |
| 91 V(ConstantI) \ | 87 V(ConstantI) \ |
| 92 V(ConstantT) \ | 88 V(ConstantT) \ |
| 93 V(Context) \ | 89 V(Context) \ |
| 94 V(DeleteProperty) \ | 90 V(DeleteProperty) \ |
| 95 V(Deoptimize) \ | 91 V(Deoptimize) \ |
| 96 V(DivI) \ | 92 V(DivI) \ |
| 97 V(DoubleToI) \ | 93 V(DoubleToI) \ |
| 94 V(ElementsKind) \ |
| 98 V(ExternalArrayLength) \ | 95 V(ExternalArrayLength) \ |
| 99 V(FixedArrayLength) \ | 96 V(FixedArrayLength) \ |
| 100 V(FunctionLiteral) \ | 97 V(FunctionLiteral) \ |
| 101 V(GetCachedArrayIndex) \ | 98 V(GetCachedArrayIndex) \ |
| 102 V(GlobalObject) \ | 99 V(GlobalObject) \ |
| 103 V(GlobalReceiver) \ | 100 V(GlobalReceiver) \ |
| 104 V(Goto) \ | 101 V(Goto) \ |
| 105 V(HasCachedArrayIndex) \ | |
| 106 V(HasCachedArrayIndexAndBranch) \ | 102 V(HasCachedArrayIndexAndBranch) \ |
| 107 V(HasInstanceType) \ | |
| 108 V(HasInstanceTypeAndBranch) \ | 103 V(HasInstanceTypeAndBranch) \ |
| 109 V(In) \ | 104 V(In) \ |
| 110 V(InstanceOf) \ | 105 V(InstanceOf) \ |
| 111 V(InstanceOfAndBranch) \ | |
| 112 V(InstanceOfKnownGlobal) \ | 106 V(InstanceOfKnownGlobal) \ |
| 113 V(InstructionGap) \ | 107 V(InstructionGap) \ |
| 114 V(Integer32ToDouble) \ | 108 V(Integer32ToDouble) \ |
| 115 V(InvokeFunction) \ | 109 V(InvokeFunction) \ |
| 116 V(IsConstructCall) \ | |
| 117 V(IsConstructCallAndBranch) \ | 110 V(IsConstructCallAndBranch) \ |
| 118 V(IsNull) \ | |
| 119 V(IsNullAndBranch) \ | 111 V(IsNullAndBranch) \ |
| 120 V(IsObject) \ | |
| 121 V(IsObjectAndBranch) \ | 112 V(IsObjectAndBranch) \ |
| 122 V(IsSmi) \ | |
| 123 V(IsSmiAndBranch) \ | 113 V(IsSmiAndBranch) \ |
| 124 V(IsUndetectable) \ | |
| 125 V(IsUndetectableAndBranch) \ | 114 V(IsUndetectableAndBranch) \ |
| 126 V(JSArrayLength) \ | 115 V(JSArrayLength) \ |
| 127 V(Label) \ | 116 V(Label) \ |
| 128 V(LazyBailout) \ | 117 V(LazyBailout) \ |
| 129 V(LoadContextSlot) \ | 118 V(LoadContextSlot) \ |
| 130 V(LoadElements) \ | 119 V(LoadElements) \ |
| 131 V(LoadExternalArrayPointer) \ | 120 V(LoadExternalArrayPointer) \ |
| 132 V(LoadFunctionPrototype) \ | 121 V(LoadFunctionPrototype) \ |
| 133 V(LoadGlobalCell) \ | 122 V(LoadGlobalCell) \ |
| 134 V(LoadGlobalGeneric) \ | 123 V(LoadGlobalGeneric) \ |
| (...skipping 27 matching lines...) Expand all Loading... |
| 162 V(StoreKeyedGeneric) \ | 151 V(StoreKeyedGeneric) \ |
| 163 V(StoreKeyedSpecializedArrayElement) \ | 152 V(StoreKeyedSpecializedArrayElement) \ |
| 164 V(StoreNamedField) \ | 153 V(StoreNamedField) \ |
| 165 V(StoreNamedGeneric) \ | 154 V(StoreNamedGeneric) \ |
| 166 V(StringAdd) \ | 155 V(StringAdd) \ |
| 167 V(StringCharCodeAt) \ | 156 V(StringCharCodeAt) \ |
| 168 V(StringCharFromCode) \ | 157 V(StringCharFromCode) \ |
| 169 V(StringLength) \ | 158 V(StringLength) \ |
| 170 V(SubI) \ | 159 V(SubI) \ |
| 171 V(TaggedToI) \ | 160 V(TaggedToI) \ |
| 161 V(ThisFunction) \ |
| 172 V(Throw) \ | 162 V(Throw) \ |
| 173 V(ToFastProperties) \ | 163 V(ToFastProperties) \ |
| 174 V(Typeof) \ | 164 V(Typeof) \ |
| 175 V(TypeofIs) \ | |
| 176 V(TypeofIsAndBranch) \ | 165 V(TypeofIsAndBranch) \ |
| 177 V(UnaryMathOperation) \ | 166 V(UnaryMathOperation) \ |
| 178 V(UnknownOSRValue) \ | 167 V(UnknownOSRValue) \ |
| 179 V(ValueOf) | 168 V(ValueOf) |
| 180 | 169 |
| 181 | 170 |
| 182 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 171 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
| 183 virtual Opcode opcode() const { return LInstruction::k##type; } \ | 172 virtual Opcode opcode() const { return LInstruction::k##type; } \ |
| 184 virtual void CompileToNative(LCodeGen* generator); \ | 173 virtual void CompileToNative(LCodeGen* generator); \ |
| 185 virtual const char* Mnemonic() const { return mnemonic; } \ | 174 virtual const char* Mnemonic() const { return mnemonic; } \ |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 #define DECLARE_PREDICATE(type) \ | 214 #define DECLARE_PREDICATE(type) \ |
| 226 bool Is##type() const { return opcode() == k##type; } | 215 bool Is##type() const { return opcode() == k##type; } |
| 227 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE) | 216 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE) |
| 228 #undef DECLARE_PREDICATE | 217 #undef DECLARE_PREDICATE |
| 229 | 218 |
| 230 // Declare virtual predicates for instructions that don't have | 219 // Declare virtual predicates for instructions that don't have |
| 231 // an opcode. | 220 // an opcode. |
| 232 virtual bool IsGap() const { return false; } | 221 virtual bool IsGap() const { return false; } |
| 233 | 222 |
| 234 virtual bool IsControl() const { return false; } | 223 virtual bool IsControl() const { return false; } |
| 235 virtual void SetBranchTargets(int true_block_id, int false_block_id) { } | |
| 236 | 224 |
| 237 void set_environment(LEnvironment* env) { environment_ = env; } | 225 void set_environment(LEnvironment* env) { environment_ = env; } |
| 238 LEnvironment* environment() const { return environment_; } | 226 LEnvironment* environment() const { return environment_; } |
| 239 bool HasEnvironment() const { return environment_ != NULL; } | 227 bool HasEnvironment() const { return environment_ != NULL; } |
| 240 | 228 |
| 241 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } | 229 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } |
| 242 LPointerMap* pointer_map() const { return pointer_map_.get(); } | 230 LPointerMap* pointer_map() const { return pointer_map_.get(); } |
| 243 bool HasPointerMap() const { return pointer_map_.is_set(); } | 231 bool HasPointerMap() const { return pointer_map_.is_set(); } |
| 244 | 232 |
| 245 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } | 233 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 private: | 268 private: |
| 281 LEnvironment* environment_; | 269 LEnvironment* environment_; |
| 282 SetOncePointer<LPointerMap> pointer_map_; | 270 SetOncePointer<LPointerMap> pointer_map_; |
| 283 HValue* hydrogen_value_; | 271 HValue* hydrogen_value_; |
| 284 SetOncePointer<LEnvironment> deoptimization_environment_; | 272 SetOncePointer<LEnvironment> deoptimization_environment_; |
| 285 bool is_call_; | 273 bool is_call_; |
| 286 bool is_save_doubles_; | 274 bool is_save_doubles_; |
| 287 }; | 275 }; |
| 288 | 276 |
| 289 | 277 |
| 290 template<typename ElementType, int NumElements> | |
| 291 class OperandContainer { | |
| 292 public: | |
| 293 OperandContainer() { | |
| 294 for (int i = 0; i < NumElements; i++) elems_[i] = NULL; | |
| 295 } | |
| 296 int length() { return NumElements; } | |
| 297 ElementType& operator[](int i) { | |
| 298 ASSERT(i < length()); | |
| 299 return elems_[i]; | |
| 300 } | |
| 301 void PrintOperandsTo(StringStream* stream); | |
| 302 | |
| 303 private: | |
| 304 ElementType elems_[NumElements]; | |
| 305 }; | |
| 306 | |
| 307 | |
| 308 template<typename ElementType> | |
| 309 class OperandContainer<ElementType, 0> { | |
| 310 public: | |
| 311 int length() { return 0; } | |
| 312 void PrintOperandsTo(StringStream* stream) { } | |
| 313 ElementType& operator[](int i) { | |
| 314 UNREACHABLE(); | |
| 315 static ElementType t = 0; | |
| 316 return t; | |
| 317 } | |
| 318 }; | |
| 319 | |
| 320 | |
| 321 // R = number of result operands (0 or 1). | 278 // R = number of result operands (0 or 1). |
| 322 // I = number of input operands. | 279 // I = number of input operands. |
| 323 // T = number of temporary operands. | 280 // T = number of temporary operands. |
| 324 template<int R, int I, int T> | 281 template<int R, int I, int T> |
| 325 class LTemplateInstruction: public LInstruction { | 282 class LTemplateInstruction: public LInstruction { |
| 326 public: | 283 public: |
| 327 // Allow 0 or 1 output operands. | 284 // Allow 0 or 1 output operands. |
| 328 STATIC_ASSERT(R == 0 || R == 1); | 285 STATIC_ASSERT(R == 0 || R == 1); |
| 329 virtual bool HasResult() const { return R != 0; } | 286 virtual bool HasResult() const { return R != 0; } |
| 330 void set_result(LOperand* operand) { results_[0] = operand; } | 287 void set_result(LOperand* operand) { results_[0] = operand; } |
| 331 LOperand* result() { return results_[0]; } | 288 LOperand* result() { return results_[0]; } |
| 332 | 289 |
| 333 int InputCount() { return I; } | 290 int InputCount() { return I; } |
| 334 LOperand* InputAt(int i) { return inputs_[i]; } | 291 LOperand* InputAt(int i) { return inputs_[i]; } |
| 335 | 292 |
| 336 int TempCount() { return T; } | 293 int TempCount() { return T; } |
| 337 LOperand* TempAt(int i) { return temps_[i]; } | 294 LOperand* TempAt(int i) { return temps_[i]; } |
| 338 | 295 |
| 339 virtual void PrintDataTo(StringStream* stream); | 296 virtual void PrintDataTo(StringStream* stream); |
| 340 virtual void PrintOutputOperandTo(StringStream* stream); | 297 virtual void PrintOutputOperandTo(StringStream* stream); |
| 341 | 298 |
| 342 protected: | 299 protected: |
| 343 OperandContainer<LOperand*, R> results_; | 300 EmbeddedContainer<LOperand*, R> results_; |
| 344 OperandContainer<LOperand*, I> inputs_; | 301 EmbeddedContainer<LOperand*, I> inputs_; |
| 345 OperandContainer<LOperand*, T> temps_; | 302 EmbeddedContainer<LOperand*, T> temps_; |
| 346 }; | 303 }; |
| 347 | 304 |
| 348 | 305 |
| 349 class LGap: public LTemplateInstruction<0, 0, 0> { | 306 class LGap: public LTemplateInstruction<0, 0, 0> { |
| 350 public: | 307 public: |
| 351 explicit LGap(HBasicBlock* block) | 308 explicit LGap(HBasicBlock* block) |
| 352 : block_(block) { | 309 : block_(block) { |
| 353 parallel_moves_[BEFORE] = NULL; | 310 parallel_moves_[BEFORE] = NULL; |
| 354 parallel_moves_[START] = NULL; | 311 parallel_moves_[START] = NULL; |
| 355 parallel_moves_[END] = NULL; | 312 parallel_moves_[END] = NULL; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 class LInstructionGap: public LGap { | 352 class LInstructionGap: public LGap { |
| 396 public: | 353 public: |
| 397 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } | 354 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } |
| 398 | 355 |
| 399 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") | 356 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") |
| 400 }; | 357 }; |
| 401 | 358 |
| 402 | 359 |
| 403 class LGoto: public LTemplateInstruction<0, 0, 0> { | 360 class LGoto: public LTemplateInstruction<0, 0, 0> { |
| 404 public: | 361 public: |
| 405 LGoto(int block_id, bool include_stack_check = false) | 362 explicit LGoto(int block_id) : block_id_(block_id) { } |
| 406 : block_id_(block_id), include_stack_check_(include_stack_check) { } | |
| 407 | 363 |
| 408 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") | 364 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") |
| 409 virtual void PrintDataTo(StringStream* stream); | 365 virtual void PrintDataTo(StringStream* stream); |
| 410 virtual bool IsControl() const { return true; } | 366 virtual bool IsControl() const { return true; } |
| 411 | 367 |
| 412 int block_id() const { return block_id_; } | 368 int block_id() const { return block_id_; } |
| 413 bool include_stack_check() const { return include_stack_check_; } | |
| 414 | 369 |
| 415 private: | 370 private: |
| 416 int block_id_; | 371 int block_id_; |
| 417 bool include_stack_check_; | |
| 418 }; | 372 }; |
| 419 | 373 |
| 420 | 374 |
| 421 class LLazyBailout: public LTemplateInstruction<0, 0, 0> { | 375 class LLazyBailout: public LTemplateInstruction<0, 0, 0> { |
| 422 public: | 376 public: |
| 423 LLazyBailout() : gap_instructions_size_(0) { } | 377 LLazyBailout() : gap_instructions_size_(0) { } |
| 424 | 378 |
| 425 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") | 379 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") |
| 426 | 380 |
| 427 void set_gap_instructions_size(int gap_instructions_size) { | 381 void set_gap_instructions_size(int gap_instructions_size) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 public: | 437 public: |
| 484 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 438 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
| 485 }; | 439 }; |
| 486 | 440 |
| 487 | 441 |
| 488 template<int I, int T> | 442 template<int I, int T> |
| 489 class LControlInstruction: public LTemplateInstruction<0, I, T> { | 443 class LControlInstruction: public LTemplateInstruction<0, I, T> { |
| 490 public: | 444 public: |
| 491 virtual bool IsControl() const { return true; } | 445 virtual bool IsControl() const { return true; } |
| 492 | 446 |
| 493 int true_block_id() const { return true_block_id_; } | 447 int SuccessorCount() { return hydrogen()->SuccessorCount(); } |
| 494 int false_block_id() const { return false_block_id_; } | 448 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); } |
| 495 void SetBranchTargets(int true_block_id, int false_block_id) { | 449 int true_block_id() { return hydrogen()->SuccessorAt(0)->block_id(); } |
| 496 true_block_id_ = true_block_id; | 450 int false_block_id() { return hydrogen()->SuccessorAt(1)->block_id(); } |
| 497 false_block_id_ = false_block_id; | |
| 498 } | |
| 499 | 451 |
| 500 private: | 452 private: |
| 501 int true_block_id_; | 453 HControlInstruction* hydrogen() { |
| 502 int false_block_id_; | 454 return HControlInstruction::cast(this->hydrogen_value()); |
| 455 } |
| 503 }; | 456 }; |
| 504 | 457 |
| 505 | 458 |
| 506 class LApplyArguments: public LTemplateInstruction<1, 4, 0> { | 459 class LApplyArguments: public LTemplateInstruction<1, 4, 0> { |
| 507 public: | 460 public: |
| 508 LApplyArguments(LOperand* function, | 461 LApplyArguments(LOperand* function, |
| 509 LOperand* receiver, | 462 LOperand* receiver, |
| 510 LOperand* length, | 463 LOperand* length, |
| 511 LOperand* elements) { | 464 LOperand* elements) { |
| 512 inputs_[0] = function; | 465 inputs_[0] = function; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 LMulI(LOperand* left, LOperand* right) { | 544 LMulI(LOperand* left, LOperand* right) { |
| 592 inputs_[0] = left; | 545 inputs_[0] = left; |
| 593 inputs_[1] = right; | 546 inputs_[1] = right; |
| 594 } | 547 } |
| 595 | 548 |
| 596 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") | 549 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") |
| 597 DECLARE_HYDROGEN_ACCESSOR(Mul) | 550 DECLARE_HYDROGEN_ACCESSOR(Mul) |
| 598 }; | 551 }; |
| 599 | 552 |
| 600 | 553 |
| 601 class LCmpID: public LTemplateInstruction<1, 2, 0> { | |
| 602 public: | |
| 603 LCmpID(LOperand* left, LOperand* right) { | |
| 604 inputs_[0] = left; | |
| 605 inputs_[1] = right; | |
| 606 } | |
| 607 | |
| 608 DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id") | |
| 609 DECLARE_HYDROGEN_ACCESSOR(Compare) | |
| 610 | |
| 611 Token::Value op() const { return hydrogen()->token(); } | |
| 612 bool is_double() const { | |
| 613 return hydrogen()->GetInputRepresentation().IsDouble(); | |
| 614 } | |
| 615 }; | |
| 616 | |
| 617 | |
| 618 class LCmpIDAndBranch: public LControlInstruction<2, 0> { | 554 class LCmpIDAndBranch: public LControlInstruction<2, 0> { |
| 619 public: | 555 public: |
| 620 LCmpIDAndBranch(LOperand* left, LOperand* right) { | 556 LCmpIDAndBranch(LOperand* left, LOperand* right) { |
| 621 inputs_[0] = left; | 557 inputs_[0] = left; |
| 622 inputs_[1] = right; | 558 inputs_[1] = right; |
| 623 } | 559 } |
| 624 | 560 |
| 625 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") | 561 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") |
| 626 DECLARE_HYDROGEN_ACCESSOR(Compare) | 562 DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch) |
| 627 | 563 |
| 628 Token::Value op() const { return hydrogen()->token(); } | 564 Token::Value op() const { return hydrogen()->token(); } |
| 629 bool is_double() const { | 565 bool is_double() const { |
| 630 return hydrogen()->GetInputRepresentation().IsDouble(); | 566 return hydrogen()->GetInputRepresentation().IsDouble(); |
| 631 } | 567 } |
| 632 | 568 |
| 633 virtual void PrintDataTo(StringStream* stream); | 569 virtual void PrintDataTo(StringStream* stream); |
| 634 }; | 570 }; |
| 635 | 571 |
| 636 | 572 |
| 637 class LUnaryMathOperation: public LTemplateInstruction<1, 1, 0> { | 573 class LUnaryMathOperation: public LTemplateInstruction<1, 1, 0> { |
| 638 public: | 574 public: |
| 639 explicit LUnaryMathOperation(LOperand* value) { | 575 explicit LUnaryMathOperation(LOperand* value) { |
| 640 inputs_[0] = value; | 576 inputs_[0] = value; |
| 641 } | 577 } |
| 642 | 578 |
| 643 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") | 579 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") |
| 644 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 580 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 645 | 581 |
| 646 virtual void PrintDataTo(StringStream* stream); | 582 virtual void PrintDataTo(StringStream* stream); |
| 647 BuiltinFunctionId op() const { return hydrogen()->op(); } | 583 BuiltinFunctionId op() const { return hydrogen()->op(); } |
| 648 }; | 584 }; |
| 649 | 585 |
| 650 | 586 |
| 651 class LCmpJSObjectEq: public LTemplateInstruction<1, 2, 0> { | 587 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { |
| 652 public: | 588 public: |
| 653 LCmpJSObjectEq(LOperand* left, LOperand* right) { | 589 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { |
| 654 inputs_[0] = left; | 590 inputs_[0] = left; |
| 655 inputs_[1] = right; | 591 inputs_[1] = right; |
| 656 } | 592 } |
| 657 | 593 |
| 658 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq") | 594 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, |
| 595 "cmp-object-eq-and-branch") |
| 659 }; | 596 }; |
| 660 | 597 |
| 661 | 598 |
| 662 class LCmpJSObjectEqAndBranch: public LControlInstruction<2, 0> { | 599 class LCmpConstantEqAndBranch: public LControlInstruction<1, 0> { |
| 663 public: | 600 public: |
| 664 LCmpJSObjectEqAndBranch(LOperand* left, LOperand* right) { | 601 explicit LCmpConstantEqAndBranch(LOperand* left) { |
| 665 inputs_[0] = left; | 602 inputs_[0] = left; |
| 666 inputs_[1] = right; | |
| 667 } | 603 } |
| 668 | 604 |
| 669 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch, | 605 DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch, |
| 670 "cmp-jsobject-eq-and-branch") | 606 "cmp-constant-eq-and-branch") |
| 671 }; | 607 DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch) |
| 672 | |
| 673 | |
| 674 class LCmpSymbolEq: public LTemplateInstruction<1, 2, 0> { | |
| 675 public: | |
| 676 LCmpSymbolEq(LOperand* left, LOperand* right) { | |
| 677 inputs_[0] = left; | |
| 678 inputs_[1] = right; | |
| 679 } | |
| 680 | |
| 681 DECLARE_CONCRETE_INSTRUCTION(CmpSymbolEq, "cmp-symbol-eq") | |
| 682 }; | |
| 683 | |
| 684 | |
| 685 class LCmpSymbolEqAndBranch: public LControlInstruction<2, 0> { | |
| 686 public: | |
| 687 LCmpSymbolEqAndBranch(LOperand* left, LOperand* right) { | |
| 688 inputs_[0] = left; | |
| 689 inputs_[1] = right; | |
| 690 } | |
| 691 | |
| 692 DECLARE_CONCRETE_INSTRUCTION(CmpSymbolEqAndBranch, "cmp-symbol-eq-and-branch") | |
| 693 }; | |
| 694 | |
| 695 | |
| 696 class LIsNull: public LTemplateInstruction<1, 1, 0> { | |
| 697 public: | |
| 698 explicit LIsNull(LOperand* value) { | |
| 699 inputs_[0] = value; | |
| 700 } | |
| 701 | |
| 702 DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null") | |
| 703 DECLARE_HYDROGEN_ACCESSOR(IsNull) | |
| 704 | |
| 705 bool is_strict() const { return hydrogen()->is_strict(); } | |
| 706 }; | 608 }; |
| 707 | 609 |
| 708 | 610 |
| 709 class LIsNullAndBranch: public LControlInstruction<1, 1> { | 611 class LIsNullAndBranch: public LControlInstruction<1, 1> { |
| 710 public: | 612 public: |
| 711 LIsNullAndBranch(LOperand* value, LOperand* temp) { | 613 LIsNullAndBranch(LOperand* value, LOperand* temp) { |
| 712 inputs_[0] = value; | 614 inputs_[0] = value; |
| 713 temps_[0] = temp; | 615 temps_[0] = temp; |
| 714 } | 616 } |
| 715 | 617 |
| 716 DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch") | 618 DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch") |
| 717 DECLARE_HYDROGEN_ACCESSOR(IsNull) | 619 DECLARE_HYDROGEN_ACCESSOR(IsNullAndBranch) |
| 718 | 620 |
| 719 bool is_strict() const { return hydrogen()->is_strict(); } | 621 bool is_strict() const { return hydrogen()->is_strict(); } |
| 720 | 622 |
| 721 virtual void PrintDataTo(StringStream* stream); | 623 virtual void PrintDataTo(StringStream* stream); |
| 722 }; | 624 }; |
| 723 | 625 |
| 724 | 626 |
| 725 class LIsObject: public LTemplateInstruction<1, 1, 0> { | |
| 726 public: | |
| 727 explicit LIsObject(LOperand* value) { | |
| 728 inputs_[0] = value; | |
| 729 } | |
| 730 | |
| 731 DECLARE_CONCRETE_INSTRUCTION(IsObject, "is-object") | |
| 732 }; | |
| 733 | |
| 734 | |
| 735 class LIsObjectAndBranch: public LControlInstruction<1, 0> { | 627 class LIsObjectAndBranch: public LControlInstruction<1, 0> { |
| 736 public: | 628 public: |
| 737 explicit LIsObjectAndBranch(LOperand* value) { | 629 explicit LIsObjectAndBranch(LOperand* value) { |
| 738 inputs_[0] = value; | 630 inputs_[0] = value; |
| 739 } | 631 } |
| 740 | 632 |
| 741 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") | 633 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") |
| 634 DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch) |
| 742 | 635 |
| 743 virtual void PrintDataTo(StringStream* stream); | 636 virtual void PrintDataTo(StringStream* stream); |
| 744 }; | 637 }; |
| 745 | 638 |
| 746 | 639 |
| 747 class LIsSmi: public LTemplateInstruction<1, 1, 0> { | |
| 748 public: | |
| 749 explicit LIsSmi(LOperand* value) { | |
| 750 inputs_[0] = value; | |
| 751 } | |
| 752 | |
| 753 DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi") | |
| 754 DECLARE_HYDROGEN_ACCESSOR(IsSmi) | |
| 755 }; | |
| 756 | |
| 757 | |
| 758 class LIsSmiAndBranch: public LControlInstruction<1, 0> { | 640 class LIsSmiAndBranch: public LControlInstruction<1, 0> { |
| 759 public: | 641 public: |
| 760 explicit LIsSmiAndBranch(LOperand* value) { | 642 explicit LIsSmiAndBranch(LOperand* value) { |
| 761 inputs_[0] = value; | 643 inputs_[0] = value; |
| 762 } | 644 } |
| 763 | 645 |
| 764 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") | 646 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") |
| 647 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) |
| 765 | 648 |
| 766 virtual void PrintDataTo(StringStream* stream); | 649 virtual void PrintDataTo(StringStream* stream); |
| 767 }; | 650 }; |
| 768 | 651 |
| 769 | 652 |
| 770 class LIsUndetectable: public LTemplateInstruction<1, 1, 0> { | |
| 771 public: | |
| 772 explicit LIsUndetectable(LOperand* value) { | |
| 773 inputs_[0] = value; | |
| 774 } | |
| 775 | |
| 776 DECLARE_CONCRETE_INSTRUCTION(IsUndetectable, "is-undetectable") | |
| 777 DECLARE_HYDROGEN_ACCESSOR(IsUndetectable) | |
| 778 }; | |
| 779 | |
| 780 | |
| 781 class LIsUndetectableAndBranch: public LControlInstruction<1, 1> { | 653 class LIsUndetectableAndBranch: public LControlInstruction<1, 1> { |
| 782 public: | 654 public: |
| 783 explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) { | 655 explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) { |
| 784 inputs_[0] = value; | 656 inputs_[0] = value; |
| 785 temps_[0] = temp; | 657 temps_[0] = temp; |
| 786 } | 658 } |
| 787 | 659 |
| 788 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch, | 660 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch, |
| 789 "is-undetectable-and-branch") | 661 "is-undetectable-and-branch") |
| 662 DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch) |
| 790 | 663 |
| 791 virtual void PrintDataTo(StringStream* stream); | 664 virtual void PrintDataTo(StringStream* stream); |
| 792 }; | 665 }; |
| 793 | 666 |
| 794 | 667 |
| 795 class LHasInstanceType: public LTemplateInstruction<1, 1, 0> { | |
| 796 public: | |
| 797 explicit LHasInstanceType(LOperand* value) { | |
| 798 inputs_[0] = value; | |
| 799 } | |
| 800 | |
| 801 DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type") | |
| 802 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) | |
| 803 }; | |
| 804 | |
| 805 | |
| 806 class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> { | 668 class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> { |
| 807 public: | 669 public: |
| 808 explicit LHasInstanceTypeAndBranch(LOperand* value) { | 670 explicit LHasInstanceTypeAndBranch(LOperand* value) { |
| 809 inputs_[0] = value; | 671 inputs_[0] = value; |
| 810 } | 672 } |
| 811 | 673 |
| 812 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, | 674 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, |
| 813 "has-instance-type-and-branch") | 675 "has-instance-type-and-branch") |
| 814 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) | 676 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch) |
| 815 | 677 |
| 816 virtual void PrintDataTo(StringStream* stream); | 678 virtual void PrintDataTo(StringStream* stream); |
| 817 }; | 679 }; |
| 818 | 680 |
| 819 | 681 |
| 820 class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> { | 682 class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> { |
| 821 public: | 683 public: |
| 822 explicit LGetCachedArrayIndex(LOperand* value) { | 684 explicit LGetCachedArrayIndex(LOperand* value) { |
| 823 inputs_[0] = value; | 685 inputs_[0] = value; |
| 824 } | 686 } |
| 825 | 687 |
| 826 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") | 688 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") |
| 827 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) | 689 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) |
| 828 }; | 690 }; |
| 829 | 691 |
| 830 | 692 |
| 831 class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> { | |
| 832 public: | |
| 833 explicit LHasCachedArrayIndex(LOperand* value) { | |
| 834 inputs_[0] = value; | |
| 835 } | |
| 836 | |
| 837 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") | |
| 838 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex) | |
| 839 }; | |
| 840 | |
| 841 | |
| 842 class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> { | 693 class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> { |
| 843 public: | 694 public: |
| 844 explicit LHasCachedArrayIndexAndBranch(LOperand* value) { | 695 explicit LHasCachedArrayIndexAndBranch(LOperand* value) { |
| 845 inputs_[0] = value; | 696 inputs_[0] = value; |
| 846 } | 697 } |
| 847 | 698 |
| 848 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, | 699 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, |
| 849 "has-cached-array-index-and-branch") | 700 "has-cached-array-index-and-branch") |
| 850 virtual void PrintDataTo(StringStream* stream); | 701 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch) |
| 851 }; | |
| 852 | |
| 853 | |
| 854 class LClassOfTest: public LTemplateInstruction<1, 1, 1> { | |
| 855 public: | |
| 856 LClassOfTest(LOperand* value, LOperand* temp) { | |
| 857 inputs_[0] = value; | |
| 858 temps_[0] = temp; | |
| 859 } | |
| 860 | |
| 861 DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test") | |
| 862 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) | |
| 863 | 702 |
| 864 virtual void PrintDataTo(StringStream* stream); | 703 virtual void PrintDataTo(StringStream* stream); |
| 865 }; | 704 }; |
| 866 | 705 |
| 867 | 706 |
| 868 class LClassOfTestAndBranch: public LControlInstruction<1, 1> { | 707 class LClassOfTestAndBranch: public LControlInstruction<1, 1> { |
| 869 public: | 708 public: |
| 870 LClassOfTestAndBranch(LOperand* value, LOperand* temp) { | 709 LClassOfTestAndBranch(LOperand* value, LOperand* temp) { |
| 871 inputs_[0] = value; | 710 inputs_[0] = value; |
| 872 temps_[0] = temp; | 711 temps_[0] = temp; |
| 873 } | 712 } |
| 874 | 713 |
| 875 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, | 714 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, |
| 876 "class-of-test-and-branch") | 715 "class-of-test-and-branch") |
| 877 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) | 716 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) |
| 878 | 717 |
| 879 virtual void PrintDataTo(StringStream* stream); | 718 virtual void PrintDataTo(StringStream* stream); |
| 880 }; | 719 }; |
| 881 | 720 |
| 882 | 721 |
| 883 class LCmpT: public LTemplateInstruction<1, 2, 0> { | 722 class LCmpT: public LTemplateInstruction<1, 2, 0> { |
| 884 public: | 723 public: |
| 885 LCmpT(LOperand* left, LOperand* right) { | 724 LCmpT(LOperand* left, LOperand* right) { |
| 886 inputs_[0] = left; | 725 inputs_[0] = left; |
| 887 inputs_[1] = right; | 726 inputs_[1] = right; |
| 888 } | 727 } |
| 889 | 728 |
| 890 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") | 729 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") |
| 891 DECLARE_HYDROGEN_ACCESSOR(Compare) | 730 DECLARE_HYDROGEN_ACCESSOR(CompareGeneric) |
| 892 | |
| 893 Token::Value op() const { return hydrogen()->token(); } | |
| 894 }; | |
| 895 | |
| 896 | |
| 897 class LCmpTAndBranch: public LControlInstruction<2, 0> { | |
| 898 public: | |
| 899 LCmpTAndBranch(LOperand* left, LOperand* right) { | |
| 900 inputs_[0] = left; | |
| 901 inputs_[1] = right; | |
| 902 } | |
| 903 | |
| 904 DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch") | |
| 905 DECLARE_HYDROGEN_ACCESSOR(Compare) | |
| 906 | 731 |
| 907 Token::Value op() const { return hydrogen()->token(); } | 732 Token::Value op() const { return hydrogen()->token(); } |
| 908 }; | 733 }; |
| 909 | 734 |
| 910 | 735 |
| 911 class LIn: public LTemplateInstruction<1, 2, 0> { | 736 class LIn: public LTemplateInstruction<1, 2, 0> { |
| 912 public: | 737 public: |
| 913 LIn(LOperand* key, LOperand* object) { | 738 LIn(LOperand* key, LOperand* object) { |
| 914 inputs_[0] = key; | 739 inputs_[0] = key; |
| 915 inputs_[1] = object; | 740 inputs_[1] = object; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 926 public: | 751 public: |
| 927 LInstanceOf(LOperand* left, LOperand* right) { | 752 LInstanceOf(LOperand* left, LOperand* right) { |
| 928 inputs_[0] = left; | 753 inputs_[0] = left; |
| 929 inputs_[1] = right; | 754 inputs_[1] = right; |
| 930 } | 755 } |
| 931 | 756 |
| 932 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") | 757 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") |
| 933 }; | 758 }; |
| 934 | 759 |
| 935 | 760 |
| 936 class LInstanceOfAndBranch: public LControlInstruction<2, 0> { | |
| 937 public: | |
| 938 LInstanceOfAndBranch(LOperand* left, LOperand* right) { | |
| 939 inputs_[0] = left; | |
| 940 inputs_[1] = right; | |
| 941 } | |
| 942 | |
| 943 DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch") | |
| 944 }; | |
| 945 | |
| 946 | |
| 947 class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> { | 761 class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> { |
| 948 public: | 762 public: |
| 949 LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) { | 763 LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) { |
| 950 inputs_[0] = value; | 764 inputs_[0] = value; |
| 951 temps_[0] = temp; | 765 temps_[0] = temp; |
| 952 } | 766 } |
| 953 | 767 |
| 954 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, | 768 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, |
| 955 "instance-of-known-global") | 769 "instance-of-known-global") |
| 956 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) | 770 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1052 }; | 866 }; |
| 1053 | 867 |
| 1054 | 868 |
| 1055 class LBranch: public LControlInstruction<1, 0> { | 869 class LBranch: public LControlInstruction<1, 0> { |
| 1056 public: | 870 public: |
| 1057 explicit LBranch(LOperand* value) { | 871 explicit LBranch(LOperand* value) { |
| 1058 inputs_[0] = value; | 872 inputs_[0] = value; |
| 1059 } | 873 } |
| 1060 | 874 |
| 1061 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") | 875 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") |
| 1062 DECLARE_HYDROGEN_ACCESSOR(Value) | 876 DECLARE_HYDROGEN_ACCESSOR(Branch) |
| 1063 | 877 |
| 1064 virtual void PrintDataTo(StringStream* stream); | 878 virtual void PrintDataTo(StringStream* stream); |
| 1065 }; | 879 }; |
| 1066 | 880 |
| 1067 | 881 |
| 1068 class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 0> { | 882 class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 0> { |
| 1069 public: | 883 public: |
| 1070 explicit LCmpMapAndBranch(LOperand* value) { | 884 explicit LCmpMapAndBranch(LOperand* value) { |
| 1071 inputs_[0] = value; | 885 inputs_[0] = value; |
| 1072 } | 886 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 public: | 926 public: |
| 1113 explicit LFixedArrayLength(LOperand* value) { | 927 explicit LFixedArrayLength(LOperand* value) { |
| 1114 inputs_[0] = value; | 928 inputs_[0] = value; |
| 1115 } | 929 } |
| 1116 | 930 |
| 1117 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") | 931 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") |
| 1118 DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength) | 932 DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength) |
| 1119 }; | 933 }; |
| 1120 | 934 |
| 1121 | 935 |
| 936 class LElementsKind: public LTemplateInstruction<1, 1, 0> { |
| 937 public: |
| 938 explicit LElementsKind(LOperand* value) { |
| 939 inputs_[0] = value; |
| 940 } |
| 941 |
| 942 DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind") |
| 943 DECLARE_HYDROGEN_ACCESSOR(ElementsKind) |
| 944 }; |
| 945 |
| 946 |
| 1122 class LValueOf: public LTemplateInstruction<1, 1, 0> { | 947 class LValueOf: public LTemplateInstruction<1, 1, 0> { |
| 1123 public: | 948 public: |
| 1124 explicit LValueOf(LOperand* value) { | 949 explicit LValueOf(LOperand* value) { |
| 1125 inputs_[0] = value; | 950 inputs_[0] = value; |
| 1126 } | 951 } |
| 1127 | 952 |
| 1128 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") | 953 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") |
| 1129 DECLARE_HYDROGEN_ACCESSOR(ValueOf) | 954 DECLARE_HYDROGEN_ACCESSOR(ValueOf) |
| 1130 }; | 955 }; |
| 1131 | 956 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 inputs_[0] = external_pointer; | 1141 inputs_[0] = external_pointer; |
| 1317 inputs_[1] = key; | 1142 inputs_[1] = key; |
| 1318 } | 1143 } |
| 1319 | 1144 |
| 1320 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement, | 1145 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedSpecializedArrayElement, |
| 1321 "load-keyed-specialized-array-element") | 1146 "load-keyed-specialized-array-element") |
| 1322 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedSpecializedArrayElement) | 1147 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedSpecializedArrayElement) |
| 1323 | 1148 |
| 1324 LOperand* external_pointer() { return inputs_[0]; } | 1149 LOperand* external_pointer() { return inputs_[0]; } |
| 1325 LOperand* key() { return inputs_[1]; } | 1150 LOperand* key() { return inputs_[1]; } |
| 1326 ExternalArrayType array_type() const { | 1151 JSObject::ElementsKind elements_kind() const { |
| 1327 return hydrogen()->array_type(); | 1152 return hydrogen()->elements_kind(); |
| 1328 } | 1153 } |
| 1329 }; | 1154 }; |
| 1330 | 1155 |
| 1331 | 1156 |
| 1332 class LLoadKeyedGeneric: public LTemplateInstruction<1, 2, 0> { | 1157 class LLoadKeyedGeneric: public LTemplateInstruction<1, 2, 0> { |
| 1333 public: | 1158 public: |
| 1334 LLoadKeyedGeneric(LOperand* obj, LOperand* key) { | 1159 LLoadKeyedGeneric(LOperand* obj, LOperand* key) { |
| 1335 inputs_[0] = obj; | 1160 inputs_[0] = obj; |
| 1336 inputs_[1] = key; | 1161 inputs_[1] = key; |
| 1337 } | 1162 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 class LPushArgument: public LTemplateInstruction<0, 1, 0> { | 1260 class LPushArgument: public LTemplateInstruction<0, 1, 0> { |
| 1436 public: | 1261 public: |
| 1437 explicit LPushArgument(LOperand* value) { | 1262 explicit LPushArgument(LOperand* value) { |
| 1438 inputs_[0] = value; | 1263 inputs_[0] = value; |
| 1439 } | 1264 } |
| 1440 | 1265 |
| 1441 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") | 1266 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") |
| 1442 }; | 1267 }; |
| 1443 | 1268 |
| 1444 | 1269 |
| 1270 class LThisFunction: public LTemplateInstruction<1, 0, 0> { |
| 1271 DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function") |
| 1272 }; |
| 1273 |
| 1274 |
| 1445 class LContext: public LTemplateInstruction<1, 0, 0> { | 1275 class LContext: public LTemplateInstruction<1, 0, 0> { |
| 1446 public: | 1276 public: |
| 1447 DECLARE_CONCRETE_INSTRUCTION(Context, "context") | 1277 DECLARE_CONCRETE_INSTRUCTION(Context, "context") |
| 1448 }; | 1278 }; |
| 1449 | 1279 |
| 1450 | 1280 |
| 1451 class LOuterContext: public LTemplateInstruction<1, 1, 0> { | 1281 class LOuterContext: public LTemplateInstruction<1, 1, 0> { |
| 1452 public: | 1282 public: |
| 1453 explicit LOuterContext(LOperand* context) { | 1283 explicit LOuterContext(LOperand* context) { |
| 1454 inputs_[0] = context; | 1284 inputs_[0] = context; |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 | 1458 |
| 1629 | 1459 |
| 1630 // Sometimes truncating conversion from a tagged value to an int32. | 1460 // Sometimes truncating conversion from a tagged value to an int32. |
| 1631 class LDoubleToI: public LTemplateInstruction<1, 1, 0> { | 1461 class LDoubleToI: public LTemplateInstruction<1, 1, 0> { |
| 1632 public: | 1462 public: |
| 1633 explicit LDoubleToI(LOperand* value) { | 1463 explicit LDoubleToI(LOperand* value) { |
| 1634 inputs_[0] = value; | 1464 inputs_[0] = value; |
| 1635 } | 1465 } |
| 1636 | 1466 |
| 1637 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") | 1467 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") |
| 1638 DECLARE_HYDROGEN_ACCESSOR(Change) | 1468 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) |
| 1639 | 1469 |
| 1640 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 1470 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
| 1641 }; | 1471 }; |
| 1642 | 1472 |
| 1643 | 1473 |
| 1644 // Truncating conversion from a tagged value to an int32. | 1474 // Truncating conversion from a tagged value to an int32. |
| 1645 class LTaggedToI: public LTemplateInstruction<1, 1, 1> { | 1475 class LTaggedToI: public LTemplateInstruction<1, 1, 1> { |
| 1646 public: | 1476 public: |
| 1647 LTaggedToI(LOperand* value, LOperand* temp) { | 1477 LTaggedToI(LOperand* value, LOperand* temp) { |
| 1648 inputs_[0] = value; | 1478 inputs_[0] = value; |
| 1649 temps_[0] = temp; | 1479 temps_[0] = temp; |
| 1650 } | 1480 } |
| 1651 | 1481 |
| 1652 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") | 1482 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") |
| 1653 DECLARE_HYDROGEN_ACCESSOR(Change) | 1483 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) |
| 1654 | 1484 |
| 1655 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 1485 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
| 1656 }; | 1486 }; |
| 1657 | 1487 |
| 1658 | 1488 |
| 1659 class LSmiTag: public LTemplateInstruction<1, 1, 0> { | 1489 class LSmiTag: public LTemplateInstruction<1, 1, 0> { |
| 1660 public: | 1490 public: |
| 1661 explicit LSmiTag(LOperand* value) { | 1491 explicit LSmiTag(LOperand* value) { |
| 1662 inputs_[0] = value; | 1492 inputs_[0] = value; |
| 1663 } | 1493 } |
| 1664 | 1494 |
| 1665 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") | 1495 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") |
| 1666 }; | 1496 }; |
| 1667 | 1497 |
| 1668 | 1498 |
| 1669 class LNumberUntagD: public LTemplateInstruction<1, 1, 0> { | 1499 class LNumberUntagD: public LTemplateInstruction<1, 1, 0> { |
| 1670 public: | 1500 public: |
| 1671 explicit LNumberUntagD(LOperand* value) { | 1501 explicit LNumberUntagD(LOperand* value) { |
| 1672 inputs_[0] = value; | 1502 inputs_[0] = value; |
| 1673 } | 1503 } |
| 1674 | 1504 |
| 1675 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") | 1505 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") |
| 1506 DECLARE_HYDROGEN_ACCESSOR(Change); |
| 1676 }; | 1507 }; |
| 1677 | 1508 |
| 1678 | 1509 |
| 1679 class LSmiUntag: public LTemplateInstruction<1, 1, 0> { | 1510 class LSmiUntag: public LTemplateInstruction<1, 1, 0> { |
| 1680 public: | 1511 public: |
| 1681 LSmiUntag(LOperand* value, bool needs_check) | 1512 LSmiUntag(LOperand* value, bool needs_check) |
| 1682 : needs_check_(needs_check) { | 1513 : needs_check_(needs_check) { |
| 1683 inputs_[0] = value; | 1514 inputs_[0] = value; |
| 1684 } | 1515 } |
| 1685 | 1516 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1765 inputs_[2] = val; | 1596 inputs_[2] = val; |
| 1766 } | 1597 } |
| 1767 | 1598 |
| 1768 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement, | 1599 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement, |
| 1769 "store-keyed-specialized-array-element") | 1600 "store-keyed-specialized-array-element") |
| 1770 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement) | 1601 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement) |
| 1771 | 1602 |
| 1772 LOperand* external_pointer() { return inputs_[0]; } | 1603 LOperand* external_pointer() { return inputs_[0]; } |
| 1773 LOperand* key() { return inputs_[1]; } | 1604 LOperand* key() { return inputs_[1]; } |
| 1774 LOperand* value() { return inputs_[2]; } | 1605 LOperand* value() { return inputs_[2]; } |
| 1775 ExternalArrayType array_type() const { | 1606 JSObject::ElementsKind elements_kind() const { |
| 1776 return hydrogen()->array_type(); | 1607 return hydrogen()->elements_kind(); |
| 1777 } | 1608 } |
| 1778 }; | 1609 }; |
| 1779 | 1610 |
| 1780 | 1611 |
| 1781 class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> { | 1612 class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> { |
| 1782 public: | 1613 public: |
| 1783 LStoreKeyedGeneric(LOperand* object, LOperand* key, LOperand* value) { | 1614 LStoreKeyedGeneric(LOperand* object, LOperand* key, LOperand* value) { |
| 1784 inputs_[0] = object; | 1615 inputs_[0] = object; |
| 1785 inputs_[1] = key; | 1616 inputs_[1] = key; |
| 1786 inputs_[2] = value; | 1617 inputs_[2] = value; |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2006 class LTypeof: public LTemplateInstruction<1, 1, 0> { | 1837 class LTypeof: public LTemplateInstruction<1, 1, 0> { |
| 2007 public: | 1838 public: |
| 2008 explicit LTypeof(LOperand* value) { | 1839 explicit LTypeof(LOperand* value) { |
| 2009 inputs_[0] = value; | 1840 inputs_[0] = value; |
| 2010 } | 1841 } |
| 2011 | 1842 |
| 2012 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") | 1843 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") |
| 2013 }; | 1844 }; |
| 2014 | 1845 |
| 2015 | 1846 |
| 2016 class LTypeofIs: public LTemplateInstruction<1, 1, 0> { | |
| 2017 public: | |
| 2018 explicit LTypeofIs(LOperand* value) { | |
| 2019 inputs_[0] = value; | |
| 2020 } | |
| 2021 | |
| 2022 DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is") | |
| 2023 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) | |
| 2024 | |
| 2025 Handle<String> type_literal() { return hydrogen()->type_literal(); } | |
| 2026 | |
| 2027 virtual void PrintDataTo(StringStream* stream); | |
| 2028 }; | |
| 2029 | |
| 2030 | |
| 2031 class LTypeofIsAndBranch: public LControlInstruction<1, 0> { | 1847 class LTypeofIsAndBranch: public LControlInstruction<1, 0> { |
| 2032 public: | 1848 public: |
| 2033 explicit LTypeofIsAndBranch(LOperand* value) { | 1849 explicit LTypeofIsAndBranch(LOperand* value) { |
| 2034 inputs_[0] = value; | 1850 inputs_[0] = value; |
| 2035 } | 1851 } |
| 2036 | 1852 |
| 2037 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") | 1853 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") |
| 2038 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) | 1854 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) |
| 2039 | 1855 |
| 2040 Handle<String> type_literal() { return hydrogen()->type_literal(); } | 1856 Handle<String> type_literal() { return hydrogen()->type_literal(); } |
| 2041 | 1857 |
| 2042 virtual void PrintDataTo(StringStream* stream); | 1858 virtual void PrintDataTo(StringStream* stream); |
| 2043 }; | 1859 }; |
| 2044 | 1860 |
| 2045 | 1861 |
| 2046 class LIsConstructCall: public LTemplateInstruction<1, 0, 0> { | |
| 2047 public: | |
| 2048 DECLARE_CONCRETE_INSTRUCTION(IsConstructCall, "is-construct-call") | |
| 2049 DECLARE_HYDROGEN_ACCESSOR(IsConstructCall) | |
| 2050 }; | |
| 2051 | |
| 2052 | |
| 2053 class LIsConstructCallAndBranch: public LControlInstruction<0, 1> { | 1862 class LIsConstructCallAndBranch: public LControlInstruction<0, 1> { |
| 2054 public: | 1863 public: |
| 2055 explicit LIsConstructCallAndBranch(LOperand* temp) { | 1864 explicit LIsConstructCallAndBranch(LOperand* temp) { |
| 2056 temps_[0] = temp; | 1865 temps_[0] = temp; |
| 2057 } | 1866 } |
| 2058 | 1867 |
| 2059 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch, | 1868 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch, |
| 2060 "is-construct-call-and-branch") | 1869 "is-construct-call-and-branch") |
| 1870 DECLARE_HYDROGEN_ACCESSOR(IsConstructCallAndBranch) |
| 2061 }; | 1871 }; |
| 2062 | 1872 |
| 2063 | 1873 |
| 2064 class LDeleteProperty: public LTemplateInstruction<1, 2, 0> { | 1874 class LDeleteProperty: public LTemplateInstruction<1, 2, 0> { |
| 2065 public: | 1875 public: |
| 2066 LDeleteProperty(LOperand* obj, LOperand* key) { | 1876 LDeleteProperty(LOperand* obj, LOperand* key) { |
| 2067 inputs_[0] = obj; | 1877 inputs_[0] = obj; |
| 2068 inputs_[1] = key; | 1878 inputs_[1] = key; |
| 2069 } | 1879 } |
| 2070 | 1880 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2094 // NULL if the register has no assigned spill slot. Indexed by allocation | 1904 // NULL if the register has no assigned spill slot. Indexed by allocation |
| 2095 // index. | 1905 // index. |
| 2096 LOperand* register_spills_[Register::kNumAllocatableRegisters]; | 1906 LOperand* register_spills_[Register::kNumAllocatableRegisters]; |
| 2097 LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters]; | 1907 LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters]; |
| 2098 }; | 1908 }; |
| 2099 | 1909 |
| 2100 | 1910 |
| 2101 class LStackCheck: public LTemplateInstruction<0, 0, 0> { | 1911 class LStackCheck: public LTemplateInstruction<0, 0, 0> { |
| 2102 public: | 1912 public: |
| 2103 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") | 1913 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") |
| 1914 DECLARE_HYDROGEN_ACCESSOR(StackCheck) |
| 1915 |
| 1916 Label* done_label() { return &done_label_; } |
| 1917 |
| 1918 private: |
| 1919 Label done_label_; |
| 2104 }; | 1920 }; |
| 2105 | 1921 |
| 2106 | 1922 |
| 2107 class LChunkBuilder; | 1923 class LChunkBuilder; |
| 2108 class LChunk: public ZoneObject { | 1924 class LChunk: public ZoneObject { |
| 2109 public: | 1925 public: |
| 2110 explicit LChunk(CompilationInfo* info, HGraph* graph) | 1926 explicit LChunk(CompilationInfo* info, HGraph* graph) |
| 2111 : spill_slot_count_(0), | 1927 : spill_slot_count_(0), |
| 2112 info_(info), | 1928 info_(info), |
| 2113 graph_(graph), | 1929 graph_(graph), |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2325 | 2141 |
| 2326 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2142 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2327 }; | 2143 }; |
| 2328 | 2144 |
| 2329 #undef DECLARE_HYDROGEN_ACCESSOR | 2145 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2330 #undef DECLARE_CONCRETE_INSTRUCTION | 2146 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2331 | 2147 |
| 2332 } } // namespace v8::int | 2148 } } // namespace v8::int |
| 2333 | 2149 |
| 2334 #endif // V8_X64_LITHIUM_X64_H_ | 2150 #endif // V8_X64_LITHIUM_X64_H_ |
| OLD | NEW |