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 1782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1793 protected: | 1793 protected: |
1794 virtual bool DataEquals(HValue* other) { return true; } | 1794 virtual bool DataEquals(HValue* other) { return true; } |
1795 }; | 1795 }; |
1796 | 1796 |
1797 | 1797 |
1798 class HPhi: public HValue { | 1798 class HPhi: public HValue { |
1799 public: | 1799 public: |
1800 explicit HPhi(int merged_index) | 1800 explicit HPhi(int merged_index) |
1801 : inputs_(2), | 1801 : inputs_(2), |
1802 merged_index_(merged_index), | 1802 merged_index_(merged_index), |
1803 phi_id_(-1) { | 1803 phi_id_(-1), |
| 1804 is_live_(false) { |
1804 for (int i = 0; i < Representation::kNumRepresentations; i++) { | 1805 for (int i = 0; i < Representation::kNumRepresentations; i++) { |
1805 non_phi_uses_[i] = 0; | 1806 non_phi_uses_[i] = 0; |
1806 indirect_uses_[i] = 0; | 1807 indirect_uses_[i] = 0; |
1807 } | 1808 } |
1808 ASSERT(merged_index >= 0); | 1809 ASSERT(merged_index >= 0); |
1809 set_representation(Representation::Tagged()); | 1810 set_representation(Representation::Tagged()); |
1810 SetFlag(kFlexibleRepresentation); | 1811 SetFlag(kFlexibleRepresentation); |
1811 } | 1812 } |
1812 | 1813 |
1813 virtual Representation InferredRepresentation() { | 1814 virtual Representation InferredRepresentation() { |
(...skipping 13 matching lines...) Expand all Loading... |
1827 | 1828 |
1828 virtual Range* InferRange(); | 1829 virtual Range* InferRange(); |
1829 virtual Representation RequiredInputRepresentation(int index) const { | 1830 virtual Representation RequiredInputRepresentation(int index) const { |
1830 return representation(); | 1831 return representation(); |
1831 } | 1832 } |
1832 virtual HType CalculateInferredType(); | 1833 virtual HType CalculateInferredType(); |
1833 virtual int OperandCount() { return inputs_.length(); } | 1834 virtual int OperandCount() { return inputs_.length(); } |
1834 virtual HValue* OperandAt(int index) { return inputs_[index]; } | 1835 virtual HValue* OperandAt(int index) { return inputs_[index]; } |
1835 HValue* GetRedundantReplacement(); | 1836 HValue* GetRedundantReplacement(); |
1836 void AddInput(HValue* value); | 1837 void AddInput(HValue* value); |
| 1838 bool HasRealUses(); |
1837 | 1839 |
1838 bool IsReceiver() { return merged_index_ == 0; } | 1840 bool IsReceiver() { return merged_index_ == 0; } |
1839 | 1841 |
1840 int merged_index() const { return merged_index_; } | 1842 int merged_index() const { return merged_index_; } |
1841 | 1843 |
1842 virtual const char* Mnemonic() const { return "phi"; } | 1844 virtual const char* Mnemonic() const { return "phi"; } |
1843 | 1845 |
1844 virtual void PrintTo(StringStream* stream); | 1846 virtual void PrintTo(StringStream* stream); |
1845 | 1847 |
1846 #ifdef DEBUG | 1848 #ifdef DEBUG |
(...skipping 18 matching lines...) Expand all Loading... |
1865 int tagged_indirect_uses() const { | 1867 int tagged_indirect_uses() const { |
1866 return indirect_uses_[Representation::kTagged]; | 1868 return indirect_uses_[Representation::kTagged]; |
1867 } | 1869 } |
1868 int int32_indirect_uses() const { | 1870 int int32_indirect_uses() const { |
1869 return indirect_uses_[Representation::kInteger32]; | 1871 return indirect_uses_[Representation::kInteger32]; |
1870 } | 1872 } |
1871 int double_indirect_uses() const { | 1873 int double_indirect_uses() const { |
1872 return indirect_uses_[Representation::kDouble]; | 1874 return indirect_uses_[Representation::kDouble]; |
1873 } | 1875 } |
1874 int phi_id() { return phi_id_; } | 1876 int phi_id() { return phi_id_; } |
| 1877 bool is_live() { return is_live_; } |
| 1878 void set_is_live(bool b) { is_live_ = b; } |
1875 | 1879 |
1876 protected: | 1880 protected: |
1877 virtual void DeleteFromGraph(); | 1881 virtual void DeleteFromGraph(); |
1878 virtual void InternalSetOperandAt(int index, HValue* value) { | 1882 virtual void InternalSetOperandAt(int index, HValue* value) { |
1879 inputs_[index] = value; | 1883 inputs_[index] = value; |
1880 } | 1884 } |
1881 | 1885 |
1882 private: | 1886 private: |
1883 ZoneList<HValue*> inputs_; | 1887 ZoneList<HValue*> inputs_; |
1884 int merged_index_; | 1888 int merged_index_; |
1885 | 1889 |
1886 int non_phi_uses_[Representation::kNumRepresentations]; | 1890 int non_phi_uses_[Representation::kNumRepresentations]; |
1887 int indirect_uses_[Representation::kNumRepresentations]; | 1891 int indirect_uses_[Representation::kNumRepresentations]; |
1888 int phi_id_; | 1892 int phi_id_; |
| 1893 bool is_live_; |
1889 }; | 1894 }; |
1890 | 1895 |
1891 | 1896 |
1892 class HArgumentsObject: public HTemplateInstruction<0> { | 1897 class HArgumentsObject: public HTemplateInstruction<0> { |
1893 public: | 1898 public: |
1894 HArgumentsObject() { | 1899 HArgumentsObject() { |
1895 set_representation(Representation::Tagged()); | 1900 set_representation(Representation::Tagged()); |
1896 SetFlag(kIsArguments); | 1901 SetFlag(kIsArguments); |
1897 } | 1902 } |
1898 | 1903 |
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3446 HValue* object() { return left(); } | 3451 HValue* object() { return left(); } |
3447 HValue* key() { return right(); } | 3452 HValue* key() { return right(); } |
3448 }; | 3453 }; |
3449 | 3454 |
3450 #undef DECLARE_INSTRUCTION | 3455 #undef DECLARE_INSTRUCTION |
3451 #undef DECLARE_CONCRETE_INSTRUCTION | 3456 #undef DECLARE_CONCRETE_INSTRUCTION |
3452 | 3457 |
3453 } } // namespace v8::internal | 3458 } } // namespace v8::internal |
3454 | 3459 |
3455 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 3460 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |