OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 if (value()->representation().IsInteger32()) return value(); | 1423 if (value()->representation().IsInteger32()) return value(); |
1424 } | 1424 } |
1425 return this; | 1425 return this; |
1426 } | 1426 } |
1427 | 1427 |
1428 BuiltinFunctionId op() const { return op_; } | 1428 BuiltinFunctionId op() const { return op_; } |
1429 const char* OpName() const; | 1429 const char* OpName() const; |
1430 | 1430 |
1431 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary_math_operation") | 1431 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary_math_operation") |
1432 | 1432 |
| 1433 protected: |
| 1434 virtual bool DataEquals(HValue* other) const { |
| 1435 HUnaryMathOperation* b = HUnaryMathOperation::cast(other); |
| 1436 return op_ == b->op(); |
| 1437 } |
| 1438 |
1433 private: | 1439 private: |
1434 BuiltinFunctionId op_; | 1440 BuiltinFunctionId op_; |
1435 }; | 1441 }; |
1436 | 1442 |
1437 | 1443 |
1438 class HLoadElements: public HUnaryOperation { | 1444 class HLoadElements: public HUnaryOperation { |
1439 public: | 1445 public: |
1440 explicit HLoadElements(HValue* value) : HUnaryOperation(value) { | 1446 explicit HLoadElements(HValue* value) : HUnaryOperation(value) { |
1441 set_representation(Representation::Tagged()); | 1447 set_representation(Representation::Tagged()); |
1442 SetFlag(kUseGVN); | 1448 SetFlag(kUseGVN); |
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2090 | 2096 |
2091 class HIsNull: public HUnaryPredicate { | 2097 class HIsNull: public HUnaryPredicate { |
2092 public: | 2098 public: |
2093 HIsNull(HValue* value, bool is_strict) | 2099 HIsNull(HValue* value, bool is_strict) |
2094 : HUnaryPredicate(value), is_strict_(is_strict) { } | 2100 : HUnaryPredicate(value), is_strict_(is_strict) { } |
2095 | 2101 |
2096 bool is_strict() const { return is_strict_; } | 2102 bool is_strict() const { return is_strict_; } |
2097 | 2103 |
2098 DECLARE_CONCRETE_INSTRUCTION(IsNull, "is_null") | 2104 DECLARE_CONCRETE_INSTRUCTION(IsNull, "is_null") |
2099 | 2105 |
| 2106 protected: |
| 2107 virtual bool DataEquals(HValue* other) const { |
| 2108 HIsNull* b = HIsNull::cast(other); |
| 2109 return is_strict_ == b->is_strict(); |
| 2110 } |
| 2111 |
2100 private: | 2112 private: |
2101 bool is_strict_; | 2113 bool is_strict_; |
2102 }; | 2114 }; |
2103 | 2115 |
2104 | 2116 |
2105 class HIsObject: public HUnaryPredicate { | 2117 class HIsObject: public HUnaryPredicate { |
2106 public: | 2118 public: |
2107 explicit HIsObject(HValue* value) : HUnaryPredicate(value) { } | 2119 explicit HIsObject(HValue* value) : HUnaryPredicate(value) { } |
2108 | 2120 |
2109 DECLARE_CONCRETE_INSTRUCTION(IsObject, "is_object") | 2121 DECLARE_CONCRETE_INSTRUCTION(IsObject, "is_object") |
(...skipping 17 matching lines...) Expand all Loading... |
2127 ASSERT(to == LAST_TYPE); // Others not implemented yet in backend. | 2139 ASSERT(to == LAST_TYPE); // Others not implemented yet in backend. |
2128 } | 2140 } |
2129 | 2141 |
2130 InstanceType from() { return from_; } | 2142 InstanceType from() { return from_; } |
2131 InstanceType to() { return to_; } | 2143 InstanceType to() { return to_; } |
2132 | 2144 |
2133 virtual void PrintDataTo(StringStream* stream) const; | 2145 virtual void PrintDataTo(StringStream* stream) const; |
2134 | 2146 |
2135 DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has_instance_type") | 2147 DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has_instance_type") |
2136 | 2148 |
| 2149 protected: |
| 2150 virtual bool DataEquals(HValue* other) const { |
| 2151 HHasInstanceType* b = HHasInstanceType::cast(other); |
| 2152 return (from_ == b->from()) && (to_ == b->to()); |
| 2153 } |
| 2154 |
2137 private: | 2155 private: |
2138 InstanceType from_; | 2156 InstanceType from_; |
2139 InstanceType to_; // Inclusive range, not all combinations work. | 2157 InstanceType to_; // Inclusive range, not all combinations work. |
2140 }; | 2158 }; |
2141 | 2159 |
2142 | 2160 |
2143 class HHasCachedArrayIndex: public HUnaryPredicate { | 2161 class HHasCachedArrayIndex: public HUnaryPredicate { |
2144 public: | 2162 public: |
2145 explicit HHasCachedArrayIndex(HValue* value) : HUnaryPredicate(value) { } | 2163 explicit HHasCachedArrayIndex(HValue* value) : HUnaryPredicate(value) { } |
2146 | 2164 |
2147 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has_cached_array_index") | 2165 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has_cached_array_index") |
2148 }; | 2166 }; |
2149 | 2167 |
2150 | 2168 |
2151 class HClassOfTest: public HUnaryPredicate { | 2169 class HClassOfTest: public HUnaryPredicate { |
2152 public: | 2170 public: |
2153 HClassOfTest(HValue* value, Handle<String> class_name) | 2171 HClassOfTest(HValue* value, Handle<String> class_name) |
2154 : HUnaryPredicate(value), class_name_(class_name) { } | 2172 : HUnaryPredicate(value), class_name_(class_name) { } |
2155 | 2173 |
2156 DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class_of_test") | 2174 DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class_of_test") |
2157 | 2175 |
2158 virtual void PrintDataTo(StringStream* stream) const; | 2176 virtual void PrintDataTo(StringStream* stream) const; |
2159 | 2177 |
2160 Handle<String> class_name() const { return class_name_; } | 2178 Handle<String> class_name() const { return class_name_; } |
2161 | 2179 |
| 2180 protected: |
| 2181 virtual bool DataEquals(HValue* other) const { |
| 2182 HClassOfTest* b = HClassOfTest::cast(other); |
| 2183 return class_name_.is_identical_to(b->class_name_); |
| 2184 } |
| 2185 |
2162 private: | 2186 private: |
2163 Handle<String> class_name_; | 2187 Handle<String> class_name_; |
2164 }; | 2188 }; |
2165 | 2189 |
2166 | 2190 |
2167 class HTypeofIs: public HUnaryPredicate { | 2191 class HTypeofIs: public HUnaryPredicate { |
2168 public: | 2192 public: |
2169 HTypeofIs(HValue* value, Handle<String> type_literal) | 2193 HTypeofIs(HValue* value, Handle<String> type_literal) |
2170 : HUnaryPredicate(value), type_literal_(type_literal) { } | 2194 : HUnaryPredicate(value), type_literal_(type_literal) { } |
2171 | 2195 |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2910 HValue* object() const { return left(); } | 2934 HValue* object() const { return left(); } |
2911 HValue* key() const { return right(); } | 2935 HValue* key() const { return right(); } |
2912 }; | 2936 }; |
2913 | 2937 |
2914 #undef DECLARE_INSTRUCTION | 2938 #undef DECLARE_INSTRUCTION |
2915 #undef DECLARE_CONCRETE_INSTRUCTION | 2939 #undef DECLARE_CONCRETE_INSTRUCTION |
2916 | 2940 |
2917 } } // namespace v8::internal | 2941 } } // namespace v8::internal |
2918 | 2942 |
2919 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 2943 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |