| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 static MachineType RepSimd128() { | 162 static MachineType RepSimd128() { |
| 163 return MachineType(MachineRepresentation::kSimd128, MachineSemantic::kNone); | 163 return MachineType(MachineRepresentation::kSimd128, MachineSemantic::kNone); |
| 164 } | 164 } |
| 165 static MachineType RepTagged() { | 165 static MachineType RepTagged() { |
| 166 return MachineType(MachineRepresentation::kTagged, MachineSemantic::kNone); | 166 return MachineType(MachineRepresentation::kTagged, MachineSemantic::kNone); |
| 167 } | 167 } |
| 168 static MachineType RepBit() { | 168 static MachineType RepBit() { |
| 169 return MachineType(MachineRepresentation::kBit, MachineSemantic::kNone); | 169 return MachineType(MachineRepresentation::kBit, MachineSemantic::kNone); |
| 170 } | 170 } |
| 171 | 171 |
| 172 static MachineType TypeForRepresentation(MachineRepresentation& rep, | 172 static MachineType TypeForRepresentation(const MachineRepresentation& rep, |
| 173 bool isSigned = true) { | 173 bool isSigned = true) { |
| 174 switch (rep) { | 174 switch (rep) { |
| 175 case MachineRepresentation::kNone: | 175 case MachineRepresentation::kNone: |
| 176 return MachineType::None(); | 176 return MachineType::None(); |
| 177 case MachineRepresentation::kBit: | 177 case MachineRepresentation::kBit: |
| 178 return MachineType::Bool(); | 178 return MachineType::Bool(); |
| 179 case MachineRepresentation::kWord8: | 179 case MachineRepresentation::kWord8: |
| 180 return isSigned ? MachineType::Int8() : MachineType::Uint8(); | 180 return isSigned ? MachineType::Int8() : MachineType::Uint8(); |
| 181 case MachineRepresentation::kWord16: | 181 case MachineRepresentation::kWord16: |
| 182 return isSigned ? MachineType::Int16() : MachineType::Uint16(); | 182 return isSigned ? MachineType::Int16() : MachineType::Uint16(); |
| 183 case MachineRepresentation::kWord32: | 183 case MachineRepresentation::kWord32: |
| 184 return isSigned ? MachineType::Int32() : MachineType::Uint32(); | 184 return isSigned ? MachineType::Int32() : MachineType::Uint32(); |
| 185 case MachineRepresentation::kWord64: | 185 case MachineRepresentation::kWord64: |
| 186 return isSigned ? MachineType::Int64() : MachineType::Uint64(); | 186 return isSigned ? MachineType::Int64() : MachineType::Uint64(); |
| 187 case MachineRepresentation::kFloat32: | 187 case MachineRepresentation::kFloat32: |
| 188 return MachineType::Float32(); | 188 return MachineType::Float32(); |
| 189 case MachineRepresentation::kFloat64: | 189 case MachineRepresentation::kFloat64: |
| 190 return MachineType::Float64(); | 190 return MachineType::Float64(); |
| 191 case MachineRepresentation::kSimd128: | 191 case MachineRepresentation::kSimd128: |
| 192 return MachineType::Simd128(); | 192 return MachineType::Simd128(); |
| 193 case MachineRepresentation::kTagged: | 193 case MachineRepresentation::kTagged: |
| 194 return MachineType::AnyTagged(); | 194 return MachineType::AnyTagged(); |
| 195 case MachineRepresentation::kTaggedSigned: |
| 196 return MachineType::TaggedSigned(); |
| 197 case MachineRepresentation::kTaggedPointer: |
| 198 return MachineType::TaggedPointer(); |
| 195 default: | 199 default: |
| 196 UNREACHABLE(); | 200 UNREACHABLE(); |
| 197 return MachineType::None(); | 201 return MachineType::None(); |
| 198 } | 202 } |
| 199 } | 203 } |
| 200 | 204 |
| 201 private: | 205 private: |
| 202 MachineRepresentation representation_; | 206 MachineRepresentation representation_; |
| 203 MachineSemantic semantic_; | 207 MachineSemantic semantic_; |
| 204 }; | 208 }; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 UNREACHABLE(); | 261 UNREACHABLE(); |
| 258 return -1; | 262 return -1; |
| 259 } | 263 } |
| 260 | 264 |
| 261 typedef Signature<MachineType> MachineSignature; | 265 typedef Signature<MachineType> MachineSignature; |
| 262 | 266 |
| 263 } // namespace internal | 267 } // namespace internal |
| 264 } // namespace v8 | 268 } // namespace v8 |
| 265 | 269 |
| 266 #endif // V8_MACHINE_TYPE_H_ | 270 #endif // V8_MACHINE_TYPE_H_ |
| OLD | NEW |