| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/operation-typer.h" | 5 #include "src/compiler/operation-typer.h" |
| 6 | 6 |
| 7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
| 8 #include "src/compiler/type-cache.h" | 8 #include "src/compiler/type-cache.h" |
| 9 #include "src/compiler/types.h" | 9 #include "src/compiler/types.h" |
| 10 #include "src/factory.h" | 10 #include "src/factory.h" |
| (...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 if ((outcome & kComparisonFalse) != 0 || | 1002 if ((outcome & kComparisonFalse) != 0 || |
| 1003 (outcome & kComparisonUndefined) != 0) { | 1003 (outcome & kComparisonUndefined) != 0) { |
| 1004 return (outcome & kComparisonTrue) != 0 ? Type::Boolean() | 1004 return (outcome & kComparisonTrue) != 0 ? Type::Boolean() |
| 1005 : singleton_false(); | 1005 : singleton_false(); |
| 1006 } | 1006 } |
| 1007 // Type should be non empty, so we know it should be true. | 1007 // Type should be non empty, so we know it should be true. |
| 1008 DCHECK((outcome & kComparisonTrue) != 0); | 1008 DCHECK((outcome & kComparisonTrue) != 0); |
| 1009 return singleton_true(); | 1009 return singleton_true(); |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 Type* OperationTyper::CheckFloat64Hole(Type* type) { |
| 1013 if (type->Maybe(Type::Hole())) { |
| 1014 // Turn "the hole" into undefined. |
| 1015 type = Type::Intersect(type, Type::Number(), zone()); |
| 1016 type = Type::Union(type, Type::Undefined(), zone()); |
| 1017 } |
| 1018 return type; |
| 1019 } |
| 1020 |
| 1021 Type* OperationTyper::CheckNumber(Type* type) { |
| 1022 return Type::Intersect(type, Type::Number(), zone()); |
| 1023 } |
| 1024 |
| 1012 Type* OperationTyper::TypeTypeGuard(const Operator* sigma_op, Type* input) { | 1025 Type* OperationTyper::TypeTypeGuard(const Operator* sigma_op, Type* input) { |
| 1013 return Type::Intersect(input, TypeGuardTypeOf(sigma_op), zone()); | 1026 return Type::Intersect(input, TypeGuardTypeOf(sigma_op), zone()); |
| 1014 } | 1027 } |
| 1015 | 1028 |
| 1016 } // namespace compiler | 1029 } // namespace compiler |
| 1017 } // namespace internal | 1030 } // namespace internal |
| 1018 } // namespace v8 | 1031 } // namespace v8 |
| OLD | NEW |