Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: test/cctest/test-types.cc

Issue 2302283002: Forking the type system between Crankshaft & Turbofan. (Closed)
Patch Set: Nits. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-field-type-tracking.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/crankshaft/hydrogen-types.h" 7 #include "src/crankshaft/hydrogen-types.h"
8 #include "src/factory.h" 8 #include "src/factory.h"
9 #include "src/heap/heap.h" 9 #include "src/heap/heap.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
(...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after
1859 Type* type2 = *it2; 1859 Type* type2 = *it2;
1860 if (type1->IsConstant() && type2->IsRange()) { 1860 if (type1->IsConstant() && type2->IsRange()) {
1861 Type* u = T.Union(type1, type2); 1861 Type* u = T.Union(type1, type2);
1862 1862
1863 CHECK(type2->Min() == u->GetRange()->Min()); 1863 CHECK(type2->Min() == u->GetRange()->Min());
1864 CHECK(type2->Max() == u->GetRange()->Max()); 1864 CHECK(type2->Max() == u->GetRange()->Max());
1865 } 1865 }
1866 } 1866 }
1867 } 1867 }
1868 } 1868 }
1869
1870 void HTypeFromType() {
1871 for (TypeIterator it1 = T.types.begin(); it1 != T.types.end(); ++it1) {
1872 for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) {
1873 Type* type1 = *it1;
1874 Type* type2 = *it2;
1875 HType htype1 = HType::FromType(type1);
1876 HType htype2 = HType::FromType(type2);
1877 CHECK(!type1->Is(type2) || htype1.IsSubtypeOf(htype2));
1878 }
1879 }
1880 }
1881 }; 1869 };
1882 1870
1883 TEST(IsSomeType_zone) { Tests().IsSomeType(); } 1871 TEST(IsSomeType_zone) { Tests().IsSomeType(); }
1884 1872
1885 TEST(PointwiseRepresentation_zone) { Tests().PointwiseRepresentation(); } 1873 TEST(PointwiseRepresentation_zone) { Tests().PointwiseRepresentation(); }
1886 1874
1887 TEST(BitsetType_zone) { Tests().Bitset(); } 1875 TEST(BitsetType_zone) { Tests().Bitset(); }
1888 1876
1889 TEST(ClassType_zone) { Tests().Class(); } 1877 TEST(ClassType_zone) { Tests().Class(); }
1890 1878
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1924 1912
1925 TEST(Union3_zone) { Tests().Union3(); } 1913 TEST(Union3_zone) { Tests().Union3(); }
1926 1914
1927 TEST(Union4_zone) { Tests().Union4(); } 1915 TEST(Union4_zone) { Tests().Union4(); }
1928 1916
1929 TEST(Intersect_zone) { Tests().Intersect(); } 1917 TEST(Intersect_zone) { Tests().Intersect(); }
1930 1918
1931 TEST(Distributivity_zone) { Tests().Distributivity(); } 1919 TEST(Distributivity_zone) { Tests().Distributivity(); }
1932 1920
1933 TEST(GetRange_zone) { Tests().GetRange(); } 1921 TEST(GetRange_zone) { Tests().GetRange(); }
1934
1935 TEST(HTypeFromType_zone) { Tests().HTypeFromType(); }
OLDNEW
« no previous file with comments | « test/cctest/test-field-type-tracking.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698