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

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

Issue 2390823011: [turbofan] HeapConstant types should compare by handle address (Closed)
Patch Set: HeapConstantType holds a HeapObject. Created 4 years, 2 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/compiler/types.cc ('k') | test/cctest/types-fuzz.h » ('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/compiler/types.h" 7 #include "src/compiler/types.h"
8 #include "src/crankshaft/hydrogen-types.h" 8 #include "src/crankshaft/hydrogen-types.h"
9 #include "src/factory.h" 9 #include "src/factory.h"
10 #include "src/heap/heap.h" 10 #include "src/heap/heap.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 Type* type = T.NewConstant(value); 188 Type* type = T.NewConstant(value);
189 CHECK(type->IsHeapConstant() || type->IsOtherNumberConstant() || 189 CHECK(type->IsHeapConstant() || type->IsOtherNumberConstant() ||
190 type->IsRange()); 190 type->IsRange());
191 } 191 }
192 192
193 // Value attribute 193 // Value attribute
194 for (ValueIterator vt = T.values.begin(); vt != T.values.end(); ++vt) { 194 for (ValueIterator vt = T.values.begin(); vt != T.values.end(); ++vt) {
195 Handle<i::Object> value = *vt; 195 Handle<i::Object> value = *vt;
196 Type* type = T.NewConstant(value); 196 Type* type = T.NewConstant(value);
197 if (type->IsHeapConstant()) { 197 if (type->IsHeapConstant()) {
198 CHECK(*value == *type->AsHeapConstant()->Value()); 198 CHECK(value.address() == type->AsHeapConstant()->Value().address());
199 } else if (type->IsOtherNumberConstant()) { 199 } else if (type->IsOtherNumberConstant()) {
200 CHECK(value->IsHeapNumber()); 200 CHECK(value->IsHeapNumber());
201 CHECK(value->Number() == type->AsOtherNumberConstant()->Value()); 201 CHECK(value->Number() == type->AsOtherNumberConstant()->Value());
202 } else { 202 } else {
203 CHECK(type->IsRange()); 203 CHECK(type->IsRange());
204 double v = value->Number(); 204 double v = value->Number();
205 CHECK(v == type->AsRange()->Min() && v == type->AsRange()->Max()); 205 CHECK(v == type->AsRange()->Min() && v == type->AsRange()->Max());
206 } 206 }
207 } 207 }
208 208
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 1106
1107 TEST(Union3) { Tests().Union3(); } 1107 TEST(Union3) { Tests().Union3(); }
1108 1108
1109 TEST(Union4) { Tests().Union4(); } 1109 TEST(Union4) { Tests().Union4(); }
1110 1110
1111 TEST(Intersect) { Tests().Intersect(); } 1111 TEST(Intersect) { Tests().Intersect(); }
1112 1112
1113 TEST(Distributivity) { Tests().Distributivity(); } 1113 TEST(Distributivity) { Tests().Distributivity(); }
1114 1114
1115 TEST(GetRange) { Tests().GetRange(); } 1115 TEST(GetRange) { Tests().GetRange(); }
OLDNEW
« no previous file with comments | « src/compiler/types.cc ('k') | test/cctest/types-fuzz.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698