| 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 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 Type* Typer::Visitor::TypeCheckBounds(Node* node) { | 1799 Type* Typer::Visitor::TypeCheckBounds(Node* node) { |
| 1800 // TODO(bmeurer): We could do better here based on the limit. | 1800 // TODO(bmeurer): We could do better here based on the limit. |
| 1801 return Type::Unsigned31(); | 1801 return Type::Unsigned31(); |
| 1802 } | 1802 } |
| 1803 | 1803 |
| 1804 Type* Typer::Visitor::TypeCheckNumber(Node* node) { | 1804 Type* Typer::Visitor::TypeCheckNumber(Node* node) { |
| 1805 Type* arg = Operand(node, 0); | 1805 Type* arg = Operand(node, 0); |
| 1806 return Type::Intersect(arg, Type::Number(), zone()); | 1806 return Type::Intersect(arg, Type::Number(), zone()); |
| 1807 } | 1807 } |
| 1808 | 1808 |
| 1809 Type* Typer::Visitor::TypeCheckString(Node* node) { |
| 1810 Type* arg = Operand(node, 0); |
| 1811 return Type::Intersect(arg, Type::String(), zone()); |
| 1812 } |
| 1813 |
| 1809 Type* Typer::Visitor::TypeCheckIf(Node* node) { | 1814 Type* Typer::Visitor::TypeCheckIf(Node* node) { |
| 1810 UNREACHABLE(); | 1815 UNREACHABLE(); |
| 1811 return nullptr; | 1816 return nullptr; |
| 1812 } | 1817 } |
| 1813 | 1818 |
| 1814 Type* Typer::Visitor::TypeCheckTaggedPointer(Node* node) { | 1819 Type* Typer::Visitor::TypeCheckTaggedPointer(Node* node) { |
| 1815 Type* arg = Operand(node, 0); | 1820 Type* arg = Operand(node, 0); |
| 1816 return Type::Intersect(arg, Type::TaggedPointer(), zone()); | 1821 return Type::Intersect(arg, Type::TaggedPointer(), zone()); |
| 1817 } | 1822 } |
| 1818 | 1823 |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2604 } | 2609 } |
| 2605 if (Type::IsInteger(*value)) { | 2610 if (Type::IsInteger(*value)) { |
| 2606 return Type::Range(value->Number(), value->Number(), zone()); | 2611 return Type::Range(value->Number(), value->Number(), zone()); |
| 2607 } | 2612 } |
| 2608 return Type::Constant(value, zone()); | 2613 return Type::Constant(value, zone()); |
| 2609 } | 2614 } |
| 2610 | 2615 |
| 2611 } // namespace compiler | 2616 } // namespace compiler |
| 2612 } // namespace internal | 2617 } // namespace internal |
| 2613 } // namespace v8 | 2618 } // namespace v8 |
| OLD | NEW |