| OLD | NEW |
| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 Handle<i::HeapNumber> signed32; | 101 Handle<i::HeapNumber> signed32; |
| 102 Handle<i::JSObject> object1; | 102 Handle<i::JSObject> object1; |
| 103 Handle<i::JSObject> object2; | 103 Handle<i::JSObject> object2; |
| 104 Handle<i::JSArray> array; | 104 Handle<i::JSArray> array; |
| 105 Handle<i::Oddball> uninitialized; | 105 Handle<i::Oddball> uninitialized; |
| 106 | 106 |
| 107 #define DECLARE_TYPE(name, value) Type* name; | 107 #define DECLARE_TYPE(name, value) Type* name; |
| 108 PROPER_BITSET_TYPE_LIST(DECLARE_TYPE) | 108 PROPER_BITSET_TYPE_LIST(DECLARE_TYPE) |
| 109 #undef DECLARE_TYPE | 109 #undef DECLARE_TYPE |
| 110 | 110 |
| 111 #define DECLARE_TYPE(name, value) Type* Mask##name##ForTesting; | |
| 112 MASK_BITSET_TYPE_LIST(DECLARE_TYPE) | |
| 113 #undef DECLARE_TYPE | |
| 114 Type* SignedSmall; | 111 Type* SignedSmall; |
| 115 Type* UnsignedSmall; | 112 Type* UnsignedSmall; |
| 116 | 113 |
| 117 Type* SmiConstant; | 114 Type* SmiConstant; |
| 118 Type* Signed32Constant; | 115 Type* Signed32Constant; |
| 119 Type* ObjectConstant1; | 116 Type* ObjectConstant1; |
| 120 Type* ObjectConstant2; | 117 Type* ObjectConstant2; |
| 121 Type* ArrayConstant; | 118 Type* ArrayConstant; |
| 122 Type* UninitializedConstant; | 119 Type* UninitializedConstant; |
| 123 | 120 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 135 Type* Constant(Handle<i::Object> value) { | 132 Type* Constant(Handle<i::Object> value) { |
| 136 return Type::Constant(value, zone_); | 133 return Type::Constant(value, zone_); |
| 137 } | 134 } |
| 138 | 135 |
| 139 Type* Range(double min, double max) { return Type::Range(min, max, zone_); } | 136 Type* Range(double min, double max) { return Type::Range(min, max, zone_); } |
| 140 | 137 |
| 141 Type* Union(Type* t1, Type* t2) { return Type::Union(t1, t2, zone_); } | 138 Type* Union(Type* t1, Type* t2) { return Type::Union(t1, t2, zone_); } |
| 142 | 139 |
| 143 Type* Intersect(Type* t1, Type* t2) { return Type::Intersect(t1, t2, zone_); } | 140 Type* Intersect(Type* t1, Type* t2) { return Type::Intersect(t1, t2, zone_); } |
| 144 | 141 |
| 145 Type* Semantic(Type* t) { return Type::Semantic(t, zone_); } | |
| 146 | |
| 147 Type* Random() { | 142 Type* Random() { |
| 148 return types[rng_->NextInt(static_cast<int>(types.size()))]; | 143 return types[rng_->NextInt(static_cast<int>(types.size()))]; |
| 149 } | 144 } |
| 150 | 145 |
| 151 Type* Fuzz(int depth = 4) { | 146 Type* Fuzz(int depth = 4) { |
| 152 switch (rng_->NextInt(depth == 0 ? 3 : 20)) { | 147 switch (rng_->NextInt(depth == 0 ? 3 : 20)) { |
| 153 case 0: { // bitset | 148 case 0: { // bitset |
| 154 #define COUNT_BITSET_TYPES(type, value) + 1 | 149 #define COUNT_BITSET_TYPES(type, value) + 1 |
| 155 int n = 0 PROPER_BITSET_TYPE_LIST(COUNT_BITSET_TYPES); | 150 int n = 0 PROPER_BITSET_TYPE_LIST(COUNT_BITSET_TYPES); |
| 156 #undef COUNT_BITSET_TYPES | 151 #undef COUNT_BITSET_TYPES |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 private: | 198 private: |
| 204 Zone* zone_; | 199 Zone* zone_; |
| 205 v8::base::RandomNumberGenerator* rng_; | 200 v8::base::RandomNumberGenerator* rng_; |
| 206 }; | 201 }; |
| 207 | 202 |
| 208 } // namespace compiler | 203 } // namespace compiler |
| 209 } // namespace internal | 204 } // namespace internal |
| 210 } // namespace v8 | 205 } // namespace v8 |
| 211 | 206 |
| 212 #endif | 207 #endif |
| OLD | NEW |