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 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 CHECK(!(type1->Is(type3) && type2->Is(type3)) || union12->Is(type3)); | 1492 CHECK(!(type1->Is(type3) && type2->Is(type3)) || union12->Is(type3)); |
1493 } | 1493 } |
1494 } | 1494 } |
1495 } | 1495 } |
1496 */ | 1496 */ |
1497 } | 1497 } |
1498 | 1498 |
1499 void Union3() { | 1499 void Union3() { |
1500 // Monotonicity: T1->Is(T2) or T1->Is(T3) implies T1->Is(Union(T2, T3)) | 1500 // Monotonicity: T1->Is(T2) or T1->Is(T3) implies T1->Is(Union(T2, T3)) |
1501 for (TypeIterator it1 = T.types.begin(); it1 != T.types.end(); ++it1) { | 1501 for (TypeIterator it1 = T.types.begin(); it1 != T.types.end(); ++it1) { |
| 1502 HandleScope scope(isolate); |
1502 for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) { | 1503 for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) { |
1503 for (TypeIterator it3 = it2; it3 != T.types.end(); ++it3) { | 1504 for (TypeIterator it3 = it2; it3 != T.types.end(); ++it3) { |
1504 TypeHandle type1 = *it1; | 1505 TypeHandle type1 = *it1; |
1505 TypeHandle type2 = *it2; | 1506 TypeHandle type2 = *it2; |
1506 TypeHandle type3 = *it3; | 1507 TypeHandle type3 = *it3; |
1507 TypeHandle union23 = T.Union(type2, type3); | 1508 TypeHandle union23 = T.Union(type2, type3); |
1508 CHECK(!(type1->Is(type2) || type1->Is(type3)) || type1->Is(union23)); | 1509 CHECK(!(type1->Is(type2) || type1->Is(type3)) || type1->Is(union23)); |
1509 } | 1510 } |
1510 } | 1511 } |
1511 } | 1512 } |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 TypeHandle intersect12 = T.Intersect(type1, type2); | 1745 TypeHandle intersect12 = T.Intersect(type1, type2); |
1745 CHECK(!(type1->Is(type3) || type2->Is(type3)) || | 1746 CHECK(!(type1->Is(type3) || type2->Is(type3)) || |
1746 intersect12->Is(type3)); | 1747 intersect12->Is(type3)); |
1747 } | 1748 } |
1748 } | 1749 } |
1749 } | 1750 } |
1750 */ | 1751 */ |
1751 | 1752 |
1752 // Monotonicity: T1->Is(T2) and T1->Is(T3) implies T1->Is(Intersect(T2, T3)) | 1753 // Monotonicity: T1->Is(T2) and T1->Is(T3) implies T1->Is(Intersect(T2, T3)) |
1753 for (TypeIterator it1 = T.types.begin(); it1 != T.types.end(); ++it1) { | 1754 for (TypeIterator it1 = T.types.begin(); it1 != T.types.end(); ++it1) { |
| 1755 HandleScope scope(isolate); |
1754 for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) { | 1756 for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) { |
1755 for (TypeIterator it3 = T.types.begin(); it3 != T.types.end(); ++it3) { | 1757 for (TypeIterator it3 = T.types.begin(); it3 != T.types.end(); ++it3) { |
1756 TypeHandle type1 = *it1; | 1758 TypeHandle type1 = *it1; |
1757 TypeHandle type2 = *it2; | 1759 TypeHandle type2 = *it2; |
1758 TypeHandle type3 = *it3; | 1760 TypeHandle type3 = *it3; |
1759 TypeHandle intersect23 = T.Intersect(type2, type3); | 1761 TypeHandle intersect23 = T.Intersect(type2, type3); |
1760 CHECK(!(type1->Is(type2) && type1->Is(type3)) || | 1762 CHECK(!(type1->Is(type2) && type1->Is(type3)) || |
1761 type1->Is(intersect23)); | 1763 type1->Is(intersect23)); |
1762 } | 1764 } |
1763 } | 1765 } |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2124 } | 2126 } |
2125 | 2127 |
2126 | 2128 |
2127 TEST(Convert_heap) { HeapTests().Convert<Type, Type*, Zone, ZoneRep>(); } | 2129 TEST(Convert_heap) { HeapTests().Convert<Type, Type*, Zone, ZoneRep>(); } |
2128 | 2130 |
2129 | 2131 |
2130 TEST(HTypeFromType_zone) { ZoneTests().HTypeFromType(); } | 2132 TEST(HTypeFromType_zone) { ZoneTests().HTypeFromType(); } |
2131 | 2133 |
2132 | 2134 |
2133 TEST(HTypeFromType_heap) { HeapTests().HTypeFromType(); } | 2135 TEST(HTypeFromType_heap) { HeapTests().HTypeFromType(); } |
OLD | NEW |