| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/typer.h" | 5 #include "src/compiler/typer.h" |
| 6 | 6 |
| 7 #include "src/base/flags.h" | 7 #include "src/base/flags.h" |
| 8 #include "src/base/lazy-instance.h" | 8 #include "src/base/lazy-instance.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 Zone* zone = this->zone(); | 46 Zone* zone = this->zone(); |
| 47 Factory* const factory = isolate->factory(); | 47 Factory* const factory = isolate->factory(); |
| 48 | 48 |
| 49 Type* infinity = Type::Constant(factory->infinity_value(), zone); | 49 Type* infinity = Type::Constant(factory->infinity_value(), zone); |
| 50 Type* minus_infinity = Type::Constant(factory->minus_infinity_value(), zone); | 50 Type* minus_infinity = Type::Constant(factory->minus_infinity_value(), zone); |
| 51 // TODO(neis): Unfortunately, the infinities created in other places might | 51 // TODO(neis): Unfortunately, the infinities created in other places might |
| 52 // be different ones (eg the result of NewNumber in TypeNumberConstant). | 52 // be different ones (eg the result of NewNumber in TypeNumberConstant). |
| 53 Type* truncating_to_zero = | 53 Type* truncating_to_zero = |
| 54 Type::Union(Type::Union(infinity, minus_infinity, zone), | 54 Type::Union(Type::Union(infinity, minus_infinity, zone), |
| 55 Type::MinusZeroOrNaN(), zone); | 55 Type::MinusZeroOrNaN(), zone); |
| 56 DCHECK(!truncating_to_zero->Maybe(Type::Integral32())); |
| 56 | 57 |
| 57 singleton_false_ = Type::Constant(factory->false_value(), zone); | 58 singleton_false_ = Type::Constant(factory->false_value(), zone); |
| 58 singleton_true_ = Type::Constant(factory->true_value(), zone); | 59 singleton_true_ = Type::Constant(factory->true_value(), zone); |
| 59 signed32ish_ = Type::Union(Type::Signed32(), truncating_to_zero, zone); | 60 signed32ish_ = Type::Union(Type::Signed32(), truncating_to_zero, zone); |
| 60 unsigned32ish_ = Type::Union(Type::Unsigned32(), truncating_to_zero, zone); | 61 unsigned32ish_ = Type::Union(Type::Unsigned32(), truncating_to_zero, zone); |
| 61 falsish_ = Type::Union( | 62 falsish_ = Type::Union( |
| 62 Type::Undetectable(), | 63 Type::Undetectable(), |
| 63 Type::Union(Type::Union(singleton_false_, cache_.kZeroish, zone), | 64 Type::Union(Type::Union(singleton_false_, cache_.kZeroish, zone), |
| 64 Type::NullOrUndefined(), zone), | 65 Type::NullOrUndefined(), zone), |
| 65 zone); | 66 zone); |
| (...skipping 2229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2295 } | 2296 } |
| 2296 if (Type::IsInteger(*value)) { | 2297 if (Type::IsInteger(*value)) { |
| 2297 return Type::Range(value->Number(), value->Number(), zone()); | 2298 return Type::Range(value->Number(), value->Number(), zone()); |
| 2298 } | 2299 } |
| 2299 return Type::Constant(value, zone()); | 2300 return Type::Constant(value, zone()); |
| 2300 } | 2301 } |
| 2301 | 2302 |
| 2302 } // namespace compiler | 2303 } // namespace compiler |
| 2303 } // namespace internal | 2304 } // namespace internal |
| 2304 } // namespace v8 | 2305 } // namespace v8 |
| OLD | NEW |