| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 187 } |
| 188 | 188 |
| 189 | 189 |
| 190 TEST_F(CommonOperatorTest, Return) { | 190 TEST_F(CommonOperatorTest, Return) { |
| 191 TRACED_FOREACH(int, input_count, kArguments) { | 191 TRACED_FOREACH(int, input_count, kArguments) { |
| 192 const Operator* const op = common()->Return(input_count); | 192 const Operator* const op = common()->Return(input_count); |
| 193 EXPECT_EQ(IrOpcode::kReturn, op->opcode()); | 193 EXPECT_EQ(IrOpcode::kReturn, op->opcode()); |
| 194 EXPECT_EQ(Operator::kNoThrow, op->properties()); | 194 EXPECT_EQ(Operator::kNoThrow, op->properties()); |
| 195 EXPECT_EQ(input_count, op->ValueInputCount()); | 195 EXPECT_EQ(input_count, op->ValueInputCount()); |
| 196 EXPECT_EQ(1, op->EffectInputCount()); | 196 EXPECT_EQ(1, op->EffectInputCount()); |
| 197 EXPECT_EQ(1, static_cast<uint32_t>(op->ControlInputCount())); | 197 EXPECT_EQ(1, op->ControlInputCount()); |
| 198 EXPECT_EQ(2 + input_count, static_cast<uint32_t>( | 198 EXPECT_EQ(2 + input_count, OperatorProperties::GetTotalInputCount(op)); |
| 199 OperatorProperties::GetTotalInputCount(op))); | |
| 200 EXPECT_EQ(0, op->ValueOutputCount()); | 199 EXPECT_EQ(0, op->ValueOutputCount()); |
| 201 EXPECT_EQ(0, op->EffectOutputCount()); | 200 EXPECT_EQ(0, op->EffectOutputCount()); |
| 202 EXPECT_EQ(1, op->ControlOutputCount()); | 201 EXPECT_EQ(1, op->ControlOutputCount()); |
| 203 } | 202 } |
| 204 } | 203 } |
| 205 | 204 |
| 206 | 205 |
| 207 TEST_F(CommonOperatorTest, Branch) { | 206 TEST_F(CommonOperatorTest, Branch) { |
| 208 TRACED_FOREACH(BranchHint, hint, kBranchHints) { | 207 TRACED_FOREACH(BranchHint, hint, kBranchHints) { |
| 209 const Operator* const op = common()->Branch(hint); | 208 const Operator* const op = common()->Branch(hint); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 EXPECT_EQ(arguments + 1, OperatorProperties::GetTotalInputCount(op)); | 378 EXPECT_EQ(arguments + 1, OperatorProperties::GetTotalInputCount(op)); |
| 380 EXPECT_EQ(0, op->ControlOutputCount()); | 379 EXPECT_EQ(0, op->ControlOutputCount()); |
| 381 EXPECT_EQ(0, op->EffectOutputCount()); | 380 EXPECT_EQ(0, op->EffectOutputCount()); |
| 382 EXPECT_EQ(1, op->ValueOutputCount()); | 381 EXPECT_EQ(1, op->ValueOutputCount()); |
| 383 } | 382 } |
| 384 } | 383 } |
| 385 | 384 |
| 386 } // namespace compiler | 385 } // namespace compiler |
| 387 } // namespace internal | 386 } // namespace internal |
| 388 } // namespace v8 | 387 } // namespace v8 |
| OLD | NEW |