OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_OPERATOR_H_ | 5 #ifndef V8_COMPILER_OPERATOR_H_ |
6 #define V8_COMPILER_OPERATOR_H_ | 6 #define V8_COMPILER_OPERATOR_H_ |
7 | 7 |
8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
10 #include "src/unique.h" | 10 #include "src/unique.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 static bool Equals(int a, int b) { return a == b; } | 164 static bool Equals(int a, int b) { return a == b; } |
165 }; | 165 }; |
166 | 166 |
167 // Specialization for static parameters of type {double}. | 167 // Specialization for static parameters of type {double}. |
168 template <> | 168 template <> |
169 struct StaticParameterTraits<double> { | 169 struct StaticParameterTraits<double> { |
170 static OStream& PrintTo(OStream& os, double val) { // NOLINT | 170 static OStream& PrintTo(OStream& os, double val) { // NOLINT |
171 return os << val; | 171 return os << val; |
172 } | 172 } |
173 static int HashCode(double a) { | 173 static int HashCode(double a) { |
174 return static_cast<int>(BitCast<int64_t>(a)); | 174 return static_cast<int>(bit_cast<int64_t>(a)); |
175 } | 175 } |
176 static bool Equals(double a, double b) { | 176 static bool Equals(double a, double b) { |
177 return BitCast<int64_t>(a) == BitCast<int64_t>(b); | 177 return bit_cast<int64_t>(a) == bit_cast<int64_t>(b); |
178 } | 178 } |
179 }; | 179 }; |
180 | 180 |
181 // Specialization for static parameters of type {Unique<Object>}. | 181 // Specialization for static parameters of type {Unique<Object>}. |
182 template <> | 182 template <> |
183 struct StaticParameterTraits<Unique<Object> > { | 183 struct StaticParameterTraits<Unique<Object> > { |
184 static OStream& PrintTo(OStream& os, Unique<Object> val) { // NOLINT | 184 static OStream& PrintTo(OStream& os, Unique<Object> val) { // NOLINT |
185 return os << Brief(*val.handle()); | 185 return os << Brief(*val.handle()); |
186 } | 186 } |
187 static int HashCode(Unique<Object> a) { | 187 static int HashCode(Unique<Object> a) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 template <typename T> | 268 template <typename T> |
269 static inline T OpParameter(const Operator* op) { | 269 static inline T OpParameter(const Operator* op) { |
270 return reinterpret_cast<const Operator1<T>*>(op)->parameter(); | 270 return reinterpret_cast<const Operator1<T>*>(op)->parameter(); |
271 } | 271 } |
272 | 272 |
273 } // namespace compiler | 273 } // namespace compiler |
274 } // namespace internal | 274 } // namespace internal |
275 } // namespace v8 | 275 } // namespace v8 |
276 | 276 |
277 #endif // V8_COMPILER_OPERATOR_H_ | 277 #endif // V8_COMPILER_OPERATOR_H_ |
OLD | NEW |