| 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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 } | 584 } |
| 585 | 585 |
| 586 bool IsDefinedAfter(HBasicBlock* other) const; | 586 bool IsDefinedAfter(HBasicBlock* other) const; |
| 587 | 587 |
| 588 // Operands. | 588 // Operands. |
| 589 virtual int OperandCount() = 0; | 589 virtual int OperandCount() = 0; |
| 590 virtual HValue* OperandAt(int index) = 0; | 590 virtual HValue* OperandAt(int index) = 0; |
| 591 void SetOperandAt(int index, HValue* value); | 591 void SetOperandAt(int index, HValue* value); |
| 592 | 592 |
| 593 void DeleteAndReplaceWith(HValue* other); | 593 void DeleteAndReplaceWith(HValue* other); |
| 594 void ReplaceAllUsesWith(HValue* other); |
| 594 bool HasNoUses() const { return use_list_ == NULL; } | 595 bool HasNoUses() const { return use_list_ == NULL; } |
| 595 bool HasMultipleUses() const { | 596 bool HasMultipleUses() const { |
| 596 return use_list_ != NULL && use_list_->tail() != NULL; | 597 return use_list_ != NULL && use_list_->tail() != NULL; |
| 597 } | 598 } |
| 598 int UseCount() const; | 599 int UseCount() const; |
| 599 void ClearOperands(); | 600 void ClearOperands(); |
| 600 | 601 |
| 601 int flags() const { return flags_; } | 602 int flags() const { return flags_; } |
| 602 void SetFlag(Flag f) { flags_ |= (1 << f); } | 603 void SetFlag(Flag f) { flags_ |= (1 << f); } |
| 603 void ClearFlag(Flag f) { flags_ &= ~(1 << f); } | 604 void ClearFlag(Flag f) { flags_ &= ~(1 << f); } |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 private: | 674 private: |
| 674 // A flag mask to mark an instruction as having arbitrary side effects. | 675 // A flag mask to mark an instruction as having arbitrary side effects. |
| 675 static int AllSideEffects() { | 676 static int AllSideEffects() { |
| 676 return ChangesFlagsMask() & ~(1 << kChangesOsrEntries); | 677 return ChangesFlagsMask() & ~(1 << kChangesOsrEntries); |
| 677 } | 678 } |
| 678 | 679 |
| 679 // Remove the matching use from the use list if present. Returns the | 680 // Remove the matching use from the use list if present. Returns the |
| 680 // removed list node or NULL. | 681 // removed list node or NULL. |
| 681 HUseListNode* RemoveUse(HValue* value, int index); | 682 HUseListNode* RemoveUse(HValue* value, int index); |
| 682 | 683 |
| 683 void ReplaceAllUsesWith(HValue* other); | |
| 684 | |
| 685 void RegisterUse(int index, HValue* new_value); | 684 void RegisterUse(int index, HValue* new_value); |
| 686 | 685 |
| 687 HBasicBlock* block_; | 686 HBasicBlock* block_; |
| 688 | 687 |
| 689 // The id of this instruction in the hydrogen graph, assigned when first | 688 // The id of this instruction in the hydrogen graph, assigned when first |
| 690 // added to the graph. Reflects creation order. | 689 // added to the graph. Reflects creation order. |
| 691 int id_; | 690 int id_; |
| 692 | 691 |
| 693 Representation representation_; | 692 Representation representation_; |
| 694 HType type_; | 693 HType type_; |
| (...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2327 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt) | 2326 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt) |
| 2328 | 2327 |
| 2329 virtual bool DataEquals(HValue* other) { return true; } | 2328 virtual bool DataEquals(HValue* other) { return true; } |
| 2330 }; | 2329 }; |
| 2331 | 2330 |
| 2332 | 2331 |
| 2333 class HBoundsCheck: public HBinaryOperation { | 2332 class HBoundsCheck: public HBinaryOperation { |
| 2334 public: | 2333 public: |
| 2335 HBoundsCheck(HValue* index, HValue* length) | 2334 HBoundsCheck(HValue* index, HValue* length) |
| 2336 : HBinaryOperation(index, length) { | 2335 : HBinaryOperation(index, length) { |
| 2336 set_representation(Representation::Integer32()); |
| 2337 SetFlag(kUseGVN); | 2337 SetFlag(kUseGVN); |
| 2338 } | 2338 } |
| 2339 | 2339 |
| 2340 virtual bool IsCheckInstruction() const { return true; } | 2340 virtual bool IsCheckInstruction() const { return true; } |
| 2341 | 2341 |
| 2342 virtual Representation RequiredInputRepresentation(int index) const { | 2342 virtual Representation RequiredInputRepresentation(int index) const { |
| 2343 return Representation::Integer32(); | 2343 return Representation::Integer32(); |
| 2344 } | 2344 } |
| 2345 | 2345 |
| 2346 #ifdef DEBUG | 2346 #ifdef DEBUG |
| (...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3962 | 3962 |
| 3963 DECLARE_CONCRETE_INSTRUCTION(In) | 3963 DECLARE_CONCRETE_INSTRUCTION(In) |
| 3964 }; | 3964 }; |
| 3965 | 3965 |
| 3966 #undef DECLARE_INSTRUCTION | 3966 #undef DECLARE_INSTRUCTION |
| 3967 #undef DECLARE_CONCRETE_INSTRUCTION | 3967 #undef DECLARE_CONCRETE_INSTRUCTION |
| 3968 | 3968 |
| 3969 } } // namespace v8::internal | 3969 } } // namespace v8::internal |
| 3970 | 3970 |
| 3971 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3971 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |