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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 inline bool CanBeTaggedPointer(MachineRepresentation rep) { | 232 inline bool CanBeTaggedPointer(MachineRepresentation rep) { |
233 return rep == MachineRepresentation::kTagged || | 233 return rep == MachineRepresentation::kTagged || |
234 rep == MachineRepresentation::kTaggedPointer; | 234 rep == MachineRepresentation::kTaggedPointer; |
235 } | 235 } |
236 | 236 |
237 inline bool IsAnyTagged(MachineRepresentation rep) { | 237 inline bool IsAnyTagged(MachineRepresentation rep) { |
238 return CanBeTaggedPointer(rep) || rep == MachineRepresentation::kTaggedSigned; | 238 return CanBeTaggedPointer(rep) || rep == MachineRepresentation::kTaggedSigned; |
239 } | 239 } |
240 | 240 |
241 // Gets the log2 of the element size in bytes of the machine type. | 241 // Gets the log2 of the element size in bytes of the machine type. |
242 inline int ElementSizeLog2Of(MachineRepresentation rep) { | 242 V8_EXPORT_PRIVATE inline int ElementSizeLog2Of(MachineRepresentation rep) { |
243 switch (rep) { | 243 switch (rep) { |
244 case MachineRepresentation::kBit: | 244 case MachineRepresentation::kBit: |
245 case MachineRepresentation::kWord8: | 245 case MachineRepresentation::kWord8: |
246 return 0; | 246 return 0; |
247 case MachineRepresentation::kWord16: | 247 case MachineRepresentation::kWord16: |
248 return 1; | 248 return 1; |
249 case MachineRepresentation::kWord32: | 249 case MachineRepresentation::kWord32: |
250 case MachineRepresentation::kFloat32: | 250 case MachineRepresentation::kFloat32: |
251 return 2; | 251 return 2; |
252 case MachineRepresentation::kWord64: | 252 case MachineRepresentation::kWord64: |
(...skipping 11 matching lines...) Expand all Loading... |
264 UNREACHABLE(); | 264 UNREACHABLE(); |
265 return -1; | 265 return -1; |
266 } | 266 } |
267 | 267 |
268 typedef Signature<MachineType> MachineSignature; | 268 typedef Signature<MachineType> MachineSignature; |
269 | 269 |
270 } // namespace internal | 270 } // namespace internal |
271 } // namespace v8 | 271 } // namespace v8 |
272 | 272 |
273 #endif // V8_MACHINE_TYPE_H_ | 273 #endif // V8_MACHINE_TYPE_H_ |
OLD | NEW |