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 <iomanip> | 7 #include <iomanip> |
8 | 8 |
9 #include "src/base/flags.h" | 9 #include "src/base/flags.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 Type* Typer::Visitor::TypeCheckMaps(Node* node) { | 1724 Type* Typer::Visitor::TypeCheckMaps(Node* node) { |
1725 UNREACHABLE(); | 1725 UNREACHABLE(); |
1726 return nullptr; | 1726 return nullptr; |
1727 } | 1727 } |
1728 | 1728 |
1729 Type* Typer::Visitor::TypeCheckNumber(Node* node) { | 1729 Type* Typer::Visitor::TypeCheckNumber(Node* node) { |
1730 Type* arg = Operand(node, 0); | 1730 Type* arg = Operand(node, 0); |
1731 return Type::Intersect(arg, Type::Number(), zone()); | 1731 return Type::Intersect(arg, Type::Number(), zone()); |
1732 } | 1732 } |
1733 | 1733 |
| 1734 Type* Typer::Visitor::TypeCheckReceiver(Node* node) { |
| 1735 Type* arg = Operand(node, 0); |
| 1736 return Type::Intersect(arg, Type::Receiver(), zone()); |
| 1737 } |
| 1738 |
1734 Type* Typer::Visitor::TypeCheckSmi(Node* node) { | 1739 Type* Typer::Visitor::TypeCheckSmi(Node* node) { |
1735 Type* arg = Operand(node, 0); | 1740 Type* arg = Operand(node, 0); |
1736 return Type::Intersect(arg, Type::SignedSmall(), zone()); | 1741 return Type::Intersect(arg, Type::SignedSmall(), zone()); |
1737 } | 1742 } |
1738 | 1743 |
1739 Type* Typer::Visitor::TypeCheckString(Node* node) { | 1744 Type* Typer::Visitor::TypeCheckString(Node* node) { |
1740 Type* arg = Operand(node, 0); | 1745 Type* arg = Operand(node, 0); |
1741 return Type::Intersect(arg, Type::String(), zone()); | 1746 return Type::Intersect(arg, Type::String(), zone()); |
1742 } | 1747 } |
1743 | 1748 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1862 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { | 1867 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { |
1863 if (Type::IsInteger(*value)) { | 1868 if (Type::IsInteger(*value)) { |
1864 return Type::Range(value->Number(), value->Number(), zone()); | 1869 return Type::Range(value->Number(), value->Number(), zone()); |
1865 } | 1870 } |
1866 return Type::NewConstant(value, zone()); | 1871 return Type::NewConstant(value, zone()); |
1867 } | 1872 } |
1868 | 1873 |
1869 } // namespace compiler | 1874 } // namespace compiler |
1870 } // namespace internal | 1875 } // namespace internal |
1871 } // namespace v8 | 1876 } // namespace v8 |
OLD | NEW |