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

Side by Side Diff: test/cctest/types-fuzz.h

Issue 877643002: Reland of "Steps towards unification of number bitset and range types." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Avoid (some of the) uninhabited type normalization based on representation. Created 5 years, 11 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 27 matching lines...) Expand all
38 class Types { 38 class Types {
39 public: 39 public:
40 Types(Region* region, Isolate* isolate) 40 Types(Region* region, Isolate* isolate)
41 : region_(region), rng_(isolate->random_number_generator()) { 41 : region_(region), rng_(isolate->random_number_generator()) {
42 #define DECLARE_TYPE(name, value) \ 42 #define DECLARE_TYPE(name, value) \
43 name = Type::name(region); \ 43 name = Type::name(region); \
44 types.push_back(name); 44 types.push_back(name);
45 PROPER_BITSET_TYPE_LIST(DECLARE_TYPE) 45 PROPER_BITSET_TYPE_LIST(DECLARE_TYPE)
46 #undef DECLARE_TYPE 46 #undef DECLARE_TYPE
47 47
48 SignedSmall = Type::SignedSmall(region);
49 UnsignedSmall = Type::UnsignedSmall(region);
50
48 object_map = isolate->factory()->NewMap( 51 object_map = isolate->factory()->NewMap(
49 JS_OBJECT_TYPE, JSObject::kHeaderSize); 52 JS_OBJECT_TYPE, JSObject::kHeaderSize);
50 array_map = isolate->factory()->NewMap( 53 array_map = isolate->factory()->NewMap(
51 JS_ARRAY_TYPE, JSArray::kSize); 54 JS_ARRAY_TYPE, JSArray::kSize);
52 number_map = isolate->factory()->NewMap( 55 number_map = isolate->factory()->NewMap(
53 HEAP_NUMBER_TYPE, HeapNumber::kSize); 56 HEAP_NUMBER_TYPE, HeapNumber::kSize);
54 uninitialized_map = isolate->factory()->uninitialized_map(); 57 uninitialized_map = isolate->factory()->uninitialized_map();
55 ObjectClass = Type::Class(object_map, region); 58 ObjectClass = Type::Class(object_map, region);
56 ArrayClass = Type::Class(array_map, region); 59 ArrayClass = Type::Class(array_map, region);
57 NumberClass = Type::Class(number_map, region); 60 NumberClass = Type::Class(number_map, region);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 Handle<i::Smi> smi; 126 Handle<i::Smi> smi;
124 Handle<i::HeapNumber> signed32; 127 Handle<i::HeapNumber> signed32;
125 Handle<i::JSObject> object1; 128 Handle<i::JSObject> object1;
126 Handle<i::JSObject> object2; 129 Handle<i::JSObject> object2;
127 Handle<i::JSArray> array; 130 Handle<i::JSArray> array;
128 Handle<i::Oddball> uninitialized; 131 Handle<i::Oddball> uninitialized;
129 132
130 #define DECLARE_TYPE(name, value) TypeHandle name; 133 #define DECLARE_TYPE(name, value) TypeHandle name;
131 PROPER_BITSET_TYPE_LIST(DECLARE_TYPE) 134 PROPER_BITSET_TYPE_LIST(DECLARE_TYPE)
132 #undef DECLARE_TYPE 135 #undef DECLARE_TYPE
136 TypeHandle SignedSmall;
137 TypeHandle UnsignedSmall;
133 138
134 TypeHandle ObjectClass; 139 TypeHandle ObjectClass;
135 TypeHandle ArrayClass; 140 TypeHandle ArrayClass;
136 TypeHandle NumberClass; 141 TypeHandle NumberClass;
137 TypeHandle UninitializedClass; 142 TypeHandle UninitializedClass;
138 143
139 TypeHandle SmiConstant; 144 TypeHandle SmiConstant;
140 TypeHandle Signed32Constant; 145 TypeHandle Signed32Constant;
141 TypeHandle ObjectConstant1; 146 TypeHandle ObjectConstant1;
142 TypeHandle ObjectConstant2; 147 TypeHandle ObjectConstant2;
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 307
303 private: 308 private:
304 Region* region_; 309 Region* region_;
305 v8::base::RandomNumberGenerator* rng_; 310 v8::base::RandomNumberGenerator* rng_;
306 }; 311 };
307 312
308 313
309 } } // namespace v8::internal 314 } } // namespace v8::internal
310 315
311 #endif 316 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698