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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 EXPECT_EQ(0, op->ControlOutputCount()); | 185 EXPECT_EQ(0, op->ControlOutputCount()); |
186 } | 186 } |
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 + 1, op->ValueInputCount()); |
196 EXPECT_EQ(1, op->EffectInputCount()); | 196 EXPECT_EQ(1, op->EffectInputCount()); |
197 EXPECT_EQ(1, op->ControlInputCount()); | 197 EXPECT_EQ(1, op->ControlInputCount()); |
198 EXPECT_EQ(2 + input_count, OperatorProperties::GetTotalInputCount(op)); | 198 EXPECT_EQ(3 + input_count, OperatorProperties::GetTotalInputCount(op)); |
199 EXPECT_EQ(0, op->ValueOutputCount()); | 199 EXPECT_EQ(0, op->ValueOutputCount()); |
200 EXPECT_EQ(0, op->EffectOutputCount()); | 200 EXPECT_EQ(0, op->EffectOutputCount()); |
201 EXPECT_EQ(1, op->ControlOutputCount()); | 201 EXPECT_EQ(1, op->ControlOutputCount()); |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 | 205 |
206 TEST_F(CommonOperatorTest, Branch) { | 206 TEST_F(CommonOperatorTest, Branch) { |
207 TRACED_FOREACH(BranchHint, hint, kBranchHints) { | 207 TRACED_FOREACH(BranchHint, hint, kBranchHints) { |
208 const Operator* const op = common()->Branch(hint); | 208 const Operator* const op = common()->Branch(hint); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 EXPECT_EQ(2, OperatorProperties::GetTotalInputCount(op)); | 383 EXPECT_EQ(2, OperatorProperties::GetTotalInputCount(op)); |
384 EXPECT_EQ(0, op->ControlOutputCount()); | 384 EXPECT_EQ(0, op->ControlOutputCount()); |
385 EXPECT_EQ(0, op->EffectOutputCount()); | 385 EXPECT_EQ(0, op->EffectOutputCount()); |
386 EXPECT_EQ(1, op->ValueOutputCount()); | 386 EXPECT_EQ(1, op->ValueOutputCount()); |
387 } | 387 } |
388 } | 388 } |
389 | 389 |
390 } // namespace compiler | 390 } // namespace compiler |
391 } // namespace internal | 391 } // namespace internal |
392 } // namespace v8 | 392 } // namespace v8 |
OLD | NEW |