| 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/unique.h" | 10 #include "src/unique.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 struct CommonOperatorBuilderImpl FINAL { | 68 struct CommonOperatorBuilderImpl FINAL { |
| 69 #define SHARED(Name, properties, value_input_count, control_input_count) \ | 69 #define SHARED(Name, properties, value_input_count, control_input_count) \ |
| 70 struct Name##Operator FINAL : public ControlOperator { \ | 70 struct Name##Operator FINAL : public ControlOperator { \ |
| 71 Name##Operator() \ | 71 Name##Operator() \ |
| 72 : ControlOperator(IrOpcode::k##Name, properties, value_input_count, 0, \ | 72 : ControlOperator(IrOpcode::k##Name, properties, value_input_count, 0, \ |
| 73 control_input_count, #Name) {} \ | 73 control_input_count, #Name) {} \ |
| 74 }; \ | 74 }; \ |
| 75 Name##Operator k##Name##Operator; | 75 Name##Operator k##Name##Operator; |
| 76 SHARED_OP_LIST(SHARED) | 76 SHARED_OP_LIST(SHARED) |
| 77 #undef SHARED | 77 #undef SHARED |
| 78 | |
| 79 struct ControlEffectOperator FINAL : public SimpleOperator { | |
| 80 ControlEffectOperator() | |
| 81 : SimpleOperator(IrOpcode::kControlEffect, Operator::kPure, 0, 0, | |
| 82 "ControlEffect") {} | |
| 83 }; | |
| 84 ControlEffectOperator kControlEffectOperator; | |
| 85 }; | 78 }; |
| 86 | 79 |
| 87 | 80 |
| 88 static base::LazyInstance<CommonOperatorBuilderImpl>::type kImpl = | 81 static base::LazyInstance<CommonOperatorBuilderImpl>::type kImpl = |
| 89 LAZY_INSTANCE_INITIALIZER; | 82 LAZY_INSTANCE_INITIALIZER; |
| 90 | 83 |
| 91 | 84 |
| 92 CommonOperatorBuilder::CommonOperatorBuilder(Zone* zone) | 85 CommonOperatorBuilder::CommonOperatorBuilder(Zone* zone) |
| 93 : impl_(kImpl.Get()), zone_(zone) {} | 86 : impl_(kImpl.Get()), zone_(zone) {} |
| 94 | 87 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 175 } |
| 183 | 176 |
| 184 | 177 |
| 185 const Operator* CommonOperatorBuilder::EffectPhi(int arguments) { | 178 const Operator* CommonOperatorBuilder::EffectPhi(int arguments) { |
| 186 DCHECK(arguments > 0); // Disallow empty phis. | 179 DCHECK(arguments > 0); // Disallow empty phis. |
| 187 return new (zone()) Operator1<int>(IrOpcode::kEffectPhi, Operator::kPure, 0, | 180 return new (zone()) Operator1<int>(IrOpcode::kEffectPhi, Operator::kPure, 0, |
| 188 0, "EffectPhi", arguments); | 181 0, "EffectPhi", arguments); |
| 189 } | 182 } |
| 190 | 183 |
| 191 | 184 |
| 192 const Operator* CommonOperatorBuilder::ControlEffect() { | |
| 193 return &impl_.kControlEffectOperator; | |
| 194 } | |
| 195 | |
| 196 | |
| 197 const Operator* CommonOperatorBuilder::ValueEffect(int arguments) { | 185 const Operator* CommonOperatorBuilder::ValueEffect(int arguments) { |
| 198 DCHECK(arguments > 0); // Disallow empty value effects. | 186 DCHECK(arguments > 0); // Disallow empty value effects. |
| 199 return new (zone()) SimpleOperator(IrOpcode::kValueEffect, Operator::kPure, | 187 return new (zone()) SimpleOperator(IrOpcode::kValueEffect, Operator::kPure, |
| 200 arguments, 0, "ValueEffect"); | 188 arguments, 0, "ValueEffect"); |
| 201 } | 189 } |
| 202 | 190 |
| 203 | 191 |
| 204 const Operator* CommonOperatorBuilder::Finish(int arguments) { | 192 const Operator* CommonOperatorBuilder::Finish(int arguments) { |
| 205 DCHECK(arguments > 0); // Disallow empty finishes. | 193 DCHECK(arguments > 0); // Disallow empty finishes. |
| 206 return new (zone()) Operator1<int>(IrOpcode::kFinish, Operator::kPure, 1, 1, | 194 return new (zone()) Operator1<int>(IrOpcode::kFinish, Operator::kPure, 1, 1, |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 } | 277 } |
| 290 | 278 |
| 291 | 279 |
| 292 bool OutputFrameStateCombine::IsOutputIgnored() { | 280 bool OutputFrameStateCombine::IsOutputIgnored() { |
| 293 return kind() == kPushOutput && GetPushCount() == 0; | 281 return kind() == kPushOutput && GetPushCount() == 0; |
| 294 } | 282 } |
| 295 | 283 |
| 296 } // namespace compiler | 284 } // namespace compiler |
| 297 } // namespace internal | 285 } // namespace internal |
| 298 } // namespace v8 | 286 } // namespace v8 |
| OLD | NEW |