Revision f230a1cf deps/v8/test/cctest/test-types.cc
deps/v8/test/cctest/test-types.cc | ||
---|---|---|
111 | 111 |
Null(Type::Null(), isolate), |
112 | 112 |
Undefined(Type::Undefined(), isolate), |
113 | 113 |
Number(Type::Number(), isolate), |
114 |
Integer31(Type::Smi(), isolate),
|
|
115 |
Integer32(Type::Signed32(), isolate),
|
|
114 |
Smi(Type::Smi(), isolate),
|
|
115 |
Signed32(Type::Signed32(), isolate),
|
|
116 | 116 |
Double(Type::Double(), isolate), |
117 | 117 |
Name(Type::Name(), isolate), |
118 | 118 |
UniqueName(Type::UniqueName(), isolate), |
... | ... | |
128 | 128 |
array_map(isolate->factory()->NewMap(JS_ARRAY_TYPE, 4 * kPointerSize)), |
129 | 129 |
isolate_(isolate) { |
130 | 130 |
smi = handle(Smi::FromInt(666), isolate); |
131 |
signed32 = isolate->factory()->NewHeapNumber(0x40000000); |
|
131 | 132 |
object1 = isolate->factory()->NewJSObjectFromMap(object_map); |
132 | 133 |
object2 = isolate->factory()->NewJSObjectFromMap(object_map); |
133 | 134 |
array = isolate->factory()->NewJSArray(20); |
134 |
ObjectClass = handle(Type::Class(object_map), isolate); |
|
135 |
ArrayClass = handle(Type::Class(array_map), isolate); |
|
136 |
Integer31Constant = handle(Type::Constant(smi, isolate), isolate); |
|
137 |
ObjectConstant1 = handle(Type::Constant(object1), isolate); |
|
138 |
ObjectConstant2 = handle(Type::Constant(object2), isolate); |
|
139 |
ArrayConstant1 = handle(Type::Constant(array), isolate); |
|
140 |
ArrayConstant2 = handle(Type::Constant(array), isolate); |
|
135 |
ObjectClass = Class(object_map); |
|
136 |
ArrayClass = Class(array_map); |
|
137 |
SmiConstant = Constant(smi); |
|
138 |
Signed32Constant = Constant(signed32); |
|
139 |
ObjectConstant1 = Constant(object1); |
|
140 |
ObjectConstant2 = Constant(object2); |
|
141 |
ArrayConstant1 = Constant(array); |
|
142 |
ArrayConstant2 = Constant(array); |
|
141 | 143 |
} |
142 | 144 |
|
143 | 145 |
Handle<Type> None; |
... | ... | |
147 | 149 |
Handle<Type> Null; |
148 | 150 |
Handle<Type> Undefined; |
149 | 151 |
Handle<Type> Number; |
150 |
Handle<Type> Integer31;
|
|
151 |
Handle<Type> Integer32;
|
|
152 |
Handle<Type> Smi;
|
|
153 |
Handle<Type> Signed32;
|
|
152 | 154 |
Handle<Type> Double; |
153 | 155 |
Handle<Type> Name; |
154 | 156 |
Handle<Type> UniqueName; |
... | ... | |
164 | 166 |
Handle<Type> ObjectClass; |
165 | 167 |
Handle<Type> ArrayClass; |
166 | 168 |
|
167 |
Handle<Type> Integer31Constant; |
|
169 |
Handle<Type> SmiConstant; |
|
170 |
Handle<Type> Signed32Constant; |
|
168 | 171 |
Handle<Type> ObjectConstant1; |
169 | 172 |
Handle<Type> ObjectConstant2; |
170 | 173 |
Handle<Type> ArrayConstant1; |
... | ... | |
173 | 176 |
Handle<Map> object_map; |
174 | 177 |
Handle<Map> array_map; |
175 | 178 |
|
176 |
Handle<v8::internal::Smi> smi; |
|
179 |
Handle<i::Smi> smi; |
|
180 |
Handle<HeapNumber> signed32; |
|
177 | 181 |
Handle<JSObject> object1; |
178 | 182 |
Handle<JSObject> object2; |
179 | 183 |
Handle<JSArray> array; |
180 | 184 |
|
185 |
Handle<Type> Class(Handle<Map> map) { |
|
186 |
return handle(Type::Class(map), isolate_); |
|
187 |
} |
|
188 |
Handle<Type> Constant(Handle<i::Object> value) { |
|
189 |
return handle(Type::Constant(value, isolate_), isolate_); |
|
190 |
} |
|
181 | 191 |
Handle<Type> Union(Handle<Type> type1, Handle<Type> type2) { |
182 | 192 |
return handle(Type::Union(type1, type2), isolate_); |
183 | 193 |
} |
... | ... | |
192 | 202 |
|
193 | 203 |
TEST(Bitset) { |
194 | 204 |
CcTest::InitializeVM(); |
195 |
Isolate* isolate = Isolate::Current();
|
|
205 |
Isolate* isolate = CcTest::i_isolate();
|
|
196 | 206 |
HandleScope scope(isolate); |
197 | 207 |
HandlifiedTypes T(isolate); |
198 | 208 |
|
... | ... | |
217 | 227 |
|
218 | 228 |
TEST(Class) { |
219 | 229 |
CcTest::InitializeVM(); |
220 |
Isolate* isolate = Isolate::Current();
|
|
230 |
Isolate* isolate = CcTest::i_isolate();
|
|
221 | 231 |
HandleScope scope(isolate); |
222 | 232 |
HandlifiedTypes T(isolate); |
223 | 233 |
|
... | ... | |
231 | 241 |
|
232 | 242 |
TEST(Constant) { |
233 | 243 |
CcTest::InitializeVM(); |
234 |
Isolate* isolate = Isolate::Current();
|
|
244 |
Isolate* isolate = CcTest::i_isolate();
|
|
235 | 245 |
HandleScope scope(isolate); |
236 | 246 |
HandlifiedTypes T(isolate); |
237 | 247 |
|
238 |
CHECK(IsConstant(*T.Integer31Constant));
|
|
248 |
CHECK(IsConstant(*T.SmiConstant));
|
|
239 | 249 |
CHECK(IsConstant(*T.ObjectConstant1)); |
240 | 250 |
CHECK(IsConstant(*T.ObjectConstant2)); |
241 | 251 |
CHECK(IsConstant(*T.ArrayConstant1)); |
242 | 252 |
CHECK(IsConstant(*T.ArrayConstant2)); |
243 | 253 |
|
244 |
CHECK(*T.smi == AsConstant(*T.Integer31Constant));
|
|
254 |
CHECK(*T.smi == AsConstant(*T.SmiConstant));
|
|
245 | 255 |
CHECK(*T.object1 == AsConstant(*T.ObjectConstant1)); |
246 | 256 |
CHECK(*T.object2 == AsConstant(*T.ObjectConstant2)); |
247 | 257 |
CHECK(*T.object1 != AsConstant(*T.ObjectConstant2)); |
... | ... | |
252 | 262 |
|
253 | 263 |
TEST(Is) { |
254 | 264 |
CcTest::InitializeVM(); |
255 |
Isolate* isolate = Isolate::Current();
|
|
265 |
Isolate* isolate = CcTest::i_isolate();
|
|
256 | 266 |
HandleScope scope(isolate); |
257 | 267 |
HandlifiedTypes T(isolate); |
258 | 268 |
|
... | ... | |
278 | 288 |
CheckUnordered(T.Boolean, T.Undefined); |
279 | 289 |
|
280 | 290 |
CheckSub(T.Number, T.Any); |
281 |
CheckSub(T.Integer31, T.Number);
|
|
282 |
CheckSub(T.Integer32, T.Number);
|
|
291 |
CheckSub(T.Smi, T.Number);
|
|
292 |
CheckSub(T.Signed32, T.Number);
|
|
283 | 293 |
CheckSub(T.Double, T.Number); |
284 |
CheckSub(T.Integer31, T.Integer32);
|
|
285 |
CheckUnordered(T.Integer31, T.Double);
|
|
286 |
CheckUnordered(T.Integer32, T.Double);
|
|
294 |
CheckSub(T.Smi, T.Signed32);
|
|
295 |
CheckUnordered(T.Smi, T.Double);
|
|
296 |
CheckUnordered(T.Signed32, T.Double);
|
|
287 | 297 |
|
288 | 298 |
CheckSub(T.Name, T.Any); |
289 | 299 |
CheckSub(T.UniqueName, T.Any); |
... | ... | |
308 | 318 |
CheckUnordered(T.Array, T.Function); |
309 | 319 |
|
310 | 320 |
// Structured subtyping |
321 |
CheckSub(T.None, T.ObjectClass); |
|
322 |
CheckSub(T.None, T.ObjectConstant1); |
|
323 |
CheckSub(T.ObjectClass, T.Any); |
|
324 |
CheckSub(T.ObjectConstant1, T.Any); |
|
325 |
|
|
311 | 326 |
CheckSub(T.ObjectClass, T.Object); |
312 | 327 |
CheckSub(T.ArrayClass, T.Object); |
313 | 328 |
CheckUnordered(T.ObjectClass, T.ArrayClass); |
314 | 329 |
|
315 |
CheckSub(T.Integer31Constant, T.Integer31);
|
|
316 |
CheckSub(T.Integer31Constant, T.Integer32);
|
|
317 |
CheckSub(T.Integer31Constant, T.Number);
|
|
330 |
CheckSub(T.SmiConstant, T.Smi);
|
|
331 |
CheckSub(T.SmiConstant, T.Signed32);
|
|
332 |
CheckSub(T.SmiConstant, T.Number);
|
|
318 | 333 |
CheckSub(T.ObjectConstant1, T.Object); |
319 | 334 |
CheckSub(T.ObjectConstant2, T.Object); |
320 | 335 |
CheckSub(T.ArrayConstant1, T.Object); |
... | ... | |
332 | 347 |
|
333 | 348 |
TEST(Maybe) { |
334 | 349 |
CcTest::InitializeVM(); |
335 |
Isolate* isolate = Isolate::Current();
|
|
350 |
Isolate* isolate = CcTest::i_isolate();
|
|
336 | 351 |
HandleScope scope(isolate); |
337 | 352 |
HandlifiedTypes T(isolate); |
338 | 353 |
|
... | ... | |
348 | 363 |
CheckDisjoint(T.Boolean, T.Undefined); |
349 | 364 |
|
350 | 365 |
CheckOverlap(T.Number, T.Any); |
351 |
CheckOverlap(T.Integer31, T.Number);
|
|
366 |
CheckOverlap(T.Smi, T.Number);
|
|
352 | 367 |
CheckOverlap(T.Double, T.Number); |
353 |
CheckDisjoint(T.Integer32, T.Double);
|
|
368 |
CheckDisjoint(T.Signed32, T.Double);
|
|
354 | 369 |
|
355 | 370 |
CheckOverlap(T.Name, T.Any); |
356 | 371 |
CheckOverlap(T.UniqueName, T.Any); |
... | ... | |
374 | 389 |
CheckDisjoint(T.Object, T.Proxy); |
375 | 390 |
CheckDisjoint(T.Array, T.Function); |
376 | 391 |
|
392 |
CheckOverlap(T.ObjectClass, T.Any); |
|
393 |
CheckOverlap(T.ObjectConstant1, T.Any); |
|
394 |
|
|
377 | 395 |
CheckOverlap(T.ObjectClass, T.Object); |
378 | 396 |
CheckOverlap(T.ArrayClass, T.Object); |
379 | 397 |
CheckOverlap(T.ObjectClass, T.ObjectClass); |
380 | 398 |
CheckOverlap(T.ArrayClass, T.ArrayClass); |
381 | 399 |
CheckDisjoint(T.ObjectClass, T.ArrayClass); |
382 | 400 |
|
383 |
CheckOverlap(T.Integer31Constant, T.Integer31);
|
|
384 |
CheckOverlap(T.Integer31Constant, T.Integer32);
|
|
385 |
CheckOverlap(T.Integer31Constant, T.Number);
|
|
386 |
CheckDisjoint(T.Integer31Constant, T.Double);
|
|
401 |
CheckOverlap(T.SmiConstant, T.Smi);
|
|
402 |
CheckOverlap(T.SmiConstant, T.Signed32);
|
|
403 |
CheckOverlap(T.SmiConstant, T.Number);
|
|
404 |
CheckDisjoint(T.SmiConstant, T.Double);
|
|
387 | 405 |
CheckOverlap(T.ObjectConstant1, T.Object); |
388 | 406 |
CheckOverlap(T.ObjectConstant2, T.Object); |
389 | 407 |
CheckOverlap(T.ArrayConstant1, T.Object); |
... | ... | |
403 | 421 |
|
404 | 422 |
TEST(Union) { |
405 | 423 |
CcTest::InitializeVM(); |
406 |
Isolate* isolate = Isolate::Current();
|
|
424 |
Isolate* isolate = CcTest::i_isolate();
|
|
407 | 425 |
HandleScope scope(isolate); |
408 | 426 |
HandlifiedTypes T(isolate); |
409 | 427 |
|
... | ... | |
422 | 440 |
CHECK(IsUnion(Type::Union(T.ObjectClass, T.ArrayClass))); |
423 | 441 |
|
424 | 442 |
CheckEqual(T.Union(T.ObjectClass, T.ObjectClass), T.ObjectClass); |
443 |
CheckSub(T.None, T.Union(T.ObjectClass, T.ArrayClass)); |
|
444 |
CheckSub(T.Union(T.ObjectClass, T.ArrayClass), T.Any); |
|
425 | 445 |
CheckSub(T.ObjectClass, T.Union(T.ObjectClass, T.ArrayClass)); |
426 | 446 |
CheckSub(T.ArrayClass, T.Union(T.ObjectClass, T.ArrayClass)); |
427 | 447 |
CheckSub(T.Union(T.ObjectClass, T.ArrayClass), T.Object); |
... | ... | |
437 | 457 |
CheckEqual(T.Union(T.ObjectConstant1, T.ObjectConstant1), T.ObjectConstant1); |
438 | 458 |
CheckEqual(T.Union(T.ArrayConstant1, T.ArrayConstant1), T.ArrayConstant1); |
439 | 459 |
CheckEqual(T.Union(T.ArrayConstant1, T.ArrayConstant1), T.ArrayConstant2); |
460 |
CheckSub(T.None, T.Union(T.ObjectConstant1, T.ObjectConstant2)); |
|
461 |
CheckSub(T.Union(T.ObjectConstant1, T.ObjectConstant2), T.Any); |
|
440 | 462 |
CheckSub(T.ObjectConstant1, T.Union(T.ObjectConstant1, T.ObjectConstant2)); |
441 | 463 |
CheckSub(T.ObjectConstant2, T.Union(T.ObjectConstant1, T.ObjectConstant2)); |
442 | 464 |
CheckSub(T.ArrayConstant2, T.Union(T.ArrayConstant1, T.ObjectConstant2)); |
... | ... | |
453 | 475 |
CHECK(IsUnion(Type::Union(T.ObjectClass, T.Number))); |
454 | 476 |
|
455 | 477 |
CheckEqual(T.Union(T.ObjectClass, T.Object), T.Object); |
478 |
CheckSub(T.None, T.Union(T.ObjectClass, T.Number)); |
|
456 | 479 |
CheckSub(T.Union(T.ObjectClass, T.Number), T.Any); |
457 |
CheckSub(T.Union(T.ObjectClass, T.Integer31), T.Union(T.Object, T.Number));
|
|
480 |
CheckSub(T.Union(T.ObjectClass, T.Smi), T.Union(T.Object, T.Number));
|
|
458 | 481 |
CheckSub(T.Union(T.ObjectClass, T.Array), T.Object); |
459 | 482 |
CheckUnordered(T.Union(T.ObjectClass, T.String), T.Array); |
460 | 483 |
CheckOverlap(T.Union(T.ObjectClass, T.String), T.Object); |
461 | 484 |
CheckDisjoint(T.Union(T.ObjectClass, T.String), T.Number); |
462 | 485 |
|
463 | 486 |
// Bitset-constant |
464 |
CHECK(IsBitset(Type::Union(T.Integer31Constant, T.Number)));
|
|
487 |
CHECK(IsBitset(Type::Union(T.SmiConstant, T.Number)));
|
|
465 | 488 |
CHECK(IsBitset(Type::Union(T.ObjectConstant1, T.Object))); |
466 | 489 |
CHECK(IsUnion(Type::Union(T.ObjectConstant2, T.Number))); |
467 | 490 |
|
468 |
CheckEqual(T.Union(T.Integer31Constant, T.Number), T.Number);
|
|
491 |
CheckEqual(T.Union(T.SmiConstant, T.Number), T.Number);
|
|
469 | 492 |
CheckEqual(T.Union(T.ObjectConstant1, T.Object), T.Object); |
493 |
CheckSub(T.None, T.Union(T.ObjectConstant1, T.Number)); |
|
470 | 494 |
CheckSub(T.Union(T.ObjectConstant1, T.Number), T.Any); |
471 |
CheckSub( |
|
472 |
T.Union(T.ObjectConstant1, T.Integer32), T.Union(T.Object, T.Number)); |
|
495 |
CheckSub(T.Union(T.ObjectConstant1, T.Signed32), T.Union(T.Object, T.Number)); |
|
473 | 496 |
CheckSub(T.Union(T.ObjectConstant1, T.Array), T.Object); |
474 | 497 |
CheckUnordered(T.Union(T.ObjectConstant1, T.String), T.Array); |
475 | 498 |
CheckOverlap(T.Union(T.ObjectConstant1, T.String), T.Object); |
476 | 499 |
CheckDisjoint(T.Union(T.ObjectConstant1, T.String), T.Number); |
500 |
CheckEqual(T.Union(T.Signed32, T.Signed32Constant), T.Signed32); |
|
477 | 501 |
|
478 | 502 |
// Class-constant |
479 | 503 |
CHECK(IsUnion(Type::Union(T.ObjectConstant1, T.ObjectClass))); |
480 | 504 |
CHECK(IsUnion(Type::Union(T.ArrayClass, T.ObjectConstant2))); |
481 | 505 |
|
506 |
CheckSub(T.None, T.Union(T.ObjectConstant1, T.ArrayClass)); |
|
507 |
CheckSub(T.Union(T.ObjectConstant1, T.ArrayClass), T.Any); |
|
482 | 508 |
CheckSub(T.Union(T.ObjectConstant1, T.ArrayClass), T.Object); |
483 | 509 |
CheckSub(T.ObjectConstant1, T.Union(T.ObjectConstant1, T.ArrayClass)); |
484 | 510 |
CheckSub(T.ArrayClass, T.Union(T.ObjectConstant1, T.ArrayClass)); |
... | ... | |
508 | 534 |
T.ObjectConstant1, |
509 | 535 |
T.Union(T.Union(T.ArrayClass, T.ObjectConstant1), T.Double)); |
510 | 536 |
CheckSub( |
537 |
T.None, |
|
538 |
T.Union(T.Union(T.ArrayClass, T.ObjectConstant1), T.Double)); |
|
539 |
CheckSub( |
|
511 | 540 |
T.Union(T.Union(T.ArrayClass, T.ObjectConstant1), T.Double), |
512 | 541 |
T.Any); |
513 | 542 |
CheckSub( |
... | ... | |
524 | 553 |
T.Union(T.ObjectClass, T.Union(T.ObjectConstant1, T.ObjectClass)), |
525 | 554 |
T.Union(T.ObjectClass, T.ObjectConstant1)); |
526 | 555 |
CheckSub( |
556 |
T.None, |
|
557 |
T.Union(T.ObjectClass, T.Union(T.ObjectConstant1, T.ObjectClass))); |
|
558 |
CheckSub( |
|
559 |
T.Union(T.ObjectClass, T.Union(T.ObjectConstant1, T.ObjectClass)), |
|
560 |
T.Any); |
|
561 |
CheckSub( |
|
527 | 562 |
T.Union(T.ObjectClass, T.Union(T.ObjectConstant1, T.ObjectClass)), |
528 | 563 |
T.Object); |
529 | 564 |
CheckEqual( |
... | ... | |
547 | 582 |
|
548 | 583 |
// Union-union |
549 | 584 |
CHECK(IsBitset(Type::Union( |
550 |
T.Union(T.Number, T.ArrayClass), T.Union(T.Integer32, T.Array))));
|
|
585 |
T.Union(T.Number, T.ArrayClass), T.Union(T.Signed32, T.Array))));
|
|
551 | 586 |
CHECK(IsUnion(Type::Union( |
552 | 587 |
T.Union(T.Number, T.ArrayClass), T.Union(T.ObjectClass, T.ArrayClass)))); |
553 | 588 |
|
... | ... | |
562 | 597 |
T.Union(T.ObjectConstant1, T.ArrayConstant2)), |
563 | 598 |
T.Union(T.Union(T.ObjectConstant1, T.ObjectConstant2), T.ArrayConstant1)); |
564 | 599 |
CheckEqual( |
565 |
T.Union(T.Union(T.Number, T.ArrayClass), T.Union(T.Integer31, T.Array)),
|
|
600 |
T.Union(T.Union(T.Number, T.ArrayClass), T.Union(T.Smi, T.Array)),
|
|
566 | 601 |
T.Union(T.Number, T.Array)); |
567 | 602 |
} |
568 | 603 |
|
569 | 604 |
|
570 | 605 |
TEST(Intersect) { |
571 | 606 |
CcTest::InitializeVM(); |
572 |
Isolate* isolate = Isolate::Current();
|
|
607 |
Isolate* isolate = CcTest::i_isolate();
|
|
573 | 608 |
HandleScope scope(isolate); |
574 | 609 |
HandlifiedTypes T(isolate); |
575 | 610 |
|
... | ... | |
610 | 645 |
CheckEqual(T.Intersect(T.ObjectClass, T.Number), T.None); |
611 | 646 |
|
612 | 647 |
// Bitset-constant |
613 |
CHECK(IsBitset(Type::Intersect(T.Integer31, T.Number)));
|
|
614 |
CHECK(IsConstant(Type::Intersect(T.Integer31Constant, T.Number)));
|
|
648 |
CHECK(IsBitset(Type::Intersect(T.Smi, T.Number)));
|
|
649 |
CHECK(IsConstant(Type::Intersect(T.SmiConstant, T.Number)));
|
|
615 | 650 |
CHECK(IsConstant(Type::Intersect(T.ObjectConstant1, T.Object))); |
616 | 651 |
|
617 |
CheckEqual(T.Intersect(T.Integer31, T.Number), T.Integer31);
|
|
618 |
CheckEqual(T.Intersect(T.Integer31Constant, T.Number), T.Integer31Constant);
|
|
652 |
CheckEqual(T.Intersect(T.Smi, T.Number), T.Smi);
|
|
653 |
CheckEqual(T.Intersect(T.SmiConstant, T.Number), T.SmiConstant);
|
|
619 | 654 |
CheckEqual(T.Intersect(T.ObjectConstant1, T.Object), T.ObjectConstant1); |
620 | 655 |
|
621 | 656 |
// Class-constant |
... | ... | |
642 | 677 |
CHECK(IsClass( |
643 | 678 |
Type::Intersect(T.Union(T.ArrayClass, T.ObjectConstant2), T.ArrayClass))); |
644 | 679 |
CHECK(IsClass( |
645 |
Type::Intersect(T.Union(T.Object, T.Integer31Constant), T.ArrayClass)));
|
|
680 |
Type::Intersect(T.Union(T.Object, T.SmiConstant), T.ArrayClass)));
|
|
646 | 681 |
CHECK(IsBitset( |
647 | 682 |
Type::Intersect(T.Union(T.ObjectClass, T.ArrayConstant1), T.ArrayClass))); |
648 | 683 |
|
... | ... | |
650 | 685 |
T.Intersect(T.ArrayClass, T.Union(T.ObjectConstant2, T.ArrayClass)), |
651 | 686 |
T.ArrayClass); |
652 | 687 |
CheckEqual( |
653 |
T.Intersect(T.ArrayClass, T.Union(T.Object, T.Integer31Constant)),
|
|
688 |
T.Intersect(T.ArrayClass, T.Union(T.Object, T.SmiConstant)),
|
|
654 | 689 |
T.ArrayClass); |
655 | 690 |
CheckEqual( |
656 | 691 |
T.Intersect(T.Union(T.ObjectClass, T.ArrayConstant1), T.ArrayClass), |
... | ... | |
660 | 695 |
CHECK(IsConstant(Type::Intersect( |
661 | 696 |
T.ObjectConstant1, T.Union(T.ObjectConstant1, T.ObjectConstant2)))); |
662 | 697 |
CHECK(IsConstant(Type::Intersect( |
663 |
T.Union(T.Number, T.ObjectClass), T.Integer31Constant)));
|
|
698 |
T.Union(T.Number, T.ObjectClass), T.SmiConstant)));
|
|
664 | 699 |
CHECK(IsBitset(Type::Intersect( |
665 | 700 |
T.Union(T.ArrayConstant1, T.ObjectClass), T.ObjectConstant1))); |
666 | 701 |
|
... | ... | |
669 | 704 |
T.ObjectConstant1, T.Union(T.ObjectConstant1, T.ObjectConstant2)), |
670 | 705 |
T.ObjectConstant1); |
671 | 706 |
CheckEqual( |
672 |
T.Intersect(T.Integer31Constant, T.Union(T.Number, T.ObjectConstant2)),
|
|
673 |
T.Integer31Constant);
|
|
707 |
T.Intersect(T.SmiConstant, T.Union(T.Number, T.ObjectConstant2)),
|
|
708 |
T.SmiConstant);
|
|
674 | 709 |
CheckEqual( |
675 | 710 |
T.Intersect(T.Union(T.ArrayConstant1, T.ObjectClass), T.ObjectConstant1), |
676 | 711 |
T.None); |
677 | 712 |
|
678 | 713 |
// Union-union |
679 | 714 |
CHECK(IsUnion(Type::Intersect( |
680 |
T.Union(T.Number, T.ArrayClass), T.Union(T.Integer32, T.Array))));
|
|
715 |
T.Union(T.Number, T.ArrayClass), T.Union(T.Signed32, T.Array))));
|
|
681 | 716 |
CHECK(IsBitset(Type::Intersect( |
682 |
T.Union(T.Number, T.ObjectClass), T.Union(T.Integer32, T.Array))));
|
|
717 |
T.Union(T.Number, T.ObjectClass), T.Union(T.Signed32, T.Array))));
|
|
683 | 718 |
|
684 | 719 |
CheckEqual( |
685 | 720 |
T.Intersect( |
686 | 721 |
T.Union(T.Number, T.ArrayClass), |
687 |
T.Union(T.Integer31, T.Array)),
|
|
688 |
T.Union(T.Integer31, T.ArrayClass));
|
|
722 |
T.Union(T.Smi, T.Array)),
|
|
723 |
T.Union(T.Smi, T.ArrayClass));
|
|
689 | 724 |
CheckEqual( |
690 | 725 |
T.Intersect( |
691 | 726 |
T.Union(T.Number, T.ObjectClass), |
692 |
T.Union(T.Integer32, T.Array)),
|
|
693 |
T.Integer32);
|
|
727 |
T.Union(T.Signed32, T.Array)),
|
|
728 |
T.Signed32);
|
|
694 | 729 |
CheckEqual( |
695 | 730 |
T.Intersect( |
696 | 731 |
T.Union(T.ObjectConstant2, T.ObjectConstant1), |
Also available in: Unified diff