| 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 <limits> | 5 #include <limits> |
| 6 | 6 |
| 7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.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/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 const SharedOperator kSharedOperators[] = { | 42 const SharedOperator kSharedOperators[] = { |
| 43 #define SHARED(Name, properties, value_input_count, effect_input_count, \ | 43 #define SHARED(Name, properties, value_input_count, effect_input_count, \ |
| 44 control_input_count, value_output_count, effect_output_count, \ | 44 control_input_count, value_output_count, effect_output_count, \ |
| 45 control_output_count) \ | 45 control_output_count) \ |
| 46 { \ | 46 { \ |
| 47 &CommonOperatorBuilder::Name, IrOpcode::k##Name, properties, \ | 47 &CommonOperatorBuilder::Name, IrOpcode::k##Name, properties, \ |
| 48 value_input_count, effect_input_count, control_input_count, \ | 48 value_input_count, effect_input_count, control_input_count, \ |
| 49 value_output_count, effect_output_count, control_output_count \ | 49 value_output_count, effect_output_count, control_output_count \ |
| 50 } | 50 } |
| 51 SHARED(Dead, Operator::kFoldable, 0, 0, 0, 1, 1, 1), |
| 51 SHARED(IfTrue, Operator::kKontrol, 0, 0, 1, 0, 0, 1), | 52 SHARED(IfTrue, Operator::kKontrol, 0, 0, 1, 0, 0, 1), |
| 52 SHARED(IfFalse, Operator::kKontrol, 0, 0, 1, 0, 0, 1), | 53 SHARED(IfFalse, Operator::kKontrol, 0, 0, 1, 0, 0, 1), |
| 53 SHARED(IfSuccess, Operator::kKontrol, 0, 0, 1, 0, 0, 1), | 54 SHARED(IfSuccess, Operator::kKontrol, 0, 0, 1, 0, 0, 1), |
| 54 SHARED(Throw, Operator::kKontrol, 1, 1, 1, 0, 0, 1), | 55 SHARED(Throw, Operator::kKontrol, 1, 1, 1, 0, 0, 1), |
| 55 SHARED(Return, Operator::kNoThrow, 1, 1, 1, 0, 0, 1), | 56 SHARED(Return, Operator::kNoThrow, 1, 1, 1, 0, 0, 1), |
| 56 SHARED(Terminate, Operator::kKontrol, 0, 1, 1, 0, 0, 1), | 57 SHARED(Terminate, Operator::kKontrol, 0, 1, 1, 0, 0, 1) |
| 57 SHARED(DeadValue, Operator::kPure, 0, 0, 0, 1, 0, 0), | |
| 58 SHARED(DeadEffect, Operator::kPure, 0, 0, 0, 0, 1, 0), | |
| 59 SHARED(DeadControl, Operator::kFoldable, 0, 0, 0, 0, 0, 1) | |
| 60 #undef SHARED | 58 #undef SHARED |
| 61 }; | 59 }; |
| 62 | 60 |
| 63 | 61 |
| 64 class CommonSharedOperatorTest | 62 class CommonSharedOperatorTest |
| 65 : public TestWithZone, | 63 : public TestWithZone, |
| 66 public ::testing::WithParamInterface<SharedOperator> {}; | 64 public ::testing::WithParamInterface<SharedOperator> {}; |
| 67 | 65 |
| 68 } // namespace | 66 } // namespace |
| 69 | 67 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 EXPECT_EQ(arguments + 1, OperatorProperties::GetTotalInputCount(op)); | 375 EXPECT_EQ(arguments + 1, OperatorProperties::GetTotalInputCount(op)); |
| 378 EXPECT_EQ(0, op->ControlOutputCount()); | 376 EXPECT_EQ(0, op->ControlOutputCount()); |
| 379 EXPECT_EQ(0, op->EffectOutputCount()); | 377 EXPECT_EQ(0, op->EffectOutputCount()); |
| 380 EXPECT_EQ(1, op->ValueOutputCount()); | 378 EXPECT_EQ(1, op->ValueOutputCount()); |
| 381 } | 379 } |
| 382 } | 380 } |
| 383 | 381 |
| 384 } // namespace compiler | 382 } // namespace compiler |
| 385 } // namespace internal | 383 } // namespace internal |
| 386 } // namespace v8 | 384 } // namespace v8 |
| OLD | NEW |