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

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

Issue 227473002: Use distinct maps for oddballs with special handling in the type system. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Put kInternal last. Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/types.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 20 matching lines...) Expand all
31 using namespace v8::internal; 31 using namespace v8::internal;
32 32
33 template<class Type, class TypeHandle, class Region> 33 template<class Type, class TypeHandle, class Region>
34 class Types { 34 class Types {
35 public: 35 public:
36 Types(Region* region, Isolate* isolate) : 36 Types(Region* region, Isolate* isolate) :
37 Representation(Type::Representation(region)), 37 Representation(Type::Representation(region)),
38 Semantic(Type::Semantic(region)), 38 Semantic(Type::Semantic(region)),
39 None(Type::None(region)), 39 None(Type::None(region)),
40 Any(Type::Any(region)), 40 Any(Type::Any(region)),
41 Oddball(Type::Oddball(region)),
42 Boolean(Type::Boolean(region)), 41 Boolean(Type::Boolean(region)),
43 Null(Type::Null(region)), 42 Null(Type::Null(region)),
44 Undefined(Type::Undefined(region)), 43 Undefined(Type::Undefined(region)),
45 Number(Type::Number(region)), 44 Number(Type::Number(region)),
46 SignedSmall(Type::SignedSmall(region)), 45 SignedSmall(Type::SignedSmall(region)),
47 Signed32(Type::Signed32(region)), 46 Signed32(Type::Signed32(region)),
48 Float(Type::Float(region)), 47 Float(Type::Float(region)),
49 Name(Type::Name(region)), 48 Name(Type::Name(region)),
50 UniqueName(Type::UniqueName(region)), 49 UniqueName(Type::UniqueName(region)),
51 String(Type::String(region)), 50 String(Type::String(region)),
(...skipping 19 matching lines...) Expand all
71 ObjectConstant1 = Type::Constant(object1, region); 70 ObjectConstant1 = Type::Constant(object1, region);
72 ObjectConstant2 = Type::Constant(object2, region); 71 ObjectConstant2 = Type::Constant(object2, region);
73 ArrayConstant1 = Type::Constant(array, region); 72 ArrayConstant1 = Type::Constant(array, region);
74 ArrayConstant2 = Type::Constant(array, region); 73 ArrayConstant2 = Type::Constant(array, region);
75 } 74 }
76 75
77 TypeHandle Representation; 76 TypeHandle Representation;
78 TypeHandle Semantic; 77 TypeHandle Semantic;
79 TypeHandle None; 78 TypeHandle None;
80 TypeHandle Any; 79 TypeHandle Any;
81 TypeHandle Oddball;
82 TypeHandle Boolean; 80 TypeHandle Boolean;
83 TypeHandle Null; 81 TypeHandle Null;
84 TypeHandle Undefined; 82 TypeHandle Undefined;
85 TypeHandle Number; 83 TypeHandle Number;
86 TypeHandle SignedSmall; 84 TypeHandle SignedSmall;
87 TypeHandle Signed32; 85 TypeHandle Signed32;
88 TypeHandle Float; 86 TypeHandle Float;
89 TypeHandle Name; 87 TypeHandle Name;
90 TypeHandle UniqueName; 88 TypeHandle UniqueName;
91 TypeHandle String; 89 TypeHandle String;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 CHECK(T.Object->Is(T.Object)); 342 CHECK(T.Object->Is(T.Object));
345 343
346 CHECK(T.ObjectClass->Is(T.ObjectClass)); 344 CHECK(T.ObjectClass->Is(T.ObjectClass));
347 CHECK(T.ObjectConstant1->Is(T.ObjectConstant1)); 345 CHECK(T.ObjectConstant1->Is(T.ObjectConstant1));
348 CHECK(T.ArrayConstant1->Is(T.ArrayConstant2)); 346 CHECK(T.ArrayConstant1->Is(T.ArrayConstant2));
349 347
350 // Symmetry and Transitivity 348 // Symmetry and Transitivity
351 CheckSub(T.None, T.Number); 349 CheckSub(T.None, T.Number);
352 CheckSub(T.None, T.Any); 350 CheckSub(T.None, T.Any);
353 351
354 CheckSub(T.Oddball, T.Any);
355 CheckSub(T.Boolean, T.Oddball);
356 CheckSub(T.Null, T.Oddball);
357 CheckSub(T.Undefined, T.Oddball);
358 CheckUnordered(T.Boolean, T.Null); 352 CheckUnordered(T.Boolean, T.Null);
359 CheckUnordered(T.Undefined, T.Null); 353 CheckUnordered(T.Undefined, T.Null);
360 CheckUnordered(T.Boolean, T.Undefined); 354 CheckUnordered(T.Boolean, T.Undefined);
361 355
362 CheckSub(T.Number, T.Any); 356 CheckSub(T.Number, T.Any);
363 CheckSub(T.SignedSmall, T.Number); 357 CheckSub(T.SignedSmall, T.Number);
364 CheckSub(T.Signed32, T.Number); 358 CheckSub(T.Signed32, T.Number);
365 CheckSub(T.Float, T.Number); 359 CheckSub(T.Float, T.Number);
366 CheckSub(T.SignedSmall, T.Signed32); 360 CheckSub(T.SignedSmall, T.Signed32);
367 CheckUnordered(T.SignedSmall, T.Float); 361 CheckUnordered(T.SignedSmall, T.Float);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 CheckUnordered(T.ObjectConstant2, T.ObjectClass); 407 CheckUnordered(T.ObjectConstant2, T.ObjectClass);
414 CheckUnordered(T.ObjectConstant1, T.ArrayClass); 408 CheckUnordered(T.ObjectConstant1, T.ArrayClass);
415 CheckUnordered(T.ObjectConstant2, T.ArrayClass); 409 CheckUnordered(T.ObjectConstant2, T.ArrayClass);
416 CheckUnordered(T.ArrayConstant1, T.ObjectClass); 410 CheckUnordered(T.ArrayConstant1, T.ObjectClass);
417 } 411 }
418 412
419 void Maybe() { 413 void Maybe() {
420 CheckOverlap(T.Any, T.Any, T.Semantic); 414 CheckOverlap(T.Any, T.Any, T.Semantic);
421 CheckOverlap(T.Object, T.Object, T.Semantic); 415 CheckOverlap(T.Object, T.Object, T.Semantic);
422 416
423 CheckOverlap(T.Oddball, T.Any, T.Semantic);
424 CheckOverlap(T.Boolean, T.Oddball, T.Semantic);
425 CheckOverlap(T.Null, T.Oddball, T.Semantic);
426 CheckOverlap(T.Undefined, T.Oddball, T.Semantic);
427 CheckDisjoint(T.Boolean, T.Null, T.Semantic); 417 CheckDisjoint(T.Boolean, T.Null, T.Semantic);
428 CheckDisjoint(T.Undefined, T.Null, T.Semantic); 418 CheckDisjoint(T.Undefined, T.Null, T.Semantic);
429 CheckDisjoint(T.Boolean, T.Undefined, T.Semantic); 419 CheckDisjoint(T.Boolean, T.Undefined, T.Semantic);
430 420
431 CheckOverlap(T.Number, T.Any, T.Semantic); 421 CheckOverlap(T.Number, T.Any, T.Semantic);
432 CheckOverlap(T.SignedSmall, T.Number, T.Semantic); 422 CheckOverlap(T.SignedSmall, T.Number, T.Semantic);
433 CheckOverlap(T.Float, T.Number, T.Semantic); 423 CheckOverlap(T.Float, T.Number, T.Semantic);
434 CheckDisjoint(T.Signed32, T.Float, T.Semantic); 424 CheckDisjoint(T.Signed32, T.Float, T.Semantic);
435 425
436 CheckOverlap(T.Name, T.Any, T.Semantic); 426 CheckOverlap(T.Name, T.Any, T.Semantic);
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 ZoneTests().Intersect(); 877 ZoneTests().Intersect();
888 HeapTests().Intersect(); 878 HeapTests().Intersect();
889 } 879 }
890 880
891 881
892 TEST(Convert) { 882 TEST(Convert) {
893 CcTest::InitializeVM(); 883 CcTest::InitializeVM();
894 ZoneTests().Convert<HeapType, Handle<HeapType>, Isolate, HeapRep>(); 884 ZoneTests().Convert<HeapType, Handle<HeapType>, Isolate, HeapRep>();
895 HeapTests().Convert<Type, Type*, Zone, ZoneRep>(); 885 HeapTests().Convert<Type, Type*, Zone, ZoneRep>();
896 } 886 }
OLDNEW
« no previous file with comments | « src/types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698