OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include "src/compiler/representation-change.h" | 5 #include "src/compiler/representation-change.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 default: | 300 default: |
301 break; | 301 break; |
302 } | 302 } |
303 // Select the correct X -> TaggedPointer operator. | 303 // Select the correct X -> TaggedPointer operator. |
304 Operator const* op; | 304 Operator const* op; |
305 if (output_type->Is(Type::None())) { | 305 if (output_type->Is(Type::None())) { |
306 // This is an impossible value; it should not be used at runtime. | 306 // This is an impossible value; it should not be used at runtime. |
307 // We just provide a dummy value here. | 307 // We just provide a dummy value here. |
308 return jsgraph()->TheHoleConstant(); | 308 return jsgraph()->TheHoleConstant(); |
309 } else if (output_rep == MachineRepresentation::kBit) { | 309 } else if (output_rep == MachineRepresentation::kBit) { |
310 return node; | 310 if (output_type->Is(Type::Boolean())) { |
| 311 op = simplified()->ChangeBitToTagged(); |
| 312 } else { |
| 313 return TypeError(node, output_rep, output_type, |
| 314 MachineRepresentation::kTagged); |
| 315 } |
311 } else if (IsWord(output_rep)) { | 316 } else if (IsWord(output_rep)) { |
312 if (output_type->Is(Type::Unsigned32())) { | 317 if (output_type->Is(Type::Unsigned32())) { |
313 // uint32 -> float64 -> tagged | 318 // uint32 -> float64 -> tagged |
314 node = InsertChangeUint32ToFloat64(node); | 319 node = InsertChangeUint32ToFloat64(node); |
315 } else if (output_type->Is(Type::Signed32())) { | 320 } else if (output_type->Is(Type::Signed32())) { |
316 // int32 -> float64 -> tagged | 321 // int32 -> float64 -> tagged |
317 node = InsertChangeInt32ToFloat64(node); | 322 node = InsertChangeInt32ToFloat64(node); |
318 } else { | 323 } else { |
319 return TypeError(node, output_rep, output_type, | 324 return TypeError(node, output_rep, output_type, |
320 MachineRepresentation::kTaggedPointer); | 325 MachineRepresentation::kTaggedPointer); |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 node); | 1007 node); |
1003 } | 1008 } |
1004 | 1009 |
1005 Node* RepresentationChanger::InsertChangeUint32ToFloat64(Node* node) { | 1010 Node* RepresentationChanger::InsertChangeUint32ToFloat64(Node* node) { |
1006 return jsgraph()->graph()->NewNode(machine()->ChangeUint32ToFloat64(), node); | 1011 return jsgraph()->graph()->NewNode(machine()->ChangeUint32ToFloat64(), node); |
1007 } | 1012 } |
1008 | 1013 |
1009 } // namespace compiler | 1014 } // namespace compiler |
1010 } // namespace internal | 1015 } // namespace internal |
1011 } // namespace v8 | 1016 } // namespace v8 |
OLD | NEW |