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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 1, 0, 1, 0, 0, 2, // counts | 383 1, 0, 1, 0, 0, 2, // counts |
384 kBranchHint) {} // parameter | 384 kBranchHint) {} // parameter |
385 }; | 385 }; |
386 BranchOperator<BranchHint::kNone> kBranchNoneOperator; | 386 BranchOperator<BranchHint::kNone> kBranchNoneOperator; |
387 BranchOperator<BranchHint::kTrue> kBranchTrueOperator; | 387 BranchOperator<BranchHint::kTrue> kBranchTrueOperator; |
388 BranchOperator<BranchHint::kFalse> kBranchFalseOperator; | 388 BranchOperator<BranchHint::kFalse> kBranchFalseOperator; |
389 | 389 |
390 template <int kEffectInputCount> | 390 template <int kEffectInputCount> |
391 struct EffectPhiOperator final : public Operator { | 391 struct EffectPhiOperator final : public Operator { |
392 EffectPhiOperator() | 392 EffectPhiOperator() |
393 : Operator( // -- | 393 : Operator( // -- |
394 IrOpcode::kEffectPhi, Operator::kPure, // opcode | 394 IrOpcode::kEffectPhi, Operator::kKontrol, // opcode |
395 "EffectPhi", // name | 395 "EffectPhi", // name |
396 0, kEffectInputCount, 1, 0, 1, 0) {} // counts | 396 0, kEffectInputCount, 1, 0, 1, 0) {} // counts |
397 }; | 397 }; |
398 #define CACHED_EFFECT_PHI(input_count) \ | 398 #define CACHED_EFFECT_PHI(input_count) \ |
399 EffectPhiOperator<input_count> kEffectPhi##input_count##Operator; | 399 EffectPhiOperator<input_count> kEffectPhi##input_count##Operator; |
400 CACHED_EFFECT_PHI_LIST(CACHED_EFFECT_PHI) | 400 CACHED_EFFECT_PHI_LIST(CACHED_EFFECT_PHI) |
401 #undef CACHED_EFFECT_PHI | 401 #undef CACHED_EFFECT_PHI |
402 | 402 |
403 template <RegionObservability kRegionObservability> | 403 template <RegionObservability kRegionObservability> |
404 struct BeginRegionOperator final : public Operator1<RegionObservability> { | 404 struct BeginRegionOperator final : public Operator1<RegionObservability> { |
405 BeginRegionOperator() | 405 BeginRegionOperator() |
406 : Operator1<RegionObservability>( // -- | 406 : Operator1<RegionObservability>( // -- |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 switch (effect_input_count) { | 820 switch (effect_input_count) { |
821 #define CACHED_EFFECT_PHI(input_count) \ | 821 #define CACHED_EFFECT_PHI(input_count) \ |
822 case input_count: \ | 822 case input_count: \ |
823 return &cache_.kEffectPhi##input_count##Operator; | 823 return &cache_.kEffectPhi##input_count##Operator; |
824 CACHED_EFFECT_PHI_LIST(CACHED_EFFECT_PHI) | 824 CACHED_EFFECT_PHI_LIST(CACHED_EFFECT_PHI) |
825 #undef CACHED_EFFECT_PHI | 825 #undef CACHED_EFFECT_PHI |
826 default: | 826 default: |
827 break; | 827 break; |
828 } | 828 } |
829 // Uncached. | 829 // Uncached. |
830 return new (zone()) Operator( // -- | 830 return new (zone()) Operator( // -- |
831 IrOpcode::kEffectPhi, Operator::kPure, // opcode | 831 IrOpcode::kEffectPhi, Operator::kKontrol, // opcode |
832 "EffectPhi", // name | 832 "EffectPhi", // name |
833 0, effect_input_count, 1, 0, 1, 0); // counts | 833 0, effect_input_count, 1, 0, 1, 0); // counts |
834 } | 834 } |
835 | 835 |
836 const Operator* CommonOperatorBuilder::BeginRegion( | 836 const Operator* CommonOperatorBuilder::BeginRegion( |
837 RegionObservability region_observability) { | 837 RegionObservability region_observability) { |
838 switch (region_observability) { | 838 switch (region_observability) { |
839 case RegionObservability::kObservable: | 839 case RegionObservability::kObservable: |
840 return &cache_.kBeginRegionObservableOperator; | 840 return &cache_.kBeginRegionObservableOperator; |
841 case RegionObservability::kNotObservable: | 841 case RegionObservability::kNotObservable: |
842 return &cache_.kBeginRegionNotObservableOperator; | 842 return &cache_.kBeginRegionNotObservableOperator; |
843 } | 843 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 CommonOperatorBuilder::CreateFrameStateFunctionInfo( | 972 CommonOperatorBuilder::CreateFrameStateFunctionInfo( |
973 FrameStateType type, int parameter_count, int local_count, | 973 FrameStateType type, int parameter_count, int local_count, |
974 Handle<SharedFunctionInfo> shared_info) { | 974 Handle<SharedFunctionInfo> shared_info) { |
975 return new (zone()->New(sizeof(FrameStateFunctionInfo))) | 975 return new (zone()->New(sizeof(FrameStateFunctionInfo))) |
976 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); | 976 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); |
977 } | 977 } |
978 | 978 |
979 } // namespace compiler | 979 } // namespace compiler |
980 } // namespace internal | 980 } // namespace internal |
981 } // namespace v8 | 981 } // namespace v8 |
OLD | NEW |