| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 214 } |
| 215 UNREACHABLE(); | 215 UNREACHABLE(); |
| 216 return os; | 216 return os; |
| 217 } | 217 } |
| 218 | 218 |
| 219 RegionObservability RegionObservabilityOf(Operator const* op) { | 219 RegionObservability RegionObservabilityOf(Operator const* op) { |
| 220 DCHECK_EQ(IrOpcode::kBeginRegion, op->opcode()); | 220 DCHECK_EQ(IrOpcode::kBeginRegion, op->opcode()); |
| 221 return OpParameter<RegionObservability>(op); | 221 return OpParameter<RegionObservability>(op); |
| 222 } | 222 } |
| 223 | 223 |
| 224 Type* SigmaTypeOf(Operator const* op) { |
| 225 DCHECK_EQ(IrOpcode::kSigma, op->opcode()); |
| 226 return OpParameter<Type*>(op); |
| 227 } |
| 228 |
| 224 std::ostream& operator<<(std::ostream& os, | 229 std::ostream& operator<<(std::ostream& os, |
| 225 const ZoneVector<MachineType>* types) { | 230 const ZoneVector<MachineType>* types) { |
| 226 // Print all the MachineTypes, separated by commas. | 231 // Print all the MachineTypes, separated by commas. |
| 227 bool first = true; | 232 bool first = true; |
| 228 for (MachineType elem : *types) { | 233 for (MachineType elem : *types) { |
| 229 if (!first) { | 234 if (!first) { |
| 230 os << ", "; | 235 os << ", "; |
| 231 } | 236 } |
| 232 first = false; | 237 first = false; |
| 233 os << elem; | 238 os << elem; |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 846 CACHED_PHI_LIST(CACHED_PHI) | 851 CACHED_PHI_LIST(CACHED_PHI) |
| 847 #undef CACHED_PHI | 852 #undef CACHED_PHI |
| 848 // Uncached. | 853 // Uncached. |
| 849 return new (zone()) Operator1<MachineRepresentation>( // -- | 854 return new (zone()) Operator1<MachineRepresentation>( // -- |
| 850 IrOpcode::kPhi, Operator::kPure, // opcode | 855 IrOpcode::kPhi, Operator::kPure, // opcode |
| 851 "Phi", // name | 856 "Phi", // name |
| 852 value_input_count, 0, 1, 1, 0, 0, // counts | 857 value_input_count, 0, 1, 1, 0, 0, // counts |
| 853 rep); // parameter | 858 rep); // parameter |
| 854 } | 859 } |
| 855 | 860 |
| 861 const Operator* CommonOperatorBuilder::Sigma(Type* type) { |
| 862 return new (zone()) Operator1<Type*>( // -- |
| 863 IrOpcode::kSigma, Operator::kPure, // opcode |
| 864 "Sigma", // name |
| 865 1, 0, 1, 1, 0, 0, // counts |
| 866 type); // parameter |
| 867 } |
| 856 | 868 |
| 857 const Operator* CommonOperatorBuilder::EffectPhi(int effect_input_count) { | 869 const Operator* CommonOperatorBuilder::EffectPhi(int effect_input_count) { |
| 858 DCHECK(effect_input_count > 0); // Disallow empty effect phis. | 870 DCHECK(effect_input_count > 0); // Disallow empty effect phis. |
| 859 switch (effect_input_count) { | 871 switch (effect_input_count) { |
| 860 #define CACHED_EFFECT_PHI(input_count) \ | 872 #define CACHED_EFFECT_PHI(input_count) \ |
| 861 case input_count: \ | 873 case input_count: \ |
| 862 return &cache_.kEffectPhi##input_count##Operator; | 874 return &cache_.kEffectPhi##input_count##Operator; |
| 863 CACHED_EFFECT_PHI_LIST(CACHED_EFFECT_PHI) | 875 CACHED_EFFECT_PHI_LIST(CACHED_EFFECT_PHI) |
| 864 #undef CACHED_EFFECT_PHI | 876 #undef CACHED_EFFECT_PHI |
| 865 default: | 877 default: |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 CommonOperatorBuilder::CreateFrameStateFunctionInfo( | 1042 CommonOperatorBuilder::CreateFrameStateFunctionInfo( |
| 1031 FrameStateType type, int parameter_count, int local_count, | 1043 FrameStateType type, int parameter_count, int local_count, |
| 1032 Handle<SharedFunctionInfo> shared_info) { | 1044 Handle<SharedFunctionInfo> shared_info) { |
| 1033 return new (zone()->New(sizeof(FrameStateFunctionInfo))) | 1045 return new (zone()->New(sizeof(FrameStateFunctionInfo))) |
| 1034 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); | 1046 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); |
| 1035 } | 1047 } |
| 1036 | 1048 |
| 1037 } // namespace compiler | 1049 } // namespace compiler |
| 1038 } // namespace internal | 1050 } // namespace internal |
| 1039 } // namespace v8 | 1051 } // namespace v8 |
| OLD | NEW |