| 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/v8.h" | 7 #include "src/v8.h" |
| 8 #include "test/cctest/cctest.h" | 8 #include "test/cctest/cctest.h" |
| 9 #include "test/cctest/compiler/codegen-tester.h" | 9 #include "test/cctest/compiler/codegen-tester.h" |
| 10 #include "test/cctest/compiler/graph-builder-tester.h" | 10 #include "test/cctest/compiler/graph-builder-tester.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 CHECK(changer()->type_error_); | 93 CHECK(changer()->type_error_); |
| 94 CHECK_EQ(n, c); | 94 CHECK_EQ(n, c); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void CheckNop(MachineTypeUnion from, MachineTypeUnion to) { | 97 void CheckNop(MachineTypeUnion from, MachineTypeUnion to) { |
| 98 Node* n = Parameter(0); | 98 Node* n = Parameter(0); |
| 99 Node* c = changer()->GetRepresentationFor(n, from, to); | 99 Node* c = changer()->GetRepresentationFor(n, from, to); |
| 100 CHECK_EQ(n, c); | 100 CHECK_EQ(n, c); |
| 101 } | 101 } |
| 102 }; | 102 }; |
| 103 } | 103 } // namespace compiler |
| 104 } | 104 } // namespace internal |
| 105 } // namespace v8::internal::compiler | 105 } // namespace v8 |
| 106 | 106 |
| 107 | 107 |
| 108 static const MachineType all_reps[] = {kRepBit, kRepWord32, kRepWord64, | 108 static const MachineType all_reps[] = {kRepBit, kRepWord32, kRepWord64, |
| 109 kRepFloat32, kRepFloat64, kRepTagged}; | 109 kRepFloat32, kRepFloat64, kRepTagged}; |
| 110 | 110 |
| 111 | 111 |
| 112 TEST(BoolToBit_constant) { | 112 TEST(BoolToBit_constant) { |
| 113 RepresentationChangerTester r; | 113 RepresentationChangerTester r; |
| 114 | 114 |
| 115 Node* true_node = r.jsgraph()->TrueConstant(); | 115 Node* true_node = r.jsgraph()->TrueConstant(); |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 r.CheckTypeError(kRepWord32 | kTypeUint32, kRepWord64); | 544 r.CheckTypeError(kRepWord32 | kTypeUint32, kRepWord64); |
| 545 | 545 |
| 546 for (size_t i = 0; i < arraysize(all_reps); i++) { | 546 for (size_t i = 0; i < arraysize(all_reps); i++) { |
| 547 for (size_t j = 0; j < arraysize(all_reps); j++) { | 547 for (size_t j = 0; j < arraysize(all_reps); j++) { |
| 548 if (i == j) continue; | 548 if (i == j) continue; |
| 549 // Only a single from representation is allowed. | 549 // Only a single from representation is allowed. |
| 550 r.CheckTypeError(all_reps[i] | all_reps[j], kRepTagged); | 550 r.CheckTypeError(all_reps[i] | all_reps[j], kRepTagged); |
| 551 } | 551 } |
| 552 } | 552 } |
| 553 } | 553 } |
| OLD | NEW |