OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_MACHINE_TYPE_H_ | 5 #ifndef V8_MACHINE_TYPE_H_ |
6 #define V8_MACHINE_TYPE_H_ | 6 #define V8_MACHINE_TYPE_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 return representation() == other.representation() && | 55 return representation() == other.representation() && |
56 semantic() == other.semantic(); | 56 semantic() == other.semantic(); |
57 } | 57 } |
58 | 58 |
59 bool operator!=(MachineType other) const { return !(*this == other); } | 59 bool operator!=(MachineType other) const { return !(*this == other); } |
60 | 60 |
61 | 61 |
62 MachineRepresentation representation() const { return representation_; } | 62 MachineRepresentation representation() const { return representation_; } |
63 MachineSemantic semantic() const { return semantic_; } | 63 MachineSemantic semantic() const { return semantic_; } |
64 | 64 |
| 65 bool IsNone() { return representation() == MachineRepresentation::kNone; } |
| 66 |
65 bool IsSigned() { | 67 bool IsSigned() { |
66 return semantic() == MachineSemantic::kInt32 || | 68 return semantic() == MachineSemantic::kInt32 || |
67 semantic() == MachineSemantic::kInt64; | 69 semantic() == MachineSemantic::kInt64; |
68 } | 70 } |
69 bool IsUnsigned() { | 71 bool IsUnsigned() { |
70 return semantic() == MachineSemantic::kUint32 || | 72 return semantic() == MachineSemantic::kUint32 || |
71 semantic() == MachineSemantic::kUint64; | 73 semantic() == MachineSemantic::kUint64; |
72 } | 74 } |
73 | 75 |
74 static MachineRepresentation PointerRepresentation() { | 76 static MachineRepresentation PointerRepresentation() { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 UNREACHABLE(); | 263 UNREACHABLE(); |
262 return -1; | 264 return -1; |
263 } | 265 } |
264 | 266 |
265 typedef Signature<MachineType> MachineSignature; | 267 typedef Signature<MachineType> MachineSignature; |
266 | 268 |
267 } // namespace internal | 269 } // namespace internal |
268 } // namespace v8 | 270 } // namespace v8 |
269 | 271 |
270 #endif // V8_MACHINE_TYPE_H_ | 272 #endif // V8_MACHINE_TYPE_H_ |
OLD | NEW |