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/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
(...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2011 Type* Typer::Visitor::TypeCheckTaggedPointer(Node* node) { | 2011 Type* Typer::Visitor::TypeCheckTaggedPointer(Node* node) { |
2012 Type* arg = Operand(node, 0); | 2012 Type* arg = Operand(node, 0); |
2013 return Type::Intersect(arg, Type::TaggedPointer(), zone()); | 2013 return Type::Intersect(arg, Type::TaggedPointer(), zone()); |
2014 } | 2014 } |
2015 | 2015 |
2016 Type* Typer::Visitor::TypeCheckTaggedSigned(Node* node) { | 2016 Type* Typer::Visitor::TypeCheckTaggedSigned(Node* node) { |
2017 Type* arg = Operand(node, 0); | 2017 Type* arg = Operand(node, 0); |
2018 return Type::Intersect(arg, typer_->cache_.kSmi, zone()); | 2018 return Type::Intersect(arg, typer_->cache_.kSmi, zone()); |
2019 } | 2019 } |
2020 | 2020 |
| 2021 Type* Typer::Visitor::TypeCheckedInt32Add(Node* node) { |
| 2022 return Type::Integral32(); |
| 2023 } |
| 2024 |
| 2025 Type* Typer::Visitor::TypeCheckedInt32Sub(Node* node) { |
| 2026 return Type::Integral32(); |
| 2027 } |
| 2028 |
2021 Type* Typer::Visitor::TypeCheckedUint32ToInt32(Node* node) { | 2029 Type* Typer::Visitor::TypeCheckedUint32ToInt32(Node* node) { |
2022 return Type::Signed32(); | 2030 return Type::Signed32(); |
2023 } | 2031 } |
2024 | 2032 |
2025 Type* Typer::Visitor::TypeCheckedFloat64ToInt32(Node* node) { | 2033 Type* Typer::Visitor::TypeCheckedFloat64ToInt32(Node* node) { |
2026 return Type::Signed32(); | 2034 return Type::Signed32(); |
2027 } | 2035 } |
2028 | 2036 |
2029 Type* Typer::Visitor::TypeCheckedTaggedToInt32(Node* node) { | 2037 Type* Typer::Visitor::TypeCheckedTaggedToInt32(Node* node) { |
2030 return Type::Signed32(); | 2038 return Type::Signed32(); |
(...skipping 19 matching lines...) Expand all Loading... |
2050 break; | 2058 break; |
2051 } | 2059 } |
2052 case CheckTaggedHoleMode::kNeverReturnHole: { | 2060 case CheckTaggedHoleMode::kNeverReturnHole: { |
2053 // We deoptimize in case of the hole. | 2061 // We deoptimize in case of the hole. |
2054 break; | 2062 break; |
2055 } | 2063 } |
2056 } | 2064 } |
2057 return type; | 2065 return type; |
2058 } | 2066 } |
2059 | 2067 |
2060 Type* Typer::Visitor::TypeCheckIf(Node* node) { | |
2061 UNREACHABLE(); | |
2062 return nullptr; | |
2063 } | |
2064 | |
2065 Type* Typer::Visitor::TypeTruncateTaggedToWord32(Node* node) { | 2068 Type* Typer::Visitor::TypeTruncateTaggedToWord32(Node* node) { |
2066 Type* arg = Operand(node, 0); | 2069 Type* arg = Operand(node, 0); |
2067 // TODO(jarin): DCHECK(arg->Is(Type::NumberOrUndefined())); | 2070 // TODO(jarin): DCHECK(arg->Is(Type::NumberOrUndefined())); |
2068 // Several mjsunit and cctest tests fail this check. For instance, | 2071 // Several mjsunit and cctest tests fail this check. For instance, |
2069 // mjsunit/compiler/regress-607493 fails with Any/Any in simplified-lowering | 2072 // mjsunit/compiler/regress-607493 fails with Any/Any in simplified-lowering |
2070 // (after propagation). | 2073 // (after propagation). |
2071 return ChangeRepresentation(arg, Type::UntaggedIntegral32(), zone()); | 2074 return ChangeRepresentation(arg, Type::UntaggedIntegral32(), zone()); |
2072 } | 2075 } |
2073 | 2076 |
2074 Type* Typer::Visitor::TypeAllocate(Node* node) { return Type::TaggedPointer(); } | 2077 Type* Typer::Visitor::TypeAllocate(Node* node) { return Type::TaggedPointer(); } |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2794 } | 2797 } |
2795 if (Type::IsInteger(*value)) { | 2798 if (Type::IsInteger(*value)) { |
2796 return Type::Range(value->Number(), value->Number(), zone()); | 2799 return Type::Range(value->Number(), value->Number(), zone()); |
2797 } | 2800 } |
2798 return Type::Constant(value, zone()); | 2801 return Type::Constant(value, zone()); |
2799 } | 2802 } |
2800 | 2803 |
2801 } // namespace compiler | 2804 } // namespace compiler |
2802 } // namespace internal | 2805 } // namespace internal |
2803 } // namespace v8 | 2806 } // namespace v8 |
OLD | NEW |