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/base/lazy-instance.h" | 8 #include "src/base/lazy-instance.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1650 return nullptr; | 1650 return nullptr; |
1651 } | 1651 } |
1652 | 1652 |
1653 | 1653 |
1654 Type* Typer::Visitor::TypeStoreElement(Node* node) { | 1654 Type* Typer::Visitor::TypeStoreElement(Node* node) { |
1655 UNREACHABLE(); | 1655 UNREACHABLE(); |
1656 return nullptr; | 1656 return nullptr; |
1657 } | 1657 } |
1658 | 1658 |
1659 | 1659 |
1660 Type* Typer::Visitor::TypeObjectIsSmi(Node* node) { return Type::Boolean(); } | 1660 Type* Typer::Visitor::TypeObjectIsSmi(Node* node) { |
| 1661 Type* arg = Operand(node, 0); |
| 1662 if (arg->Is(Type::None())) return Type::None(); |
| 1663 if (arg->Is(Type::TaggedSigned())) return typer_->singleton_true_; |
| 1664 if (arg->Is(Type::TaggedPointer())) return typer_->singleton_false_; |
| 1665 return Type::Boolean(); |
| 1666 } |
1661 | 1667 |
1662 | 1668 |
1663 // Machine operators. | 1669 // Machine operators. |
1664 | 1670 |
1665 Type* Typer::Visitor::TypeLoad(Node* node) { return Type::Any(); } | 1671 Type* Typer::Visitor::TypeLoad(Node* node) { return Type::Any(); } |
1666 | 1672 |
1667 | 1673 |
1668 Type* Typer::Visitor::TypeStore(Node* node) { | 1674 Type* Typer::Visitor::TypeStore(Node* node) { |
1669 UNREACHABLE(); | 1675 UNREACHABLE(); |
1670 return nullptr; | 1676 return nullptr; |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2105 } | 2111 } |
2106 if (Type::IsInteger(*value)) { | 2112 if (Type::IsInteger(*value)) { |
2107 return Type::Range(value->Number(), value->Number(), zone()); | 2113 return Type::Range(value->Number(), value->Number(), zone()); |
2108 } | 2114 } |
2109 return Type::Constant(value, zone()); | 2115 return Type::Constant(value, zone()); |
2110 } | 2116 } |
2111 | 2117 |
2112 } // namespace compiler | 2118 } // namespace compiler |
2113 } // namespace internal | 2119 } // namespace internal |
2114 } // namespace v8 | 2120 } // namespace v8 |
OLD | NEW |