| 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 const Operator* op1 = common()->NumberConstant(v1); | 355 const Operator* op1 = common()->NumberConstant(v1); |
| 356 const Operator* op2 = common()->NumberConstant(v2); | 356 const Operator* op2 = common()->NumberConstant(v2); |
| 357 EXPECT_EQ(bit_cast<uint64_t>(v1) == bit_cast<uint64_t>(v2), | 357 EXPECT_EQ(bit_cast<uint64_t>(v1) == bit_cast<uint64_t>(v2), |
| 358 op1->Equals(op2)); | 358 op1->Equals(op2)); |
| 359 } | 359 } |
| 360 } | 360 } |
| 361 } | 361 } |
| 362 | 362 |
| 363 | 363 |
| 364 TEST_F(CommonOperatorTest, BeginRegion) { | 364 TEST_F(CommonOperatorTest, BeginRegion) { |
| 365 const Operator* op = common()->BeginRegion(); | 365 { |
| 366 EXPECT_EQ(1, op->EffectInputCount()); | 366 const Operator* op = |
| 367 EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op)); | 367 common()->BeginRegion(RegionObservability::kObservable); |
| 368 EXPECT_EQ(0, op->ControlOutputCount()); | 368 EXPECT_EQ(1, op->EffectInputCount()); |
| 369 EXPECT_EQ(1, op->EffectOutputCount()); | 369 EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op)); |
| 370 EXPECT_EQ(0, op->ValueOutputCount()); | 370 EXPECT_EQ(0, op->ControlOutputCount()); |
| 371 EXPECT_EQ(1, op->EffectOutputCount()); |
| 372 EXPECT_EQ(0, op->ValueOutputCount()); |
| 373 } |
| 374 { |
| 375 const Operator* op = |
| 376 common()->BeginRegion(RegionObservability::kNotObservable); |
| 377 EXPECT_EQ(1, op->EffectInputCount()); |
| 378 EXPECT_EQ(1, OperatorProperties::GetTotalInputCount(op)); |
| 379 EXPECT_EQ(0, op->ControlOutputCount()); |
| 380 EXPECT_EQ(1, op->EffectOutputCount()); |
| 381 EXPECT_EQ(0, op->ValueOutputCount()); |
| 382 } |
| 371 } | 383 } |
| 372 | 384 |
| 373 | |
| 374 TEST_F(CommonOperatorTest, FinishRegion) { | 385 TEST_F(CommonOperatorTest, FinishRegion) { |
| 375 const Operator* op = common()->FinishRegion(); | 386 const Operator* op = common()->FinishRegion(); |
| 376 EXPECT_EQ(1, op->ValueInputCount()); | 387 EXPECT_EQ(1, op->ValueInputCount()); |
| 377 EXPECT_EQ(1, op->EffectInputCount()); | 388 EXPECT_EQ(1, op->EffectInputCount()); |
| 378 EXPECT_EQ(2, OperatorProperties::GetTotalInputCount(op)); | 389 EXPECT_EQ(2, OperatorProperties::GetTotalInputCount(op)); |
| 379 EXPECT_EQ(0, op->ControlOutputCount()); | 390 EXPECT_EQ(0, op->ControlOutputCount()); |
| 380 EXPECT_EQ(1, op->EffectOutputCount()); | 391 EXPECT_EQ(1, op->EffectOutputCount()); |
| 381 EXPECT_EQ(1, op->ValueOutputCount()); | 392 EXPECT_EQ(1, op->ValueOutputCount()); |
| 382 } | 393 } |
| 383 | 394 |
| 384 } // namespace compiler | 395 } // namespace compiler |
| 385 } // namespace internal | 396 } // namespace internal |
| 386 } // namespace v8 | 397 } // namespace v8 |
| OLD | NEW |