| 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/compiler/machine-operator.h" | 5 #include "src/compiler/machine-operator.h" |
| 6 | 6 |
| 7 #include "src/base/lazy-instance.h" | 7 #include "src/base/lazy-instance.h" |
| 8 #include "src/compiler/opcodes.h" | 8 #include "src/compiler/opcodes.h" |
| 9 #include "src/compiler/operator.h" | 9 #include "src/compiler/operator.h" |
| 10 | 10 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 V(Uint64Mod, Operator::kNoProperties, 2, 1, 1) \ | 128 V(Uint64Mod, Operator::kNoProperties, 2, 1, 1) \ |
| 129 V(Uint64LessThan, Operator::kNoProperties, 2, 0, 1) \ | 129 V(Uint64LessThan, Operator::kNoProperties, 2, 0, 1) \ |
| 130 V(Uint64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) | 130 V(Uint64LessThanOrEqual, Operator::kNoProperties, 2, 0, 1) |
| 131 | 131 |
| 132 #define PURE_OP_LIST(V) \ | 132 #define PURE_OP_LIST(V) \ |
| 133 PURE_BINARY_OP_LIST_32(V) \ | 133 PURE_BINARY_OP_LIST_32(V) \ |
| 134 PURE_BINARY_OP_LIST_64(V) \ | 134 PURE_BINARY_OP_LIST_64(V) \ |
| 135 V(Word32Clz, Operator::kNoProperties, 1, 0, 1) \ | 135 V(Word32Clz, Operator::kNoProperties, 1, 0, 1) \ |
| 136 V(Word64Clz, Operator::kNoProperties, 1, 0, 1) \ | 136 V(Word64Clz, Operator::kNoProperties, 1, 0, 1) \ |
| 137 V(BitcastTaggedToWord, Operator::kNoProperties, 1, 0, 1) \ | 137 V(BitcastTaggedToWord, Operator::kNoProperties, 1, 0, 1) \ |
| 138 V(BitcastWordToTagged, Operator::kNoProperties, 1, 0, 1) \ | |
| 139 V(BitcastWordToTaggedSigned, Operator::kNoProperties, 1, 0, 1) \ | 138 V(BitcastWordToTaggedSigned, Operator::kNoProperties, 1, 0, 1) \ |
| 140 V(TruncateFloat64ToWord32, Operator::kNoProperties, 1, 0, 1) \ | 139 V(TruncateFloat64ToWord32, Operator::kNoProperties, 1, 0, 1) \ |
| 141 V(ChangeFloat32ToFloat64, Operator::kNoProperties, 1, 0, 1) \ | 140 V(ChangeFloat32ToFloat64, Operator::kNoProperties, 1, 0, 1) \ |
| 142 V(ChangeFloat64ToInt32, Operator::kNoProperties, 1, 0, 1) \ | 141 V(ChangeFloat64ToInt32, Operator::kNoProperties, 1, 0, 1) \ |
| 143 V(ChangeFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \ | 142 V(ChangeFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \ |
| 144 V(TruncateFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \ | 143 V(TruncateFloat64ToUint32, Operator::kNoProperties, 1, 0, 1) \ |
| 145 V(TruncateFloat32ToInt32, Operator::kNoProperties, 1, 0, 1) \ | 144 V(TruncateFloat32ToInt32, Operator::kNoProperties, 1, 0, 1) \ |
| 146 V(TruncateFloat32ToUint32, Operator::kNoProperties, 1, 0, 1) \ | 145 V(TruncateFloat32ToUint32, Operator::kNoProperties, 1, 0, 1) \ |
| 147 V(TryTruncateFloat32ToInt64, Operator::kNoProperties, 1, 0, 2) \ | 146 V(TryTruncateFloat32ToInt64, Operator::kNoProperties, 1, 0, 2) \ |
| 148 V(TryTruncateFloat64ToInt64, Operator::kNoProperties, 1, 0, 2) \ | 147 V(TryTruncateFloat64ToInt64, Operator::kNoProperties, 1, 0, 2) \ |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 AtomicExchange##Type##Operator() \ | 599 AtomicExchange##Type##Operator() \ |
| 601 : Operator1<MachineType>(IrOpcode::kAtomicExchange, \ | 600 : Operator1<MachineType>(IrOpcode::kAtomicExchange, \ |
| 602 Operator::kNoDeopt | Operator::kNoThrow, \ | 601 Operator::kNoDeopt | Operator::kNoThrow, \ |
| 603 "AtomicExchange", 3, 1, 1, 1, 1, 0, \ | 602 "AtomicExchange", 3, 1, 1, 1, 1, 0, \ |
| 604 MachineType::Type()) {} \ | 603 MachineType::Type()) {} \ |
| 605 }; \ | 604 }; \ |
| 606 AtomicExchange##Type##Operator kAtomicExchange##Type; | 605 AtomicExchange##Type##Operator kAtomicExchange##Type; |
| 607 ATOMIC_TYPE_LIST(ATOMIC_EXCHANGE) | 606 ATOMIC_TYPE_LIST(ATOMIC_EXCHANGE) |
| 608 #undef ATOMIC_EXCHANGE | 607 #undef ATOMIC_EXCHANGE |
| 609 | 608 |
| 609 // The {BitcastWordToTagged} operator must not be marked as pure (especially |
| 610 // not idempotent), because otherwise the splitting logic in the Scheduler |
| 611 // might decide to split these operators, thus potentially creating live |
| 612 // ranges of allocation top across calls or other things that might allocate. |
| 613 // See https://bugs.chromium.org/p/v8/issues/detail?id=6059 for more details. |
| 614 struct BitcastWordToTaggedOperator : public Operator { |
| 615 BitcastWordToTaggedOperator() |
| 616 : Operator(IrOpcode::kBitcastWordToTagged, |
| 617 Operator::kEliminatable | Operator::kNoWrite, |
| 618 "BitcastWordToTagged", 1, 0, 0, 1, 0, 0) {} |
| 619 }; |
| 620 BitcastWordToTaggedOperator kBitcastWordToTagged; |
| 621 |
| 610 struct DebugBreakOperator : public Operator { | 622 struct DebugBreakOperator : public Operator { |
| 611 DebugBreakOperator() | 623 DebugBreakOperator() |
| 612 : Operator(IrOpcode::kDebugBreak, Operator::kNoThrow, "DebugBreak", 0, | 624 : Operator(IrOpcode::kDebugBreak, Operator::kNoThrow, "DebugBreak", 0, |
| 613 0, 0, 0, 0, 0) {} | 625 0, 0, 0, 0, 0) {} |
| 614 }; | 626 }; |
| 615 DebugBreakOperator kDebugBreak; | 627 DebugBreakOperator kDebugBreak; |
| 616 | 628 |
| 617 struct UnsafePointerAddOperator final : public Operator { | 629 struct UnsafePointerAddOperator final : public Operator { |
| 618 UnsafePointerAddOperator() | 630 UnsafePointerAddOperator() |
| 619 : Operator(IrOpcode::kUnsafePointerAdd, Operator::kKontrol, | 631 : Operator(IrOpcode::kUnsafePointerAdd, Operator::kKontrol, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 break; | 789 break; |
| 778 } | 790 } |
| 779 UNREACHABLE(); | 791 UNREACHABLE(); |
| 780 return nullptr; | 792 return nullptr; |
| 781 } | 793 } |
| 782 | 794 |
| 783 const Operator* MachineOperatorBuilder::UnsafePointerAdd() { | 795 const Operator* MachineOperatorBuilder::UnsafePointerAdd() { |
| 784 return &cache_.kUnsafePointerAdd; | 796 return &cache_.kUnsafePointerAdd; |
| 785 } | 797 } |
| 786 | 798 |
| 799 const Operator* MachineOperatorBuilder::BitcastWordToTagged() { |
| 800 return &cache_.kBitcastWordToTagged; |
| 801 } |
| 802 |
| 787 const Operator* MachineOperatorBuilder::DebugBreak() { | 803 const Operator* MachineOperatorBuilder::DebugBreak() { |
| 788 return &cache_.kDebugBreak; | 804 return &cache_.kDebugBreak; |
| 789 } | 805 } |
| 790 | 806 |
| 791 const Operator* MachineOperatorBuilder::Comment(const char* msg) { | 807 const Operator* MachineOperatorBuilder::Comment(const char* msg) { |
| 792 return new (zone_) CommentOperator(msg); | 808 return new (zone_) CommentOperator(msg); |
| 793 } | 809 } |
| 794 | 810 |
| 795 const Operator* MachineOperatorBuilder::CheckedLoad( | 811 const Operator* MachineOperatorBuilder::CheckedLoad( |
| 796 CheckedLoadRepresentation rep) { | 812 CheckedLoadRepresentation rep) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 return new (zone_) \ | 923 return new (zone_) \ |
| 908 Operator1<uint32_t>(IrOpcode::kSimd##format##Swizzle, Operator::kPure, \ | 924 Operator1<uint32_t>(IrOpcode::kSimd##format##Swizzle, Operator::kPure, \ |
| 909 "Swizzle", 2, 0, 0, 1, 0, 0, swizzle); \ | 925 "Swizzle", 2, 0, 0, 1, 0, 0, swizzle); \ |
| 910 } | 926 } |
| 911 SIMD_FORMAT_LIST(SIMD_PERMUTE_OPS) | 927 SIMD_FORMAT_LIST(SIMD_PERMUTE_OPS) |
| 912 #undef SIMD_PERMUTE_OPS | 928 #undef SIMD_PERMUTE_OPS |
| 913 | 929 |
| 914 } // namespace compiler | 930 } // namespace compiler |
| 915 } // namespace internal | 931 } // namespace internal |
| 916 } // namespace v8 | 932 } // namespace v8 |
| OLD | NEW |