| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 if (IsWord(output_rep)) { | 298 if (IsWord(output_rep)) { |
| 299 if (output_type->Is(Type::Signed32())) { | 299 if (output_type->Is(Type::Signed32())) { |
| 300 op = machine()->ChangeInt32ToFloat64(); | 300 op = machine()->ChangeInt32ToFloat64(); |
| 301 } else if (output_type->Is(Type::Unsigned32()) || | 301 } else if (output_type->Is(Type::Unsigned32()) || |
| 302 truncation.TruncatesToWord32()) { | 302 truncation.TruncatesToWord32()) { |
| 303 // Either the output is uint32 or the uses only care about the | 303 // Either the output is uint32 or the uses only care about the |
| 304 // low 32 bits (so we can pick uint32 safely). | 304 // low 32 bits (so we can pick uint32 safely). |
| 305 op = machine()->ChangeUint32ToFloat64(); | 305 op = machine()->ChangeUint32ToFloat64(); |
| 306 } | 306 } |
| 307 } else if (output_rep == MachineRepresentation::kTagged) { | 307 } else if (output_rep == MachineRepresentation::kTagged) { |
| 308 if (output_type->Is(Type::Number())) { | 308 if (output_type->Is(Type::NumberOrUndefined())) { |
| 309 op = simplified()->ChangeTaggedToFloat64(); | 309 op = simplified()->ChangeTaggedToFloat64(); |
| 310 } | 310 } |
| 311 } else if (output_rep == MachineRepresentation::kFloat32) { | 311 } else if (output_rep == MachineRepresentation::kFloat32) { |
| 312 op = machine()->ChangeFloat32ToFloat64(); | 312 op = machine()->ChangeFloat32ToFloat64(); |
| 313 } | 313 } |
| 314 if (op == nullptr) { | 314 if (op == nullptr) { |
| 315 return TypeError(node, output_rep, output_type, | 315 return TypeError(node, output_rep, output_type, |
| 316 MachineRepresentation::kFloat64); | 316 MachineRepresentation::kFloat64); |
| 317 } | 317 } |
| 318 return jsgraph()->graph()->NewNode(op, node); | 318 return jsgraph()->graph()->NewNode(op, node); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 530 |
| 531 | 531 |
| 532 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { | 532 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { |
| 533 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), | 533 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), |
| 534 node); | 534 node); |
| 535 } | 535 } |
| 536 | 536 |
| 537 } // namespace compiler | 537 } // namespace compiler |
| 538 } // namespace internal | 538 } // namespace internal |
| 539 } // namespace v8 | 539 } // namespace v8 |
| OLD | NEW |