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/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 return BitCast<int64_t>(a) == BitCast<int64_t>(b); | 178 return BitCast<int64_t>(a) == BitCast<int64_t>(b); |
179 } | 179 } |
180 }; | 180 }; |
181 | 181 |
182 // Specialization for static parameters of type {PrintableUnique<Object>}. | 182 // Specialization for static parameters of type {PrintableUnique<Object>}. |
183 template <> | 183 template <> |
184 struct StaticParameterTraits<PrintableUnique<Object> > { | 184 struct StaticParameterTraits<PrintableUnique<Object> > { |
185 static OStream& PrintTo(OStream& os, PrintableUnique<Object> val) { // NOLINT | 185 static OStream& PrintTo(OStream& os, PrintableUnique<Object> val) { // NOLINT |
186 return os << val.string(); | 186 return os << val.string(); |
187 } | 187 } |
188 static int HashCode(PrintableUnique<Object> a) { return a.Hashcode(); } | 188 static int HashCode(PrintableUnique<Object> a) { |
| 189 return static_cast<int>(a.Hashcode()); |
| 190 } |
189 static bool Equals(PrintableUnique<Object> a, PrintableUnique<Object> b) { | 191 static bool Equals(PrintableUnique<Object> a, PrintableUnique<Object> b) { |
190 return a == b; | 192 return a == b; |
191 } | 193 } |
192 }; | 194 }; |
193 | 195 |
194 // Specialization for static parameters of type {PrintableUnique<Name>}. | 196 // Specialization for static parameters of type {PrintableUnique<Name>}. |
195 template <> | 197 template <> |
196 struct StaticParameterTraits<PrintableUnique<Name> > { | 198 struct StaticParameterTraits<PrintableUnique<Name> > { |
197 static OStream& PrintTo(OStream& os, PrintableUnique<Name> val) { // NOLINT | 199 static OStream& PrintTo(OStream& os, PrintableUnique<Name> val) { // NOLINT |
198 return os << val.string(); | 200 return os << val.string(); |
199 } | 201 } |
200 static int HashCode(PrintableUnique<Name> a) { return a.Hashcode(); } | 202 static int HashCode(PrintableUnique<Name> a) { |
| 203 return static_cast<int>(a.Hashcode()); |
| 204 } |
201 static bool Equals(PrintableUnique<Name> a, PrintableUnique<Name> b) { | 205 static bool Equals(PrintableUnique<Name> a, PrintableUnique<Name> b) { |
202 return a == b; | 206 return a == b; |
203 } | 207 } |
204 }; | 208 }; |
205 | 209 |
206 #if DEBUG | 210 #if DEBUG |
207 // Specialization for static parameters of type {Handle<Object>} to prevent any | 211 // Specialization for static parameters of type {Handle<Object>} to prevent any |
208 // direct usage of Handles in constants. | 212 // direct usage of Handles in constants. |
209 template <> | 213 template <> |
210 struct StaticParameterTraits<Handle<Object> > { | 214 struct StaticParameterTraits<Handle<Object> > { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 T parameter_; | 271 T parameter_; |
268 }; | 272 }; |
269 | 273 |
270 // Type definitions for operators with specific types of parameters. | 274 // Type definitions for operators with specific types of parameters. |
271 typedef Operator1<PrintableUnique<Name> > NameOperator; | 275 typedef Operator1<PrintableUnique<Name> > NameOperator; |
272 } | 276 } |
273 } | 277 } |
274 } // namespace v8::internal::compiler | 278 } // namespace v8::internal::compiler |
275 | 279 |
276 #endif // V8_COMPILER_OPERATOR_H_ | 280 #endif // V8_COMPILER_OPERATOR_H_ |
OLD | NEW |