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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 } else if (use_info.type_check() == TypeCheckKind::kSignedSmall) { | 627 } else if (use_info.type_check() == TypeCheckKind::kSignedSmall) { |
628 op = simplified()->CheckedTaggedSignedToInt32(); | 628 op = simplified()->CheckedTaggedSignedToInt32(); |
629 } else if (use_info.type_check() == TypeCheckKind::kSigned32) { | 629 } else if (use_info.type_check() == TypeCheckKind::kSigned32) { |
630 op = simplified()->CheckedTaggedToInt32( | 630 op = simplified()->CheckedTaggedToInt32( |
631 output_type->Maybe(Type::MinusZero()) | 631 output_type->Maybe(Type::MinusZero()) |
632 ? CheckForMinusZeroMode::kCheckForMinusZero | 632 ? CheckForMinusZeroMode::kCheckForMinusZero |
633 : CheckForMinusZeroMode::kDontCheckForMinusZero); | 633 : CheckForMinusZeroMode::kDontCheckForMinusZero); |
634 } else if (output_type->Is(Type::Unsigned32())) { | 634 } else if (output_type->Is(Type::Unsigned32())) { |
635 op = simplified()->ChangeTaggedToUint32(); | 635 op = simplified()->ChangeTaggedToUint32(); |
636 } else if (use_info.truncation().IsUsedAsWord32()) { | 636 } else if (use_info.truncation().IsUsedAsWord32()) { |
637 if (use_info.type_check() != TypeCheckKind::kNone) { | 637 if (output_type->Is(Type::NumberOrOddball())) { |
| 638 op = simplified()->TruncateTaggedToWord32(); |
| 639 } else if (use_info.type_check() != TypeCheckKind::kNone) { |
638 op = simplified()->CheckedTruncateTaggedToWord32(); | 640 op = simplified()->CheckedTruncateTaggedToWord32(); |
639 } else { | |
640 op = simplified()->TruncateTaggedToWord32(); | |
641 } | 641 } |
642 } | 642 } |
643 } else if (output_rep == MachineRepresentation::kWord32) { | 643 } else if (output_rep == MachineRepresentation::kWord32) { |
644 // Only the checked case should get here, the non-checked case is | 644 // Only the checked case should get here, the non-checked case is |
645 // handled in GetRepresentationFor. | 645 // handled in GetRepresentationFor. |
646 if (use_info.type_check() == TypeCheckKind::kSignedSmall || | 646 if (use_info.type_check() == TypeCheckKind::kSignedSmall || |
647 use_info.type_check() == TypeCheckKind::kSigned32) { | 647 use_info.type_check() == TypeCheckKind::kSigned32) { |
648 if (output_type->Is(Type::Signed32())) { | 648 if (output_type->Is(Type::Signed32())) { |
649 return node; | 649 return node; |
650 } else if (output_type->Is(Type::Unsigned32())) { | 650 } else if (output_type->Is(Type::Unsigned32())) { |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 node); | 1002 node); |
1003 } | 1003 } |
1004 | 1004 |
1005 Node* RepresentationChanger::InsertChangeUint32ToFloat64(Node* node) { | 1005 Node* RepresentationChanger::InsertChangeUint32ToFloat64(Node* node) { |
1006 return jsgraph()->graph()->NewNode(machine()->ChangeUint32ToFloat64(), node); | 1006 return jsgraph()->graph()->NewNode(machine()->ChangeUint32ToFloat64(), node); |
1007 } | 1007 } |
1008 | 1008 |
1009 } // namespace compiler | 1009 } // namespace compiler |
1010 } // namespace internal | 1010 } // namespace internal |
1011 } // namespace v8 | 1011 } // namespace v8 |
OLD | NEW |