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 "test/cctest/cctest.h" | 7 #include "test/cctest/cctest.h" |
8 #include "test/cctest/compiler/codegen-tester.h" | 8 #include "test/cctest/compiler/codegen-tester.h" |
9 #include "test/cctest/compiler/graph-builder-tester.h" | 9 #include "test/cctest/compiler/graph-builder-tester.h" |
10 #include "test/cctest/compiler/value-helper.h" | 10 #include "test/cctest/compiler/value-helper.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 CHECK_NE(c1, n); | 432 CHECK_NE(c1, n); |
433 CHECK_EQ(expected1, c1->opcode()); | 433 CHECK_EQ(expected1, c1->opcode()); |
434 Node* c2 = c1->InputAt(0); | 434 Node* c2 = c1->InputAt(0); |
435 CHECK_NE(c2, n); | 435 CHECK_NE(c2, n); |
436 CHECK_EQ(expected2, c2->opcode()); | 436 CHECK_EQ(expected2, c2->opcode()); |
437 CHECK_EQ(n, c2->InputAt(0)); | 437 CHECK_EQ(n, c2->InputAt(0)); |
438 } | 438 } |
439 | 439 |
440 | 440 |
441 TEST(SingleChanges) { | 441 TEST(SingleChanges) { |
442 CheckChange(IrOpcode::kChangeTaggedToBit, MachineRepresentation::kTagged, | 442 CheckChange(IrOpcode::kChangeBoolToBit, MachineRepresentation::kTagged, |
443 Type::None(), MachineRepresentation::kBit); | 443 Type::None(), MachineRepresentation::kBit); |
444 CheckChange(IrOpcode::kChangeBitToTagged, MachineRepresentation::kBit, | 444 CheckChange(IrOpcode::kChangeBitToBool, MachineRepresentation::kBit, |
445 Type::None(), MachineRepresentation::kTagged); | 445 Type::None(), MachineRepresentation::kTagged); |
446 | 446 |
447 CheckChange(IrOpcode::kChangeInt31ToTaggedSigned, | 447 CheckChange(IrOpcode::kChangeInt31ToTagged, MachineRepresentation::kWord32, |
448 MachineRepresentation::kWord32, Type::Signed31(), | 448 Type::Signed31(), MachineRepresentation::kTagged); |
449 MachineRepresentation::kTagged); | |
450 CheckChange(IrOpcode::kChangeInt32ToTagged, MachineRepresentation::kWord32, | 449 CheckChange(IrOpcode::kChangeInt32ToTagged, MachineRepresentation::kWord32, |
451 Type::Signed32(), MachineRepresentation::kTagged); | 450 Type::Signed32(), MachineRepresentation::kTagged); |
452 CheckChange(IrOpcode::kChangeUint32ToTagged, MachineRepresentation::kWord32, | 451 CheckChange(IrOpcode::kChangeUint32ToTagged, MachineRepresentation::kWord32, |
453 Type::Unsigned32(), MachineRepresentation::kTagged); | 452 Type::Unsigned32(), MachineRepresentation::kTagged); |
454 CheckChange(IrOpcode::kChangeFloat64ToTagged, MachineRepresentation::kFloat64, | 453 CheckChange(IrOpcode::kChangeFloat64ToTagged, MachineRepresentation::kFloat64, |
455 Type::Number(), MachineRepresentation::kTagged); | 454 Type::Number(), MachineRepresentation::kTagged); |
456 CheckTwoChanges(IrOpcode::kChangeFloat64ToInt32, | 455 CheckTwoChanges(IrOpcode::kChangeFloat64ToInt32, |
457 IrOpcode::kChangeInt31ToTaggedSigned, | 456 IrOpcode::kChangeInt31ToTagged, |
458 MachineRepresentation::kFloat64, Type::Signed31(), | 457 MachineRepresentation::kFloat64, Type::Signed31(), |
459 MachineRepresentation::kTagged); | 458 MachineRepresentation::kTagged); |
460 CheckTwoChanges(IrOpcode::kChangeFloat64ToInt32, | 459 CheckTwoChanges(IrOpcode::kChangeFloat64ToInt32, |
461 IrOpcode::kChangeInt32ToTagged, | 460 IrOpcode::kChangeInt32ToTagged, |
462 MachineRepresentation::kFloat64, Type::Signed32(), | 461 MachineRepresentation::kFloat64, Type::Signed32(), |
463 MachineRepresentation::kTagged); | 462 MachineRepresentation::kTagged); |
464 CheckTwoChanges(IrOpcode::kChangeFloat64ToUint32, | 463 CheckTwoChanges(IrOpcode::kChangeFloat64ToUint32, |
465 IrOpcode::kChangeUint32ToTagged, | 464 IrOpcode::kChangeUint32ToTagged, |
466 MachineRepresentation::kFloat64, Type::Unsigned32(), | 465 MachineRepresentation::kFloat64, Type::Unsigned32(), |
467 MachineRepresentation::kTagged); | 466 MachineRepresentation::kTagged); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 MachineRepresentation::kWord64); | 641 MachineRepresentation::kWord64); |
643 r.CheckTypeError(MachineRepresentation::kWord32, Type::Signed32(), | 642 r.CheckTypeError(MachineRepresentation::kWord32, Type::Signed32(), |
644 MachineRepresentation::kWord64); | 643 MachineRepresentation::kWord64); |
645 r.CheckTypeError(MachineRepresentation::kWord32, Type::Unsigned32(), | 644 r.CheckTypeError(MachineRepresentation::kWord32, Type::Unsigned32(), |
646 MachineRepresentation::kWord64); | 645 MachineRepresentation::kWord64); |
647 } | 646 } |
648 | 647 |
649 } // namespace compiler | 648 } // namespace compiler |
650 } // namespace internal | 649 } // namespace internal |
651 } // namespace v8 | 650 } // namespace v8 |
OLD | NEW |