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

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

Issue 1185633002: Additional HandleScopes to limit Handle consumption. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Refine comment. Created 5 years, 6 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 | « src/runtime/runtime-literals.cc ('k') | test/mjsunit/handle-count-ast.js » ('j') | 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/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
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);
1508 for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) { 1509 for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) {
1509 for (TypeIterator it3 = it2; it3 != T.types.end(); ++it3) { 1510 for (TypeIterator it3 = it2; it3 != T.types.end(); ++it3) {
1510 TypeHandle type1 = *it1; 1511 TypeHandle type1 = *it1;
1511 TypeHandle type2 = *it2; 1512 TypeHandle type2 = *it2;
1512 TypeHandle type3 = *it3; 1513 TypeHandle type3 = *it3;
1513 TypeHandle union23 = T.Union(type2, type3); 1514 TypeHandle union23 = T.Union(type2, type3);
1514 CHECK(!(type1->Is(type2) || type1->Is(type3)) || type1->Is(union23)); 1515 CHECK(!(type1->Is(type2) || type1->Is(type3)) || type1->Is(union23));
1515 } 1516 }
1516 } 1517 }
1517 } 1518 }
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 TypeHandle intersect12 = T.Intersect(type1, type2); 1751 TypeHandle intersect12 = T.Intersect(type1, type2);
1751 CHECK(!(type1->Is(type3) || type2->Is(type3)) || 1752 CHECK(!(type1->Is(type3) || type2->Is(type3)) ||
1752 intersect12->Is(type3)); 1753 intersect12->Is(type3));
1753 } 1754 }
1754 } 1755 }
1755 } 1756 }
1756 */ 1757 */
1757 1758
1758 // Monotonicity: T1->Is(T2) and T1->Is(T3) implies T1->Is(Intersect(T2, T3)) 1759 // Monotonicity: T1->Is(T2) and T1->Is(T3) implies T1->Is(Intersect(T2, T3))
1759 for (TypeIterator it1 = T.types.begin(); it1 != T.types.end(); ++it1) { 1760 for (TypeIterator it1 = T.types.begin(); it1 != T.types.end(); ++it1) {
1761 HandleScope scope(isolate);
1760 for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) { 1762 for (TypeIterator it2 = T.types.begin(); it2 != T.types.end(); ++it2) {
1761 for (TypeIterator it3 = T.types.begin(); it3 != T.types.end(); ++it3) { 1763 for (TypeIterator it3 = T.types.begin(); it3 != T.types.end(); ++it3) {
1762 TypeHandle type1 = *it1; 1764 TypeHandle type1 = *it1;
1763 TypeHandle type2 = *it2; 1765 TypeHandle type2 = *it2;
1764 TypeHandle type3 = *it3; 1766 TypeHandle type3 = *it3;
1765 TypeHandle intersect23 = T.Intersect(type2, type3); 1767 TypeHandle intersect23 = T.Intersect(type2, type3);
1766 CHECK(!(type1->Is(type2) && type1->Is(type3)) || 1768 CHECK(!(type1->Is(type2) && type1->Is(type3)) ||
1767 type1->Is(intersect23)); 1769 type1->Is(intersect23));
1768 } 1770 }
1769 } 1771 }
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 TEST(HTypeFromType_zone) { ZoneTests().HTypeFromType(); } 2198 TEST(HTypeFromType_zone) { ZoneTests().HTypeFromType(); }
2197 2199
2198 2200
2199 TEST(HTypeFromType_heap) { HeapTests().HTypeFromType(); } 2201 TEST(HTypeFromType_heap) { HeapTests().HTypeFromType(); }
2200 2202
2201 2203
2202 TEST(GlobalObjectType_zone) { ZoneTests().GlobalObjectType(); } 2204 TEST(GlobalObjectType_zone) { ZoneTests().GlobalObjectType(); }
2203 2205
2204 2206
2205 TEST(GlobalObjectType_heap) { HeapTests().GlobalObjectType(); } 2207 TEST(GlobalObjectType_heap) { HeapTests().GlobalObjectType(); }
OLDNEW
« no previous file with comments | « src/runtime/runtime-literals.cc ('k') | test/mjsunit/handle-count-ast.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698