| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/simplified-operator.h" | 5 #include "src/compiler/simplified-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 #include "src/compiler/types.h" | 10 #include "src/compiler/types.h" |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 struct AllocateOperator final : public Operator1<PretenureFlag> { | 650 struct AllocateOperator final : public Operator1<PretenureFlag> { |
| 651 AllocateOperator() | 651 AllocateOperator() |
| 652 : Operator1<PretenureFlag>( | 652 : Operator1<PretenureFlag>( |
| 653 IrOpcode::kAllocate, | 653 IrOpcode::kAllocate, |
| 654 Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, | 654 Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, |
| 655 "Allocate", 1, 1, 1, 1, 1, 0, kPretenure) {} | 655 "Allocate", 1, 1, 1, 1, 1, 0, kPretenure) {} |
| 656 }; | 656 }; |
| 657 AllocateOperator<NOT_TENURED> kAllocateNotTenuredOperator; | 657 AllocateOperator<NOT_TENURED> kAllocateNotTenuredOperator; |
| 658 AllocateOperator<TENURED> kAllocateTenuredOperator; | 658 AllocateOperator<TENURED> kAllocateTenuredOperator; |
| 659 | 659 |
| 660 struct LoadFieldByIndexOperator final : public Operator { |
| 661 LoadFieldByIndexOperator() |
| 662 : Operator( // -- |
| 663 IrOpcode::kLoadFieldByIndex, // opcode |
| 664 Operator::kEliminatable, // flags, |
| 665 "LoadFieldByIndex", // name |
| 666 2, 1, 1, 1, 1, 0) {} // counts; |
| 667 }; |
| 668 LoadFieldByIndexOperator kLoadFieldByIndex; |
| 669 |
| 660 struct EnsureWritableFastElementsOperator final : public Operator { | 670 struct EnsureWritableFastElementsOperator final : public Operator { |
| 661 EnsureWritableFastElementsOperator() | 671 EnsureWritableFastElementsOperator() |
| 662 : Operator( // -- | 672 : Operator( // -- |
| 663 IrOpcode::kEnsureWritableFastElements, // opcode | 673 IrOpcode::kEnsureWritableFastElements, // opcode |
| 664 Operator::kNoDeopt | Operator::kNoThrow, // flags | 674 Operator::kNoDeopt | Operator::kNoThrow, // flags |
| 665 "EnsureWritableFastElements", // name | 675 "EnsureWritableFastElements", // name |
| 666 2, 1, 1, 1, 1, 0) {} // counts | 676 2, 1, 1, 1, 1, 0) {} // counts |
| 667 }; | 677 }; |
| 668 EnsureWritableFastElementsOperator kEnsureWritableFastElements; | 678 EnsureWritableFastElementsOperator kEnsureWritableFastElements; |
| 669 | 679 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 | 724 |
| 715 SimplifiedOperatorBuilder::SimplifiedOperatorBuilder(Zone* zone) | 725 SimplifiedOperatorBuilder::SimplifiedOperatorBuilder(Zone* zone) |
| 716 : cache_(kCache.Get()), zone_(zone) {} | 726 : cache_(kCache.Get()), zone_(zone) {} |
| 717 | 727 |
| 718 #define GET_FROM_CACHE(Name, ...) \ | 728 #define GET_FROM_CACHE(Name, ...) \ |
| 719 const Operator* SimplifiedOperatorBuilder::Name() { return &cache_.k##Name; } | 729 const Operator* SimplifiedOperatorBuilder::Name() { return &cache_.k##Name; } |
| 720 PURE_OP_LIST(GET_FROM_CACHE) | 730 PURE_OP_LIST(GET_FROM_CACHE) |
| 721 CHECKED_OP_LIST(GET_FROM_CACHE) | 731 CHECKED_OP_LIST(GET_FROM_CACHE) |
| 722 GET_FROM_CACHE(ArrayBufferWasNeutered) | 732 GET_FROM_CACHE(ArrayBufferWasNeutered) |
| 723 GET_FROM_CACHE(ArgumentsFrame) | 733 GET_FROM_CACHE(ArgumentsFrame) |
| 734 GET_FROM_CACHE(LoadFieldByIndex) |
| 724 GET_FROM_CACHE(NewUnmappedArgumentsElements) | 735 GET_FROM_CACHE(NewUnmappedArgumentsElements) |
| 725 #undef GET_FROM_CACHE | 736 #undef GET_FROM_CACHE |
| 726 | 737 |
| 727 const Operator* SimplifiedOperatorBuilder::CheckedInt32Mul( | 738 const Operator* SimplifiedOperatorBuilder::CheckedInt32Mul( |
| 728 CheckForMinusZeroMode mode) { | 739 CheckForMinusZeroMode mode) { |
| 729 switch (mode) { | 740 switch (mode) { |
| 730 case CheckForMinusZeroMode::kCheckForMinusZero: | 741 case CheckForMinusZeroMode::kCheckForMinusZero: |
| 731 return &cache_.kCheckedInt32MulCheckForMinusZeroOperator; | 742 return &cache_.kCheckedInt32MulCheckForMinusZeroOperator; |
| 732 case CheckForMinusZeroMode::kDontCheckForMinusZero: | 743 case CheckForMinusZeroMode::kDontCheckForMinusZero: |
| 733 return &cache_.kCheckedInt32MulDontCheckForMinusZeroOperator; | 744 return &cache_.kCheckedInt32MulDontCheckForMinusZeroOperator; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 Operator::kNoDeopt | Operator::kNoThrow | properties, \ | 958 Operator::kNoDeopt | Operator::kNoThrow | properties, \ |
| 948 #Name, value_input_count, 1, control_input_count, \ | 959 #Name, value_input_count, 1, control_input_count, \ |
| 949 output_count, 1, 0, access); \ | 960 output_count, 1, 0, access); \ |
| 950 } | 961 } |
| 951 ACCESS_OP_LIST(ACCESS) | 962 ACCESS_OP_LIST(ACCESS) |
| 952 #undef ACCESS | 963 #undef ACCESS |
| 953 | 964 |
| 954 } // namespace compiler | 965 } // namespace compiler |
| 955 } // namespace internal | 966 } // namespace internal |
| 956 } // namespace v8 | 967 } // namespace v8 |
| OLD | NEW |