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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 | 6 |
7 #include "src/assembler.h" | 7 #include "src/assembler.h" |
8 #include "src/base/lazy-instance.h" | 8 #include "src/base/lazy-instance.h" |
9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
10 #include "src/compiler/opcodes.h" | 10 #include "src/compiler/opcodes.h" |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 CACHED_PARAMETER_LIST(CACHED_PARAMETER) | 462 CACHED_PARAMETER_LIST(CACHED_PARAMETER) |
463 #undef CACHED_PARAMETER | 463 #undef CACHED_PARAMETER |
464 | 464 |
465 template <size_t kIndex> | 465 template <size_t kIndex> |
466 struct ProjectionOperator final : public Operator1<size_t> { | 466 struct ProjectionOperator final : public Operator1<size_t> { |
467 ProjectionOperator() | 467 ProjectionOperator() |
468 : Operator1<size_t>( // -- | 468 : Operator1<size_t>( // -- |
469 IrOpcode::kProjection, // opcode | 469 IrOpcode::kProjection, // opcode |
470 Operator::kPure, // flags | 470 Operator::kPure, // flags |
471 "Projection", // name | 471 "Projection", // name |
472 1, 0, 0, 1, 0, 0, // counts, | 472 1, 0, 1, 1, 0, 0, // counts, |
473 kIndex) {} // parameter | 473 kIndex) {} // parameter |
474 }; | 474 }; |
475 #define CACHED_PROJECTION(index) \ | 475 #define CACHED_PROJECTION(index) \ |
476 ProjectionOperator<index> kProjection##index##Operator; | 476 ProjectionOperator<index> kProjection##index##Operator; |
477 CACHED_PROJECTION_LIST(CACHED_PROJECTION) | 477 CACHED_PROJECTION_LIST(CACHED_PROJECTION) |
478 #undef CACHED_PROJECTION | 478 #undef CACHED_PROJECTION |
479 | 479 |
480 template <int kInputCount> | 480 template <int kInputCount> |
481 struct StateValuesOperator final : public Operator { | 481 struct StateValuesOperator final : public Operator { |
482 StateValuesOperator() | 482 StateValuesOperator() |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 switch (index) { | 908 switch (index) { |
909 #define CACHED_PROJECTION(index) \ | 909 #define CACHED_PROJECTION(index) \ |
910 case index: \ | 910 case index: \ |
911 return &cache_.kProjection##index##Operator; | 911 return &cache_.kProjection##index##Operator; |
912 CACHED_PROJECTION_LIST(CACHED_PROJECTION) | 912 CACHED_PROJECTION_LIST(CACHED_PROJECTION) |
913 #undef CACHED_PROJECTION | 913 #undef CACHED_PROJECTION |
914 default: | 914 default: |
915 break; | 915 break; |
916 } | 916 } |
917 // Uncached. | 917 // Uncached. |
918 return new (zone()) Operator1<size_t>( // -- | 918 return new (zone()) Operator1<size_t>( // -- |
919 IrOpcode::kProjection, // opcode | 919 IrOpcode::kProjection, // opcode |
920 Operator::kFoldable | Operator::kNoThrow, // flags | 920 Operator::kPure, // flags |
921 "Projection", // name | 921 "Projection", // name |
922 1, 0, 0, 1, 0, 0, // counts | 922 1, 0, 1, 1, 0, 0, // counts |
923 index); // parameter | 923 index); // parameter |
924 } | 924 } |
925 | 925 |
926 | 926 |
927 const Operator* CommonOperatorBuilder::ResizeMergeOrPhi(const Operator* op, | 927 const Operator* CommonOperatorBuilder::ResizeMergeOrPhi(const Operator* op, |
928 int size) { | 928 int size) { |
929 if (op->opcode() == IrOpcode::kPhi) { | 929 if (op->opcode() == IrOpcode::kPhi) { |
930 return Phi(PhiRepresentationOf(op), size); | 930 return Phi(PhiRepresentationOf(op), size); |
931 } else if (op->opcode() == IrOpcode::kEffectPhi) { | 931 } else if (op->opcode() == IrOpcode::kEffectPhi) { |
932 return EffectPhi(size); | 932 return EffectPhi(size); |
933 } else if (op->opcode() == IrOpcode::kMerge) { | 933 } else if (op->opcode() == IrOpcode::kMerge) { |
(...skipping 11 matching lines...) Expand all Loading... |
945 CommonOperatorBuilder::CreateFrameStateFunctionInfo( | 945 CommonOperatorBuilder::CreateFrameStateFunctionInfo( |
946 FrameStateType type, int parameter_count, int local_count, | 946 FrameStateType type, int parameter_count, int local_count, |
947 Handle<SharedFunctionInfo> shared_info) { | 947 Handle<SharedFunctionInfo> shared_info) { |
948 return new (zone()->New(sizeof(FrameStateFunctionInfo))) | 948 return new (zone()->New(sizeof(FrameStateFunctionInfo))) |
949 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); | 949 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); |
950 } | 950 } |
951 | 951 |
952 } // namespace compiler | 952 } // namespace compiler |
953 } // namespace internal | 953 } // namespace internal |
954 } // namespace v8 | 954 } // namespace v8 |
OLD | NEW |