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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 op = simplified()->CheckedFloat64ToInt32(); | 450 op = simplified()->CheckedFloat64ToInt32(); |
451 } | 451 } |
452 } else if (output_rep == MachineRepresentation::kTagged) { | 452 } else if (output_rep == MachineRepresentation::kTagged) { |
453 if (output_type->Is(Type::TaggedSigned())) { | 453 if (output_type->Is(Type::TaggedSigned())) { |
454 op = simplified()->ChangeTaggedSignedToInt32(); | 454 op = simplified()->ChangeTaggedSignedToInt32(); |
455 } else if (output_type->Is(Type::Unsigned32())) { | 455 } else if (output_type->Is(Type::Unsigned32())) { |
456 op = simplified()->ChangeTaggedToUint32(); | 456 op = simplified()->ChangeTaggedToUint32(); |
457 } else if (output_type->Is(Type::Signed32())) { | 457 } else if (output_type->Is(Type::Signed32())) { |
458 op = simplified()->ChangeTaggedToInt32(); | 458 op = simplified()->ChangeTaggedToInt32(); |
459 } else if (use_info.truncation().IsUsedAsWord32()) { | 459 } else if (use_info.truncation().IsUsedAsWord32()) { |
460 if (use_info.type_check() == TypeCheckKind::kNumberOrOddball) { | 460 if (use_info.type_check() != TypeCheckKind::kNone) { |
461 op = simplified()->CheckedTruncateTaggedToWord32(); | 461 op = simplified()->CheckedTruncateTaggedToWord32(); |
462 } else { | 462 } else { |
463 op = simplified()->TruncateTaggedToWord32(); | 463 op = simplified()->TruncateTaggedToWord32(); |
464 } | 464 } |
465 } else if (use_info.type_check() == TypeCheckKind::kSigned32) { | 465 } else if (use_info.type_check() == TypeCheckKind::kSigned32) { |
466 op = simplified()->CheckedTaggedToInt32(); | 466 op = simplified()->CheckedTaggedToInt32(); |
467 } | 467 } |
468 } else if (output_rep == MachineRepresentation::kWord32) { | 468 } else if (output_rep == MachineRepresentation::kWord32) { |
469 // Only the checked case should get here, the non-checked case is | 469 // Only the checked case should get here, the non-checked case is |
470 // handled in GetRepresentationFor. | 470 // handled in GetRepresentationFor. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 return machine()->Int32Sub(); | 561 return machine()->Int32Sub(); |
562 case IrOpcode::kSpeculativeNumberMultiply: | 562 case IrOpcode::kSpeculativeNumberMultiply: |
563 case IrOpcode::kNumberMultiply: | 563 case IrOpcode::kNumberMultiply: |
564 return machine()->Int32Mul(); | 564 return machine()->Int32Mul(); |
565 case IrOpcode::kSpeculativeNumberDivide: | 565 case IrOpcode::kSpeculativeNumberDivide: |
566 case IrOpcode::kNumberDivide: | 566 case IrOpcode::kNumberDivide: |
567 return machine()->Int32Div(); | 567 return machine()->Int32Div(); |
568 case IrOpcode::kSpeculativeNumberModulus: | 568 case IrOpcode::kSpeculativeNumberModulus: |
569 case IrOpcode::kNumberModulus: | 569 case IrOpcode::kNumberModulus: |
570 return machine()->Int32Mod(); | 570 return machine()->Int32Mod(); |
| 571 case IrOpcode::kSpeculativeNumberBitwiseOr: // Fall through. |
571 case IrOpcode::kNumberBitwiseOr: | 572 case IrOpcode::kNumberBitwiseOr: |
572 return machine()->Word32Or(); | 573 return machine()->Word32Or(); |
| 574 case IrOpcode::kSpeculativeNumberBitwiseXor: // Fall through. |
573 case IrOpcode::kNumberBitwiseXor: | 575 case IrOpcode::kNumberBitwiseXor: |
574 return machine()->Word32Xor(); | 576 return machine()->Word32Xor(); |
| 577 case IrOpcode::kSpeculativeNumberBitwiseAnd: // Fall through. |
575 case IrOpcode::kNumberBitwiseAnd: | 578 case IrOpcode::kNumberBitwiseAnd: |
576 return machine()->Word32And(); | 579 return machine()->Word32And(); |
577 case IrOpcode::kNumberEqual: | 580 case IrOpcode::kNumberEqual: |
578 case IrOpcode::kSpeculativeNumberEqual: | 581 case IrOpcode::kSpeculativeNumberEqual: |
579 return machine()->Word32Equal(); | 582 return machine()->Word32Equal(); |
580 case IrOpcode::kNumberLessThan: | 583 case IrOpcode::kNumberLessThan: |
581 case IrOpcode::kSpeculativeNumberLessThan: | 584 case IrOpcode::kSpeculativeNumberLessThan: |
582 return machine()->Int32LessThan(); | 585 return machine()->Int32LessThan(); |
583 case IrOpcode::kNumberLessThanOrEqual: | 586 case IrOpcode::kNumberLessThanOrEqual: |
584 case IrOpcode::kSpeculativeNumberLessThanOrEqual: | 587 case IrOpcode::kSpeculativeNumberLessThanOrEqual: |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 } | 787 } |
785 | 788 |
786 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { | 789 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { |
787 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), | 790 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), |
788 node); | 791 node); |
789 } | 792 } |
790 | 793 |
791 } // namespace compiler | 794 } // namespace compiler |
792 } // namespace internal | 795 } // namespace internal |
793 } // namespace v8 | 796 } // namespace v8 |
OLD | NEW |