| OLD | NEW |
| 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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 struct Bounds { | 296 struct Bounds { |
| 297 Handle<Type> lower; | 297 Handle<Type> lower; |
| 298 Handle<Type> upper; | 298 Handle<Type> upper; |
| 299 | 299 |
| 300 Bounds() {} | 300 Bounds() {} |
| 301 Bounds(Handle<Type> l, Handle<Type> u) : lower(l), upper(u) {} | 301 Bounds(Handle<Type> l, Handle<Type> u) : lower(l), upper(u) {} |
| 302 Bounds(Type* l, Type* u, Isolate* isl) : lower(l, isl), upper(u, isl) {} | 302 Bounds(Type* l, Type* u, Isolate* isl) : lower(l, isl), upper(u, isl) {} |
| 303 explicit Bounds(Handle<Type> t) : lower(t), upper(t) {} | 303 explicit Bounds(Handle<Type> t) : lower(t), upper(t) {} |
| 304 Bounds(Type* t, Isolate* isl) : lower(t, isl), upper(t, isl) {} | 304 Bounds(Type* t, Isolate* isl) : lower(t, isl), upper(t, isl) {} |
| 305 | 305 |
| 306 // Unrestricted bounds. |
| 307 static Bounds Unbounded(Isolate* isl) { |
| 308 return Bounds(Type::None(), Type::Any(), isl); |
| 309 } |
| 310 |
| 306 // Meet: both b1 and b2 are known to hold. | 311 // Meet: both b1 and b2 are known to hold. |
| 307 static Bounds Both(Bounds b1, Bounds b2, Isolate* isl) { | 312 static Bounds Both(Bounds b1, Bounds b2, Isolate* isl) { |
| 308 return Bounds( | 313 return Bounds( |
| 309 handle(Type::Union(b1.lower, b2.lower), isl), | 314 handle(Type::Union(b1.lower, b2.lower), isl), |
| 310 handle(Type::Intersect(b1.upper, b2.upper), isl)); | 315 handle(Type::Intersect(b1.upper, b2.upper), isl)); |
| 311 } | 316 } |
| 312 | 317 |
| 313 // Join: either b1 or b2 is known to hold. | 318 // Join: either b1 or b2 is known to hold. |
| 314 static Bounds Either(Bounds b1, Bounds b2, Isolate* isl) { | 319 static Bounds Either(Bounds b1, Bounds b2, Isolate* isl) { |
| 315 return Bounds( | 320 return Bounds( |
| 316 handle(Type::Intersect(b1.lower, b2.lower), isl), | 321 handle(Type::Intersect(b1.lower, b2.lower), isl), |
| 317 handle(Type::Union(b1.upper, b2.upper), isl)); | 322 handle(Type::Union(b1.upper, b2.upper), isl)); |
| 318 } | 323 } |
| 319 | 324 |
| 320 static Bounds NarrowLower(Bounds b, Handle<Type> t, Isolate* isl) { | 325 static Bounds NarrowLower(Bounds b, Handle<Type> t, Isolate* isl) { |
| 321 return Bounds(handle(Type::Union(b.lower, t), isl), b.upper); | 326 return Bounds(handle(Type::Union(b.lower, t), isl), b.upper); |
| 322 } | 327 } |
| 323 static Bounds NarrowUpper(Bounds b, Handle<Type> t, Isolate* isl) { | 328 static Bounds NarrowUpper(Bounds b, Handle<Type> t, Isolate* isl) { |
| 324 return Bounds(b.lower, handle(Type::Intersect(b.upper, t), isl)); | 329 return Bounds(b.lower, handle(Type::Intersect(b.upper, t), isl)); |
| 325 } | 330 } |
| 326 }; | 331 }; |
| 327 | 332 |
| 328 } } // namespace v8::internal | 333 } } // namespace v8::internal |
| 329 | 334 |
| 330 #endif // V8_TYPES_H_ | 335 #endif // V8_TYPES_H_ |
| OLD | NEW |