| 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 #include "src/assembler-inl.h" | 5 #include "src/assembler-inl.h" |
| 6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
| 7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
| 8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 immediate_mode = kLoadStoreImm32; | 595 immediate_mode = kLoadStoreImm32; |
| 596 break; | 596 break; |
| 597 case MachineRepresentation::kTaggedSigned: // Fall through. | 597 case MachineRepresentation::kTaggedSigned: // Fall through. |
| 598 case MachineRepresentation::kTaggedPointer: // Fall through. | 598 case MachineRepresentation::kTaggedPointer: // Fall through. |
| 599 case MachineRepresentation::kTagged: // Fall through. | 599 case MachineRepresentation::kTagged: // Fall through. |
| 600 case MachineRepresentation::kWord64: | 600 case MachineRepresentation::kWord64: |
| 601 opcode = kArm64Ldr; | 601 opcode = kArm64Ldr; |
| 602 immediate_mode = kLoadStoreImm64; | 602 immediate_mode = kLoadStoreImm64; |
| 603 break; | 603 break; |
| 604 case MachineRepresentation::kSimd128: // Fall through. | 604 case MachineRepresentation::kSimd128: // Fall through. |
| 605 case MachineRepresentation::kSimd1x4: // Fall through. | |
| 606 case MachineRepresentation::kSimd1x8: // Fall through. | |
| 607 case MachineRepresentation::kSimd1x16: // Fall through. | |
| 608 case MachineRepresentation::kNone: | 605 case MachineRepresentation::kNone: |
| 609 UNREACHABLE(); | 606 UNREACHABLE(); |
| 610 return; | 607 return; |
| 611 } | 608 } |
| 612 EmitLoad(this, node, opcode, immediate_mode, rep); | 609 EmitLoad(this, node, opcode, immediate_mode, rep); |
| 613 } | 610 } |
| 614 | 611 |
| 615 void InstructionSelector::VisitProtectedLoad(Node* node) { | 612 void InstructionSelector::VisitProtectedLoad(Node* node) { |
| 616 // TODO(eholk) | 613 // TODO(eholk) |
| 617 UNIMPLEMENTED(); | 614 UNIMPLEMENTED(); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 immediate_mode = kLoadStoreImm32; | 691 immediate_mode = kLoadStoreImm32; |
| 695 break; | 692 break; |
| 696 case MachineRepresentation::kTaggedSigned: // Fall through. | 693 case MachineRepresentation::kTaggedSigned: // Fall through. |
| 697 case MachineRepresentation::kTaggedPointer: // Fall through. | 694 case MachineRepresentation::kTaggedPointer: // Fall through. |
| 698 case MachineRepresentation::kTagged: // Fall through. | 695 case MachineRepresentation::kTagged: // Fall through. |
| 699 case MachineRepresentation::kWord64: | 696 case MachineRepresentation::kWord64: |
| 700 opcode = kArm64Str; | 697 opcode = kArm64Str; |
| 701 immediate_mode = kLoadStoreImm64; | 698 immediate_mode = kLoadStoreImm64; |
| 702 break; | 699 break; |
| 703 case MachineRepresentation::kSimd128: // Fall through. | 700 case MachineRepresentation::kSimd128: // Fall through. |
| 704 case MachineRepresentation::kSimd1x4: // Fall through. | |
| 705 case MachineRepresentation::kSimd1x8: // Fall through. | |
| 706 case MachineRepresentation::kSimd1x16: // Fall through. | |
| 707 case MachineRepresentation::kNone: | 701 case MachineRepresentation::kNone: |
| 708 UNREACHABLE(); | 702 UNREACHABLE(); |
| 709 return; | 703 return; |
| 710 } | 704 } |
| 711 | 705 |
| 712 inputs[0] = g.UseRegisterOrImmediateZero(value); | 706 inputs[0] = g.UseRegisterOrImmediateZero(value); |
| 713 inputs[1] = g.UseRegister(base); | 707 inputs[1] = g.UseRegister(base); |
| 714 | 708 |
| 715 if (g.CanBeImmediate(index, immediate_mode)) { | 709 if (g.CanBeImmediate(index, immediate_mode)) { |
| 716 input_count = 3; | 710 input_count = 3; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 opcode = kCheckedLoadFloat32; | 759 opcode = kCheckedLoadFloat32; |
| 766 break; | 760 break; |
| 767 case MachineRepresentation::kFloat64: | 761 case MachineRepresentation::kFloat64: |
| 768 opcode = kCheckedLoadFloat64; | 762 opcode = kCheckedLoadFloat64; |
| 769 break; | 763 break; |
| 770 case MachineRepresentation::kBit: // Fall through. | 764 case MachineRepresentation::kBit: // Fall through. |
| 771 case MachineRepresentation::kTaggedSigned: // Fall through. | 765 case MachineRepresentation::kTaggedSigned: // Fall through. |
| 772 case MachineRepresentation::kTaggedPointer: // Fall through. | 766 case MachineRepresentation::kTaggedPointer: // Fall through. |
| 773 case MachineRepresentation::kTagged: // Fall through. | 767 case MachineRepresentation::kTagged: // Fall through. |
| 774 case MachineRepresentation::kSimd128: // Fall through. | 768 case MachineRepresentation::kSimd128: // Fall through. |
| 775 case MachineRepresentation::kSimd1x4: // Fall through. | |
| 776 case MachineRepresentation::kSimd1x8: // Fall through. | |
| 777 case MachineRepresentation::kSimd1x16: // Fall through. | |
| 778 case MachineRepresentation::kNone: | 769 case MachineRepresentation::kNone: |
| 779 UNREACHABLE(); | 770 UNREACHABLE(); |
| 780 return; | 771 return; |
| 781 } | 772 } |
| 782 // If the length is a constant power of two, allow the code generator to | 773 // If the length is a constant power of two, allow the code generator to |
| 783 // pick a more efficient bounds check sequence by passing the length as an | 774 // pick a more efficient bounds check sequence by passing the length as an |
| 784 // immediate. | 775 // immediate. |
| 785 if (length->opcode() == IrOpcode::kInt32Constant) { | 776 if (length->opcode() == IrOpcode::kInt32Constant) { |
| 786 Int32Matcher m(length); | 777 Int32Matcher m(length); |
| 787 if (m.IsPowerOf2()) { | 778 if (m.IsPowerOf2()) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 opcode = kCheckedStoreFloat32; | 811 opcode = kCheckedStoreFloat32; |
| 821 break; | 812 break; |
| 822 case MachineRepresentation::kFloat64: | 813 case MachineRepresentation::kFloat64: |
| 823 opcode = kCheckedStoreFloat64; | 814 opcode = kCheckedStoreFloat64; |
| 824 break; | 815 break; |
| 825 case MachineRepresentation::kBit: // Fall through. | 816 case MachineRepresentation::kBit: // Fall through. |
| 826 case MachineRepresentation::kTaggedSigned: // Fall through. | 817 case MachineRepresentation::kTaggedSigned: // Fall through. |
| 827 case MachineRepresentation::kTaggedPointer: // Fall through. | 818 case MachineRepresentation::kTaggedPointer: // Fall through. |
| 828 case MachineRepresentation::kTagged: // Fall through. | 819 case MachineRepresentation::kTagged: // Fall through. |
| 829 case MachineRepresentation::kSimd128: // Fall through. | 820 case MachineRepresentation::kSimd128: // Fall through. |
| 830 case MachineRepresentation::kSimd1x4: // Fall through. | |
| 831 case MachineRepresentation::kSimd1x8: // Fall through. | |
| 832 case MachineRepresentation::kSimd1x16: // Fall through. | |
| 833 case MachineRepresentation::kNone: | 821 case MachineRepresentation::kNone: |
| 834 UNREACHABLE(); | 822 UNREACHABLE(); |
| 835 return; | 823 return; |
| 836 } | 824 } |
| 837 // If the length is a constant power of two, allow the code generator to | 825 // If the length is a constant power of two, allow the code generator to |
| 838 // pick a more efficient bounds check sequence by passing the length as an | 826 // pick a more efficient bounds check sequence by passing the length as an |
| 839 // immediate. | 827 // immediate. |
| 840 if (length->opcode() == IrOpcode::kInt32Constant) { | 828 if (length->opcode() == IrOpcode::kInt32Constant) { |
| 841 Int32Matcher m(length); | 829 Int32Matcher m(length); |
| 842 if (m.IsPowerOf2()) { | 830 if (m.IsPowerOf2()) { |
| (...skipping 2028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2871 // static | 2859 // static |
| 2872 MachineOperatorBuilder::AlignmentRequirements | 2860 MachineOperatorBuilder::AlignmentRequirements |
| 2873 InstructionSelector::AlignmentRequirements() { | 2861 InstructionSelector::AlignmentRequirements() { |
| 2874 return MachineOperatorBuilder::AlignmentRequirements:: | 2862 return MachineOperatorBuilder::AlignmentRequirements:: |
| 2875 FullUnalignedAccessSupport(); | 2863 FullUnalignedAccessSupport(); |
| 2876 } | 2864 } |
| 2877 | 2865 |
| 2878 } // namespace compiler | 2866 } // namespace compiler |
| 2879 } // namespace internal | 2867 } // namespace internal |
| 2880 } // namespace v8 | 2868 } // namespace v8 |
| OLD | NEW |