| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "src/hydrogen-types.h" | 7 #include "src/hydrogen-types.h" |
| 8 #include "src/types.h" | 8 #include "src/types.h" |
| 9 #include "test/cctest/cctest.h" | 9 #include "test/cctest/cctest.h" |
| 10 #include "test/cctest/types-fuzz.h" | 10 #include "test/cctest/types-fuzz.h" |
| (...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 CHECK(!(type1->Is(type3) && type2->Is(type3)) || union12->Is(type3)); | 1498 CHECK(!(type1->Is(type3) && type2->Is(type3)) || union12->Is(type3)); |
| 1499 } | 1499 } |
| 1500 } | 1500 } |
| 1501 } | 1501 } |
| 1502 */ | 1502 */ |
| 1503 } | 1503 } |
| 1504 | 1504 |
| 1505 void Union3() { | 1505 void Union3() { |
| 1506 // Monotonicity: T1->Is(T2) or T1->Is(T3) implies T1->Is(Union(T2, T3)) | 1506 // Monotonicity: T1->Is(T2) or T1->Is(T3) implies T1->Is(Union(T2, T3)) |
| 1507 for (TypeIterator it1 = T.types.begin(); it1 != T.types.end(); ++it1) { | 1507 for (TypeIterator it1 = T.types.begin(); it1 != T.types.end(); ++it1) { |
| 1508 HandleScope scope(isolate); | |
| 1509 for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) { | 1508 for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) { |
| 1510 for (TypeIterator it3 = it2; it3 != T.types.end(); ++it3) { | 1509 for (TypeIterator it3 = it2; it3 != T.types.end(); ++it3) { |
| 1511 TypeHandle type1 = *it1; | 1510 TypeHandle type1 = *it1; |
| 1512 TypeHandle type2 = *it2; | 1511 TypeHandle type2 = *it2; |
| 1513 TypeHandle type3 = *it3; | 1512 TypeHandle type3 = *it3; |
| 1514 TypeHandle union23 = T.Union(type2, type3); | 1513 TypeHandle union23 = T.Union(type2, type3); |
| 1515 CHECK(!(type1->Is(type2) || type1->Is(type3)) || type1->Is(union23)); | 1514 CHECK(!(type1->Is(type2) || type1->Is(type3)) || type1->Is(union23)); |
| 1516 } | 1515 } |
| 1517 } | 1516 } |
| 1518 } | 1517 } |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1751 TypeHandle intersect12 = T.Intersect(type1, type2); | 1750 TypeHandle intersect12 = T.Intersect(type1, type2); |
| 1752 CHECK(!(type1->Is(type3) || type2->Is(type3)) || | 1751 CHECK(!(type1->Is(type3) || type2->Is(type3)) || |
| 1753 intersect12->Is(type3)); | 1752 intersect12->Is(type3)); |
| 1754 } | 1753 } |
| 1755 } | 1754 } |
| 1756 } | 1755 } |
| 1757 */ | 1756 */ |
| 1758 | 1757 |
| 1759 // Monotonicity: T1->Is(T2) and T1->Is(T3) implies T1->Is(Intersect(T2, T3)) | 1758 // Monotonicity: T1->Is(T2) and T1->Is(T3) implies T1->Is(Intersect(T2, T3)) |
| 1760 for (TypeIterator it1 = T.types.begin(); it1 != T.types.end(); ++it1) { | 1759 for (TypeIterator it1 = T.types.begin(); it1 != T.types.end(); ++it1) { |
| 1761 HandleScope scope(isolate); | |
| 1762 for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) { | 1760 for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) { |
| 1763 for (TypeIterator it3 = T.types.begin(); it3 != T.types.end(); ++it3) { | 1761 for (TypeIterator it3 = T.types.begin(); it3 != T.types.end(); ++it3) { |
| 1764 TypeHandle type1 = *it1; | 1762 TypeHandle type1 = *it1; |
| 1765 TypeHandle type2 = *it2; | 1763 TypeHandle type2 = *it2; |
| 1766 TypeHandle type3 = *it3; | 1764 TypeHandle type3 = *it3; |
| 1767 TypeHandle intersect23 = T.Intersect(type2, type3); | 1765 TypeHandle intersect23 = T.Intersect(type2, type3); |
| 1768 CHECK(!(type1->Is(type2) && type1->Is(type3)) || | 1766 CHECK(!(type1->Is(type2) && type1->Is(type3)) || |
| 1769 type1->Is(intersect23)); | 1767 type1->Is(intersect23)); |
| 1770 } | 1768 } |
| 1771 } | 1769 } |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2198 TEST(HTypeFromType_zone) { ZoneTests().HTypeFromType(); } | 2196 TEST(HTypeFromType_zone) { ZoneTests().HTypeFromType(); } |
| 2199 | 2197 |
| 2200 | 2198 |
| 2201 TEST(HTypeFromType_heap) { HeapTests().HTypeFromType(); } | 2199 TEST(HTypeFromType_heap) { HeapTests().HTypeFromType(); } |
| 2202 | 2200 |
| 2203 | 2201 |
| 2204 TEST(GlobalObjectType_zone) { ZoneTests().GlobalObjectType(); } | 2202 TEST(GlobalObjectType_zone) { ZoneTests().GlobalObjectType(); } |
| 2205 | 2203 |
| 2206 | 2204 |
| 2207 TEST(GlobalObjectType_heap) { HeapTests().GlobalObjectType(); } | 2205 TEST(GlobalObjectType_heap) { HeapTests().GlobalObjectType(); } |
| OLD | NEW |