OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 CHECK_EQ(AsClass(*type1), AsClass(*type2)); | 55 CHECK_EQ(AsClass(*type1), AsClass(*type2)); |
56 } else if (IsConstant(*type1)) { | 56 } else if (IsConstant(*type1)) { |
57 CHECK_EQ(AsConstant(*type1), AsConstant(*type2)); | 57 CHECK_EQ(AsConstant(*type1), AsConstant(*type2)); |
58 } else if (IsUnion(*type1)) { | 58 } else if (IsUnion(*type1)) { |
59 CHECK_EQ(AsUnion(*type1)->length(), AsUnion(*type2)->length()); | 59 CHECK_EQ(AsUnion(*type1)->length(), AsUnion(*type2)->length()); |
60 } | 60 } |
61 CHECK(type1->Is(type2)); | 61 CHECK(type1->Is(type2)); |
62 CHECK(type2->Is(type1)); | 62 CHECK(type2->Is(type1)); |
63 } | 63 } |
64 | 64 |
| 65 |
65 static void CheckSub(Handle<Type> type1, Handle<Type> type2) { | 66 static void CheckSub(Handle<Type> type1, Handle<Type> type2) { |
66 CHECK(type1->Is(type2)); | 67 CHECK(type1->Is(type2)); |
67 CHECK(!type2->Is(type1)); | 68 CHECK(!type2->Is(type1)); |
68 if (IsBitset(*type1) && IsBitset(*type2)) { | 69 if (IsBitset(*type1) && IsBitset(*type2)) { |
69 CHECK_NE(AsBitset(*type1), AsBitset(*type2)); | 70 CHECK_NE(AsBitset(*type1), AsBitset(*type2)); |
70 } | 71 } |
71 } | 72 } |
72 | 73 |
| 74 |
73 static void CheckUnordered(Handle<Type> type1, Handle<Type> type2) { | 75 static void CheckUnordered(Handle<Type> type1, Handle<Type> type2) { |
74 CHECK(!type1->Is(type2)); | 76 CHECK(!type1->Is(type2)); |
75 CHECK(!type2->Is(type1)); | 77 CHECK(!type2->Is(type1)); |
76 if (IsBitset(*type1) && IsBitset(*type2)) { | 78 if (IsBitset(*type1) && IsBitset(*type2)) { |
77 CHECK_NE(AsBitset(*type1), AsBitset(*type2)); | 79 CHECK_NE(AsBitset(*type1), AsBitset(*type2)); |
78 } | 80 } |
79 } | 81 } |
80 | 82 |
| 83 |
81 static void CheckOverlap(Handle<Type> type1, Handle<Type> type2) { | 84 static void CheckOverlap(Handle<Type> type1, Handle<Type> type2) { |
82 CHECK(type1->Maybe(type2)); | 85 CHECK(type1->Maybe(type2)); |
83 CHECK(type2->Maybe(type1)); | 86 CHECK(type2->Maybe(type1)); |
84 if (IsBitset(*type1) && IsBitset(*type2)) { | 87 if (IsBitset(*type1) && IsBitset(*type2)) { |
85 CHECK_NE(0, AsBitset(*type1) & AsBitset(*type2)); | 88 CHECK_NE(0, AsBitset(*type1) & AsBitset(*type2)); |
86 } | 89 } |
87 } | 90 } |
88 | 91 |
| 92 |
89 static void CheckDisjoint(Handle<Type> type1, Handle<Type> type2) { | 93 static void CheckDisjoint(Handle<Type> type1, Handle<Type> type2) { |
90 CHECK(!type1->Is(type2)); | 94 CHECK(!type1->Is(type2)); |
91 CHECK(!type2->Is(type1)); | 95 CHECK(!type2->Is(type1)); |
92 CHECK(!type1->Maybe(type2)); | 96 CHECK(!type1->Maybe(type2)); |
93 CHECK(!type2->Maybe(type1)); | 97 CHECK(!type2->Maybe(type1)); |
94 if (IsBitset(*type1) && IsBitset(*type2)) { | 98 if (IsBitset(*type1) && IsBitset(*type2)) { |
95 CHECK_EQ(0, AsBitset(*type1) & AsBitset(*type2)); | 99 CHECK_EQ(0, AsBitset(*type1) & AsBitset(*type2)); |
96 } | 100 } |
97 } | 101 } |
98 | 102 |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 T.Union(T.Union(T.ObjectConstant2, T.ObjectConstant1), T.ArrayClass), | 701 T.Union(T.Union(T.ObjectConstant2, T.ObjectConstant1), T.ArrayClass), |
698 T.Union( | 702 T.Union( |
699 T.ObjectConstant1, T.Union(T.ArrayConstant1, T.ObjectConstant2))), | 703 T.ObjectConstant1, T.Union(T.ArrayConstant1, T.ObjectConstant2))), |
700 T.Union(T.ObjectConstant2, T.ObjectConstant1)); | 704 T.Union(T.ObjectConstant2, T.ObjectConstant1)); |
701 CheckEqual( | 705 CheckEqual( |
702 T.Intersect( | 706 T.Intersect( |
703 T.Union(T.ObjectConstant2, T.ArrayConstant1), | 707 T.Union(T.ObjectConstant2, T.ArrayConstant1), |
704 T.Union(T.ObjectConstant1, T.ArrayConstant2)), | 708 T.Union(T.ObjectConstant1, T.ArrayConstant2)), |
705 T.ArrayConstant1); | 709 T.ArrayConstant1); |
706 } | 710 } |
OLD | NEW |