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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 | 219 |
220 TEST_F(CommonOperatorTest, IfException) { | 220 TEST_F(CommonOperatorTest, IfException) { |
221 static const IfExceptionHint kIfExceptionHints[] = { | 221 static const IfExceptionHint kIfExceptionHints[] = { |
222 IfExceptionHint::kLocallyCaught, IfExceptionHint::kLocallyUncaught}; | 222 IfExceptionHint::kLocallyCaught, IfExceptionHint::kLocallyUncaught}; |
223 TRACED_FOREACH(IfExceptionHint, hint, kIfExceptionHints) { | 223 TRACED_FOREACH(IfExceptionHint, hint, kIfExceptionHints) { |
224 const Operator* const op = common()->IfException(hint); | 224 const Operator* const op = common()->IfException(hint); |
225 EXPECT_EQ(IrOpcode::kIfException, op->opcode()); | 225 EXPECT_EQ(IrOpcode::kIfException, op->opcode()); |
226 EXPECT_EQ(Operator::kKontrol, op->properties()); | 226 EXPECT_EQ(Operator::kKontrol, op->properties()); |
227 EXPECT_EQ(0, op->ValueInputCount()); | 227 EXPECT_EQ(0, op->ValueInputCount()); |
228 EXPECT_EQ(0, op->EffectInputCount()); | 228 EXPECT_EQ(1, op->EffectInputCount()); |
229 EXPECT_EQ(1, op->ControlInputCount()); | 229 EXPECT_EQ(1, op->ControlInputCount()); |
230 EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op)); | 230 EXPECT_EQ(2, OperatorProperties::GetTotalInputCount(op)); |
231 EXPECT_EQ(1, op->ValueOutputCount()); | 231 EXPECT_EQ(1, op->ValueOutputCount()); |
232 EXPECT_EQ(0, op->EffectOutputCount()); | 232 EXPECT_EQ(1, op->EffectOutputCount()); |
233 EXPECT_EQ(1, op->ControlOutputCount()); | 233 EXPECT_EQ(1, op->ControlOutputCount()); |
234 } | 234 } |
235 } | 235 } |
236 | 236 |
237 | 237 |
238 TEST_F(CommonOperatorTest, Switch) { | 238 TEST_F(CommonOperatorTest, Switch) { |
239 TRACED_FOREACH(size_t, cases, kCases) { | 239 TRACED_FOREACH(size_t, cases, kCases) { |
240 const Operator* const op = common()->Switch(cases); | 240 const Operator* const op = common()->Switch(cases); |
241 EXPECT_EQ(IrOpcode::kSwitch, op->opcode()); | 241 EXPECT_EQ(IrOpcode::kSwitch, op->opcode()); |
242 EXPECT_EQ(Operator::kKontrol, op->properties()); | 242 EXPECT_EQ(Operator::kKontrol, op->properties()); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 EXPECT_EQ(arguments + 1, OperatorProperties::GetTotalInputCount(op)); | 375 EXPECT_EQ(arguments + 1, OperatorProperties::GetTotalInputCount(op)); |
376 EXPECT_EQ(0, op->ControlOutputCount()); | 376 EXPECT_EQ(0, op->ControlOutputCount()); |
377 EXPECT_EQ(0, op->EffectOutputCount()); | 377 EXPECT_EQ(0, op->EffectOutputCount()); |
378 EXPECT_EQ(1, op->ValueOutputCount()); | 378 EXPECT_EQ(1, op->ValueOutputCount()); |
379 } | 379 } |
380 } | 380 } |
381 | 381 |
382 } // namespace compiler | 382 } // namespace compiler |
383 } // namespace internal | 383 } // namespace internal |
384 } // namespace v8 | 384 } // namespace v8 |
OLD | NEW |