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/isolate-inl.h" | 8 #include "src/isolate-inl.h" |
9 #include "src/types.h" | 9 #include "src/types.h" |
10 #include "test/cctest/cctest.h" | 10 #include "test/cctest/cctest.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 typedef Types<Type, TypeHandle, Region> TypesInstance; | 96 typedef Types<Type, TypeHandle, Region> TypesInstance; |
97 typedef typename TypesInstance::TypeVector::iterator TypeIterator; | 97 typedef typename TypesInstance::TypeVector::iterator TypeIterator; |
98 typedef typename TypesInstance::MapVector::iterator MapIterator; | 98 typedef typename TypesInstance::MapVector::iterator MapIterator; |
99 typedef typename TypesInstance::ValueVector::iterator ValueIterator; | 99 typedef typename TypesInstance::ValueVector::iterator ValueIterator; |
100 | 100 |
101 Isolate* isolate; | 101 Isolate* isolate; |
102 HandleScope scope; | 102 HandleScope scope; |
103 Zone zone; | 103 Zone zone; |
104 TypesInstance T; | 104 TypesInstance T; |
105 | 105 |
106 Tests() : | 106 Tests() |
107 isolate(CcTest::i_isolate()), | 107 : isolate(CcTest::i_isolate()), |
108 scope(isolate), | 108 scope(isolate), |
109 zone(isolate), | 109 zone(), |
110 T(Rep::ToRegion(&zone, isolate), isolate) { | 110 T(Rep::ToRegion(&zone, isolate), isolate) {} |
111 } | |
112 | 111 |
113 bool Equal(TypeHandle type1, TypeHandle type2) { | 112 bool Equal(TypeHandle type1, TypeHandle type2) { |
114 return | 113 return |
115 type1->Equals(type2) && | 114 type1->Equals(type2) && |
116 this->IsBitset(type1) == this->IsBitset(type2) && | 115 this->IsBitset(type1) == this->IsBitset(type2) && |
117 this->IsUnion(type1) == this->IsUnion(type2) && | 116 this->IsUnion(type1) == this->IsUnion(type2) && |
118 type1->NumClasses() == type2->NumClasses() && | 117 type1->NumClasses() == type2->NumClasses() && |
119 type1->NumConstants() == type2->NumConstants() && | 118 type1->NumConstants() == type2->NumConstants() && |
120 (!this->IsBitset(type1) || | 119 (!this->IsBitset(type1) || |
121 this->AsBitset(type1) == this->AsBitset(type2)) && | 120 this->AsBitset(type1) == this->AsBitset(type2)) && |
(...skipping 1959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2081 ZoneTests().Convert<HeapType, Handle<HeapType>, Isolate, HeapRep>(); | 2080 ZoneTests().Convert<HeapType, Handle<HeapType>, Isolate, HeapRep>(); |
2082 HeapTests().Convert<Type, Type*, Zone, ZoneRep>(); | 2081 HeapTests().Convert<Type, Type*, Zone, ZoneRep>(); |
2083 } | 2082 } |
2084 | 2083 |
2085 | 2084 |
2086 TEST(HTypeFromType) { | 2085 TEST(HTypeFromType) { |
2087 CcTest::InitializeVM(); | 2086 CcTest::InitializeVM(); |
2088 ZoneTests().HTypeFromType(); | 2087 ZoneTests().HTypeFromType(); |
2089 HeapTests().HTypeFromType(); | 2088 HeapTests().HTypeFromType(); |
2090 } | 2089 } |
OLD | NEW |