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 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1821 Type* Typer::Visitor::TypeChangeBitToTagged(Node* node) { | 1821 Type* Typer::Visitor::TypeChangeBitToTagged(Node* node) { |
1822 Type* arg = Operand(node, 0); | 1822 Type* arg = Operand(node, 0); |
1823 return ChangeRepresentation(arg, Type::TaggedPointer(), zone()); | 1823 return ChangeRepresentation(arg, Type::TaggedPointer(), zone()); |
1824 } | 1824 } |
1825 | 1825 |
1826 Type* Typer::Visitor::TypeCheckBounds(Node* node) { | 1826 Type* Typer::Visitor::TypeCheckBounds(Node* node) { |
1827 // TODO(bmeurer): We could do better here based on the limit. | 1827 // TODO(bmeurer): We could do better here based on the limit. |
1828 return Type::Unsigned31(); | 1828 return Type::Unsigned31(); |
1829 } | 1829 } |
1830 | 1830 |
| 1831 Type* Typer::Visitor::TypeCheckNumber(Node* node) { |
| 1832 Type* arg = Operand(node, 0); |
| 1833 return Type::Intersect(arg, Type::Number(), zone()); |
| 1834 } |
| 1835 |
1831 Type* Typer::Visitor::TypeCheckTaggedPointer(Node* node) { | 1836 Type* Typer::Visitor::TypeCheckTaggedPointer(Node* node) { |
1832 Type* arg = Operand(node, 0); | 1837 Type* arg = Operand(node, 0); |
1833 return Type::Intersect(arg, Type::TaggedPointer(), zone()); | 1838 return Type::Intersect(arg, Type::TaggedPointer(), zone()); |
1834 } | 1839 } |
1835 | 1840 |
1836 Type* Typer::Visitor::TypeCheckTaggedSigned(Node* node) { | 1841 Type* Typer::Visitor::TypeCheckTaggedSigned(Node* node) { |
1837 Type* arg = Operand(node, 0); | 1842 Type* arg = Operand(node, 0); |
1838 return Type::Intersect(arg, typer_->cache_.kSmi, zone()); | 1843 return Type::Intersect(arg, typer_->cache_.kSmi, zone()); |
1839 } | 1844 } |
1840 | 1845 |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2619 } | 2624 } |
2620 if (Type::IsInteger(*value)) { | 2625 if (Type::IsInteger(*value)) { |
2621 return Type::Range(value->Number(), value->Number(), zone()); | 2626 return Type::Range(value->Number(), value->Number(), zone()); |
2622 } | 2627 } |
2623 return Type::Constant(value, zone()); | 2628 return Type::Constant(value, zone()); |
2624 } | 2629 } |
2625 | 2630 |
2626 } // namespace compiler | 2631 } // namespace compiler |
2627 } // namespace internal | 2632 } // namespace internal |
2628 } // namespace v8 | 2633 } // namespace v8 |
OLD | NEW |