| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 #define DECLARE_CASE(x) \ | 82 #define DECLARE_CASE(x) \ |
| 83 case IrOpcode::k##x: \ | 83 case IrOpcode::k##x: \ |
| 84 return UpdateType(node, Type##x(node)); | 84 return UpdateType(node, Type##x(node)); |
| 85 DECLARE_CASE(Start) | 85 DECLARE_CASE(Start) |
| 86 DECLARE_CASE(IfException) | 86 DECLARE_CASE(IfException) |
| 87 // VALUE_OP_LIST without JS_SIMPLE_BINOP_LIST: | 87 // VALUE_OP_LIST without JS_SIMPLE_BINOP_LIST: |
| 88 COMMON_OP_LIST(DECLARE_CASE) | 88 COMMON_OP_LIST(DECLARE_CASE) |
| 89 SIMPLIFIED_COMPARE_BINOP_LIST(DECLARE_CASE) | 89 SIMPLIFIED_COMPARE_BINOP_LIST(DECLARE_CASE) |
| 90 SIMPLIFIED_OTHER_OP_LIST(DECLARE_CASE) | 90 SIMPLIFIED_OTHER_OP_LIST(DECLARE_CASE) |
| 91 MACHINE_OP_LIST(DECLARE_CASE) | |
| 92 JS_SIMPLE_UNOP_LIST(DECLARE_CASE) | 91 JS_SIMPLE_UNOP_LIST(DECLARE_CASE) |
| 93 JS_OBJECT_OP_LIST(DECLARE_CASE) | 92 JS_OBJECT_OP_LIST(DECLARE_CASE) |
| 94 JS_CONTEXT_OP_LIST(DECLARE_CASE) | 93 JS_CONTEXT_OP_LIST(DECLARE_CASE) |
| 95 JS_OTHER_OP_LIST(DECLARE_CASE) | 94 JS_OTHER_OP_LIST(DECLARE_CASE) |
| 96 #undef DECLARE_CASE | 95 #undef DECLARE_CASE |
| 97 | 96 |
| 98 #define DECLARE_CASE(x) \ | 97 #define DECLARE_CASE(x) \ |
| 99 case IrOpcode::k##x: \ | 98 case IrOpcode::k##x: \ |
| 100 return UpdateType(node, TypeBinaryOp(node, x)); | 99 return UpdateType(node, TypeBinaryOp(node, x)); |
| 101 SIMPLIFIED_NUMBER_BINOP_LIST(DECLARE_CASE) | 100 SIMPLIFIED_NUMBER_BINOP_LIST(DECLARE_CASE) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 124 DECLARE_CASE(Return) | 123 DECLARE_CASE(Return) |
| 125 DECLARE_CASE(TailCall) | 124 DECLARE_CASE(TailCall) |
| 126 DECLARE_CASE(Terminate) | 125 DECLARE_CASE(Terminate) |
| 127 DECLARE_CASE(OsrNormalEntry) | 126 DECLARE_CASE(OsrNormalEntry) |
| 128 DECLARE_CASE(OsrLoopEntry) | 127 DECLARE_CASE(OsrLoopEntry) |
| 129 DECLARE_CASE(Throw) | 128 DECLARE_CASE(Throw) |
| 130 DECLARE_CASE(End) | 129 DECLARE_CASE(End) |
| 131 SIMPLIFIED_CHANGE_OP_LIST(DECLARE_CASE) | 130 SIMPLIFIED_CHANGE_OP_LIST(DECLARE_CASE) |
| 132 SIMPLIFIED_CHECKED_OP_LIST(DECLARE_CASE) | 131 SIMPLIFIED_CHECKED_OP_LIST(DECLARE_CASE) |
| 133 MACHINE_SIMD_OP_LIST(DECLARE_CASE) | 132 MACHINE_SIMD_OP_LIST(DECLARE_CASE) |
| 133 MACHINE_OP_LIST(DECLARE_CASE) |
| 134 #undef DECLARE_CASE | 134 #undef DECLARE_CASE |
| 135 break; | 135 break; |
| 136 } | 136 } |
| 137 return NoChange(); | 137 return NoChange(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 Type* TypeNode(Node* node) { | 140 Type* TypeNode(Node* node) { |
| 141 switch (node->opcode()) { | 141 switch (node->opcode()) { |
| 142 #define DECLARE_CASE(x) \ | 142 #define DECLARE_CASE(x) \ |
| 143 case IrOpcode::k##x: return TypeBinaryOp(node, x##Typer); | 143 case IrOpcode::k##x: return TypeBinaryOp(node, x##Typer); |
| 144 JS_SIMPLE_BINOP_LIST(DECLARE_CASE) | 144 JS_SIMPLE_BINOP_LIST(DECLARE_CASE) |
| 145 #undef DECLARE_CASE | 145 #undef DECLARE_CASE |
| 146 | 146 |
| 147 #define DECLARE_CASE(x) case IrOpcode::k##x: return Type##x(node); | 147 #define DECLARE_CASE(x) case IrOpcode::k##x: return Type##x(node); |
| 148 DECLARE_CASE(Start) | 148 DECLARE_CASE(Start) |
| 149 DECLARE_CASE(IfException) | 149 DECLARE_CASE(IfException) |
| 150 // VALUE_OP_LIST without JS_SIMPLE_BINOP_LIST: | 150 // VALUE_OP_LIST without JS_SIMPLE_BINOP_LIST: |
| 151 COMMON_OP_LIST(DECLARE_CASE) | 151 COMMON_OP_LIST(DECLARE_CASE) |
| 152 SIMPLIFIED_COMPARE_BINOP_LIST(DECLARE_CASE) | 152 SIMPLIFIED_COMPARE_BINOP_LIST(DECLARE_CASE) |
| 153 SIMPLIFIED_OTHER_OP_LIST(DECLARE_CASE) | 153 SIMPLIFIED_OTHER_OP_LIST(DECLARE_CASE) |
| 154 MACHINE_OP_LIST(DECLARE_CASE) | |
| 155 JS_SIMPLE_UNOP_LIST(DECLARE_CASE) | 154 JS_SIMPLE_UNOP_LIST(DECLARE_CASE) |
| 156 JS_OBJECT_OP_LIST(DECLARE_CASE) | 155 JS_OBJECT_OP_LIST(DECLARE_CASE) |
| 157 JS_CONTEXT_OP_LIST(DECLARE_CASE) | 156 JS_CONTEXT_OP_LIST(DECLARE_CASE) |
| 158 JS_OTHER_OP_LIST(DECLARE_CASE) | 157 JS_OTHER_OP_LIST(DECLARE_CASE) |
| 159 #undef DECLARE_CASE | 158 #undef DECLARE_CASE |
| 160 | 159 |
| 161 #define DECLARE_CASE(x) \ | 160 #define DECLARE_CASE(x) \ |
| 162 case IrOpcode::k##x: \ | 161 case IrOpcode::k##x: \ |
| 163 return TypeBinaryOp(node, x); | 162 return TypeBinaryOp(node, x); |
| 164 SIMPLIFIED_NUMBER_BINOP_LIST(DECLARE_CASE) | 163 SIMPLIFIED_NUMBER_BINOP_LIST(DECLARE_CASE) |
| (...skipping 22 matching lines...) Expand all Loading... |
| 187 DECLARE_CASE(Return) | 186 DECLARE_CASE(Return) |
| 188 DECLARE_CASE(TailCall) | 187 DECLARE_CASE(TailCall) |
| 189 DECLARE_CASE(Terminate) | 188 DECLARE_CASE(Terminate) |
| 190 DECLARE_CASE(OsrNormalEntry) | 189 DECLARE_CASE(OsrNormalEntry) |
| 191 DECLARE_CASE(OsrLoopEntry) | 190 DECLARE_CASE(OsrLoopEntry) |
| 192 DECLARE_CASE(Throw) | 191 DECLARE_CASE(Throw) |
| 193 DECLARE_CASE(End) | 192 DECLARE_CASE(End) |
| 194 SIMPLIFIED_CHANGE_OP_LIST(DECLARE_CASE) | 193 SIMPLIFIED_CHANGE_OP_LIST(DECLARE_CASE) |
| 195 SIMPLIFIED_CHECKED_OP_LIST(DECLARE_CASE) | 194 SIMPLIFIED_CHECKED_OP_LIST(DECLARE_CASE) |
| 196 MACHINE_SIMD_OP_LIST(DECLARE_CASE) | 195 MACHINE_SIMD_OP_LIST(DECLARE_CASE) |
| 196 MACHINE_OP_LIST(DECLARE_CASE) |
| 197 #undef DECLARE_CASE | 197 #undef DECLARE_CASE |
| 198 break; | 198 break; |
| 199 } | 199 } |
| 200 UNREACHABLE(); | 200 UNREACHABLE(); |
| 201 return nullptr; | 201 return nullptr; |
| 202 } | 202 } |
| 203 | 203 |
| 204 Type* TypeConstant(Handle<Object> value); | 204 Type* TypeConstant(Handle<Object> value); |
| 205 | 205 |
| 206 private: | 206 private: |
| 207 Typer* typer_; | 207 Typer* typer_; |
| 208 LoopVariableOptimizer* induction_vars_; | 208 LoopVariableOptimizer* induction_vars_; |
| 209 ZoneSet<NodeId> weakened_nodes_; | 209 ZoneSet<NodeId> weakened_nodes_; |
| 210 | 210 |
| 211 #define DECLARE_METHOD(x) inline Type* Type##x(Node* node); | 211 #define DECLARE_METHOD(x) inline Type* Type##x(Node* node); |
| 212 DECLARE_METHOD(Start) | 212 DECLARE_METHOD(Start) |
| 213 DECLARE_METHOD(IfException) | 213 DECLARE_METHOD(IfException) |
| 214 COMMON_OP_LIST(DECLARE_METHOD) | 214 COMMON_OP_LIST(DECLARE_METHOD) |
| 215 SIMPLIFIED_COMPARE_BINOP_LIST(DECLARE_METHOD) | 215 SIMPLIFIED_COMPARE_BINOP_LIST(DECLARE_METHOD) |
| 216 SIMPLIFIED_OTHER_OP_LIST(DECLARE_METHOD) | 216 SIMPLIFIED_OTHER_OP_LIST(DECLARE_METHOD) |
| 217 MACHINE_OP_LIST(DECLARE_METHOD) | |
| 218 JS_OP_LIST(DECLARE_METHOD) | 217 JS_OP_LIST(DECLARE_METHOD) |
| 219 #undef DECLARE_METHOD | 218 #undef DECLARE_METHOD |
| 220 | 219 |
| 221 Type* TypeOrNone(Node* node) { | 220 Type* TypeOrNone(Node* node) { |
| 222 return NodeProperties::IsTyped(node) ? NodeProperties::GetType(node) | 221 return NodeProperties::IsTyped(node) ? NodeProperties::GetType(node) |
| 223 : Type::None(); | 222 : Type::None(); |
| 224 } | 223 } |
| 225 | 224 |
| 226 Type* Operand(Node* node, int i) { | 225 Type* Operand(Node* node, int i) { |
| 227 Node* operand_node = NodeProperties::GetValueInput(node, i); | 226 Node* operand_node = NodeProperties::GetValueInput(node, i); |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 Type* Typer::Visitor::TypeIfException(Node* node) { | 545 Type* Typer::Visitor::TypeIfException(Node* node) { |
| 547 return Type::NonInternal(); | 546 return Type::NonInternal(); |
| 548 } | 547 } |
| 549 | 548 |
| 550 // Common operators. | 549 // Common operators. |
| 551 | 550 |
| 552 Type* Typer::Visitor::TypeParameter(Node* node) { return Type::Any(); } | 551 Type* Typer::Visitor::TypeParameter(Node* node) { return Type::Any(); } |
| 553 | 552 |
| 554 Type* Typer::Visitor::TypeOsrValue(Node* node) { return Type::Any(); } | 553 Type* Typer::Visitor::TypeOsrValue(Node* node) { return Type::Any(); } |
| 555 | 554 |
| 555 Type* Typer::Visitor::TypeRetain(Node* node) { |
| 556 UNREACHABLE(); |
| 557 return nullptr; |
| 558 } |
| 556 | 559 |
| 557 Type* Typer::Visitor::TypeInt32Constant(Node* node) { | 560 Type* Typer::Visitor::TypeInt32Constant(Node* node) { |
| 558 double number = OpParameter<int32_t>(node); | 561 double number = OpParameter<int32_t>(node); |
| 559 return Type::Intersect(Type::Range(number, number, zone()), | 562 return Type::Intersect(Type::Range(number, number, zone()), |
| 560 Type::UntaggedIntegral32(), zone()); | 563 Type::UntaggedIntegral32(), zone()); |
| 561 } | 564 } |
| 562 | 565 |
| 563 | 566 |
| 564 Type* Typer::Visitor::TypeInt64Constant(Node* node) { | 567 Type* Typer::Visitor::TypeInt64Constant(Node* node) { |
| 565 // TODO(rossberg): This actually seems to be a PointerConstant so far... | 568 // TODO(rossberg): This actually seems to be a PointerConstant so far... |
| 566 return Type::Internal(); // TODO(rossberg): Add int64 bitset type? | 569 return Type::Internal(); // TODO(rossberg): Add int64 bitset type? |
| 567 } | 570 } |
| 568 | 571 |
| 569 // TODO(gdeepti) : Fix this to do something meaningful. | |
| 570 Type* Typer::Visitor::TypeRelocatableInt32Constant(Node* node) { | 572 Type* Typer::Visitor::TypeRelocatableInt32Constant(Node* node) { |
| 571 return Type::Internal(); | 573 UNREACHABLE(); |
| 574 return nullptr; |
| 572 } | 575 } |
| 573 | 576 |
| 574 Type* Typer::Visitor::TypeRelocatableInt64Constant(Node* node) { | 577 Type* Typer::Visitor::TypeRelocatableInt64Constant(Node* node) { |
| 575 return Type::Internal(); | 578 UNREACHABLE(); |
| 579 return nullptr; |
| 576 } | 580 } |
| 577 | 581 |
| 578 Type* Typer::Visitor::TypeFloat32Constant(Node* node) { | 582 Type* Typer::Visitor::TypeFloat32Constant(Node* node) { |
| 579 return Type::Intersect(Type::Of(OpParameter<float>(node), zone()), | 583 return Type::Intersect(Type::Of(OpParameter<float>(node), zone()), |
| 580 Type::UntaggedFloat32(), zone()); | 584 Type::UntaggedFloat32(), zone()); |
| 581 } | 585 } |
| 582 | 586 |
| 583 | 587 |
| 584 Type* Typer::Visitor::TypeFloat64Constant(Node* node) { | 588 Type* Typer::Visitor::TypeFloat64Constant(Node* node) { |
| 585 return Type::Intersect(Type::Of(OpParameter<double>(node), zone()), | 589 return Type::Intersect(Type::Of(OpParameter<double>(node), zone()), |
| (...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 } | 1688 } |
| 1685 | 1689 |
| 1686 Type* Typer::Visitor::TypeObjectIsUndetectable(Node* node) { | 1690 Type* Typer::Visitor::TypeObjectIsUndetectable(Node* node) { |
| 1687 return TypeUnaryOp(node, ObjectIsUndetectable); | 1691 return TypeUnaryOp(node, ObjectIsUndetectable); |
| 1688 } | 1692 } |
| 1689 | 1693 |
| 1690 Type* Typer::Visitor::TypeArrayBufferWasNeutered(Node* node) { | 1694 Type* Typer::Visitor::TypeArrayBufferWasNeutered(Node* node) { |
| 1691 return Type::Boolean(); | 1695 return Type::Boolean(); |
| 1692 } | 1696 } |
| 1693 | 1697 |
| 1694 // Machine operators. | |
| 1695 | |
| 1696 Type* Typer::Visitor::TypeDebugBreak(Node* node) { return Type::None(); } | |
| 1697 | |
| 1698 Type* Typer::Visitor::TypeComment(Node* node) { return Type::None(); } | |
| 1699 | |
| 1700 Type* Typer::Visitor::TypeRetain(Node* node) { | |
| 1701 UNREACHABLE(); | |
| 1702 return nullptr; | |
| 1703 } | |
| 1704 | |
| 1705 Type* Typer::Visitor::TypeUnsafePointerAdd(Node* node) { return Type::None(); } | |
| 1706 | |
| 1707 Type* Typer::Visitor::TypeLoad(Node* node) { return Type::Any(); } | |
| 1708 | |
| 1709 Type* Typer::Visitor::TypeStackSlot(Node* node) { return Type::Any(); } | |
| 1710 | |
| 1711 Type* Typer::Visitor::TypeStore(Node* node) { | |
| 1712 UNREACHABLE(); | |
| 1713 return nullptr; | |
| 1714 } | |
| 1715 | |
| 1716 | |
| 1717 Type* Typer::Visitor::TypeWord32And(Node* node) { return Type::Integral32(); } | |
| 1718 | |
| 1719 | |
| 1720 Type* Typer::Visitor::TypeWord32Or(Node* node) { return Type::Integral32(); } | |
| 1721 | |
| 1722 | |
| 1723 Type* Typer::Visitor::TypeWord32Xor(Node* node) { return Type::Integral32(); } | |
| 1724 | |
| 1725 | |
| 1726 Type* Typer::Visitor::TypeWord32Shl(Node* node) { return Type::Integral32(); } | |
| 1727 | |
| 1728 | |
| 1729 Type* Typer::Visitor::TypeWord32Shr(Node* node) { return Type::Integral32(); } | |
| 1730 | |
| 1731 | |
| 1732 Type* Typer::Visitor::TypeWord32Sar(Node* node) { return Type::Integral32(); } | |
| 1733 | |
| 1734 | |
| 1735 Type* Typer::Visitor::TypeWord32Ror(Node* node) { return Type::Integral32(); } | |
| 1736 | |
| 1737 | |
| 1738 Type* Typer::Visitor::TypeWord32Equal(Node* node) { return Type::Boolean(); } | |
| 1739 | |
| 1740 | |
| 1741 Type* Typer::Visitor::TypeWord32Clz(Node* node) { return Type::Integral32(); } | |
| 1742 | |
| 1743 | |
| 1744 Type* Typer::Visitor::TypeWord32Ctz(Node* node) { return Type::Integral32(); } | |
| 1745 | |
| 1746 | |
| 1747 Type* Typer::Visitor::TypeWord32ReverseBits(Node* node) { | |
| 1748 return Type::Integral32(); | |
| 1749 } | |
| 1750 | |
| 1751 Type* Typer::Visitor::TypeWord32ReverseBytes(Node* node) { | |
| 1752 return Type::Integral32(); | |
| 1753 } | |
| 1754 | |
| 1755 Type* Typer::Visitor::TypeWord32Popcnt(Node* node) { | |
| 1756 return Type::Integral32(); | |
| 1757 } | |
| 1758 | |
| 1759 | |
| 1760 Type* Typer::Visitor::TypeWord64And(Node* node) { return Type::Internal(); } | |
| 1761 | |
| 1762 | |
| 1763 Type* Typer::Visitor::TypeWord64Or(Node* node) { return Type::Internal(); } | |
| 1764 | |
| 1765 | |
| 1766 Type* Typer::Visitor::TypeWord64Xor(Node* node) { return Type::Internal(); } | |
| 1767 | |
| 1768 | |
| 1769 Type* Typer::Visitor::TypeWord64Shl(Node* node) { return Type::Internal(); } | |
| 1770 | |
| 1771 | |
| 1772 Type* Typer::Visitor::TypeWord64Shr(Node* node) { return Type::Internal(); } | |
| 1773 | |
| 1774 | |
| 1775 Type* Typer::Visitor::TypeWord64Sar(Node* node) { return Type::Internal(); } | |
| 1776 | |
| 1777 | |
| 1778 Type* Typer::Visitor::TypeWord64Ror(Node* node) { return Type::Internal(); } | |
| 1779 | |
| 1780 | |
| 1781 Type* Typer::Visitor::TypeWord64Clz(Node* node) { return Type::Internal(); } | |
| 1782 | |
| 1783 | |
| 1784 Type* Typer::Visitor::TypeWord64Ctz(Node* node) { return Type::Internal(); } | |
| 1785 | |
| 1786 | |
| 1787 Type* Typer::Visitor::TypeWord64ReverseBits(Node* node) { | |
| 1788 return Type::Internal(); | |
| 1789 } | |
| 1790 | |
| 1791 Type* Typer::Visitor::TypeWord64ReverseBytes(Node* node) { | |
| 1792 return Type::Internal(); | |
| 1793 } | |
| 1794 | |
| 1795 Type* Typer::Visitor::TypeWord64Popcnt(Node* node) { return Type::Internal(); } | |
| 1796 | |
| 1797 | |
| 1798 Type* Typer::Visitor::TypeWord64Equal(Node* node) { return Type::Boolean(); } | |
| 1799 | |
| 1800 | |
| 1801 Type* Typer::Visitor::TypeInt32Add(Node* node) { return Type::Integral32(); } | |
| 1802 | |
| 1803 | |
| 1804 Type* Typer::Visitor::TypeInt32AddWithOverflow(Node* node) { | |
| 1805 return Type::Internal(); | |
| 1806 } | |
| 1807 | |
| 1808 | |
| 1809 Type* Typer::Visitor::TypeInt32Sub(Node* node) { return Type::Integral32(); } | |
| 1810 | |
| 1811 | |
| 1812 Type* Typer::Visitor::TypeInt32SubWithOverflow(Node* node) { | |
| 1813 return Type::Internal(); | |
| 1814 } | |
| 1815 | |
| 1816 | |
| 1817 Type* Typer::Visitor::TypeInt32Mul(Node* node) { return Type::Integral32(); } | |
| 1818 | |
| 1819 Type* Typer::Visitor::TypeInt32MulWithOverflow(Node* node) { | |
| 1820 return Type::Internal(); | |
| 1821 } | |
| 1822 | |
| 1823 Type* Typer::Visitor::TypeInt32MulHigh(Node* node) { return Type::Signed32(); } | |
| 1824 | |
| 1825 | |
| 1826 Type* Typer::Visitor::TypeInt32Div(Node* node) { return Type::Integral32(); } | |
| 1827 | |
| 1828 | |
| 1829 Type* Typer::Visitor::TypeInt32Mod(Node* node) { return Type::Integral32(); } | |
| 1830 | |
| 1831 | |
| 1832 Type* Typer::Visitor::TypeInt32LessThan(Node* node) { return Type::Boolean(); } | |
| 1833 | |
| 1834 | |
| 1835 Type* Typer::Visitor::TypeInt32LessThanOrEqual(Node* node) { | |
| 1836 return Type::Boolean(); | |
| 1837 } | |
| 1838 | |
| 1839 | |
| 1840 Type* Typer::Visitor::TypeUint32Div(Node* node) { return Type::Unsigned32(); } | |
| 1841 | |
| 1842 | |
| 1843 Type* Typer::Visitor::TypeUint32LessThan(Node* node) { return Type::Boolean(); } | |
| 1844 | |
| 1845 | |
| 1846 Type* Typer::Visitor::TypeUint32LessThanOrEqual(Node* node) { | |
| 1847 return Type::Boolean(); | |
| 1848 } | |
| 1849 | |
| 1850 | |
| 1851 Type* Typer::Visitor::TypeUint32Mod(Node* node) { return Type::Unsigned32(); } | |
| 1852 | |
| 1853 | |
| 1854 Type* Typer::Visitor::TypeUint32MulHigh(Node* node) { | |
| 1855 return Type::Unsigned32(); | |
| 1856 } | |
| 1857 | |
| 1858 | |
| 1859 Type* Typer::Visitor::TypeInt64Add(Node* node) { return Type::Internal(); } | |
| 1860 | |
| 1861 | |
| 1862 Type* Typer::Visitor::TypeInt64AddWithOverflow(Node* node) { | |
| 1863 return Type::Internal(); | |
| 1864 } | |
| 1865 | |
| 1866 | |
| 1867 Type* Typer::Visitor::TypeInt64Sub(Node* node) { return Type::Internal(); } | |
| 1868 | |
| 1869 | |
| 1870 Type* Typer::Visitor::TypeInt64SubWithOverflow(Node* node) { | |
| 1871 return Type::Internal(); | |
| 1872 } | |
| 1873 | |
| 1874 | |
| 1875 Type* Typer::Visitor::TypeInt64Mul(Node* node) { return Type::Internal(); } | |
| 1876 | |
| 1877 Type* Typer::Visitor::TypeInt64Div(Node* node) { return Type::Internal(); } | |
| 1878 | |
| 1879 | |
| 1880 Type* Typer::Visitor::TypeInt64Mod(Node* node) { return Type::Internal(); } | |
| 1881 | |
| 1882 | |
| 1883 Type* Typer::Visitor::TypeInt64LessThan(Node* node) { return Type::Boolean(); } | |
| 1884 | |
| 1885 | |
| 1886 Type* Typer::Visitor::TypeInt64LessThanOrEqual(Node* node) { | |
| 1887 return Type::Boolean(); | |
| 1888 } | |
| 1889 | |
| 1890 | |
| 1891 Type* Typer::Visitor::TypeUint64Div(Node* node) { return Type::Internal(); } | |
| 1892 | |
| 1893 | |
| 1894 Type* Typer::Visitor::TypeUint64LessThan(Node* node) { return Type::Boolean(); } | |
| 1895 | |
| 1896 | |
| 1897 Type* Typer::Visitor::TypeUint64LessThanOrEqual(Node* node) { | |
| 1898 return Type::Boolean(); | |
| 1899 } | |
| 1900 | |
| 1901 | |
| 1902 Type* Typer::Visitor::TypeUint64Mod(Node* node) { return Type::Internal(); } | |
| 1903 | |
| 1904 Type* Typer::Visitor::TypeBitcastWordToTagged(Node* node) { | |
| 1905 return Type::TaggedPointer(); | |
| 1906 } | |
| 1907 | |
| 1908 Type* Typer::Visitor::TypeChangeFloat32ToFloat64(Node* node) { | |
| 1909 return Type::Intersect(Type::Number(), Type::UntaggedFloat64(), zone()); | |
| 1910 } | |
| 1911 | |
| 1912 | |
| 1913 Type* Typer::Visitor::TypeChangeFloat64ToInt32(Node* node) { | |
| 1914 return Type::Intersect(Type::Signed32(), Type::UntaggedIntegral32(), zone()); | |
| 1915 } | |
| 1916 | |
| 1917 Type* Typer::Visitor::TypeChangeFloat64ToUint32(Node* node) { | |
| 1918 return Type::Intersect(Type::Unsigned32(), Type::UntaggedIntegral32(), | |
| 1919 zone()); | |
| 1920 } | |
| 1921 | |
| 1922 Type* Typer::Visitor::TypeTruncateFloat64ToUint32(Node* node) { | |
| 1923 return Type::Intersect(Type::Unsigned32(), Type::UntaggedIntegral32(), | |
| 1924 zone()); | |
| 1925 } | |
| 1926 | |
| 1927 Type* Typer::Visitor::TypeTruncateFloat32ToInt32(Node* node) { | |
| 1928 return Type::Intersect(Type::Signed32(), Type::UntaggedIntegral32(), zone()); | |
| 1929 } | |
| 1930 | |
| 1931 | |
| 1932 Type* Typer::Visitor::TypeTruncateFloat32ToUint32(Node* node) { | |
| 1933 return Type::Intersect(Type::Unsigned32(), Type::UntaggedIntegral32(), | |
| 1934 zone()); | |
| 1935 } | |
| 1936 | |
| 1937 | |
| 1938 Type* Typer::Visitor::TypeTryTruncateFloat32ToInt64(Node* node) { | |
| 1939 return Type::Internal(); | |
| 1940 } | |
| 1941 | |
| 1942 | |
| 1943 Type* Typer::Visitor::TypeTryTruncateFloat64ToInt64(Node* node) { | |
| 1944 return Type::Internal(); | |
| 1945 } | |
| 1946 | |
| 1947 | |
| 1948 Type* Typer::Visitor::TypeTryTruncateFloat32ToUint64(Node* node) { | |
| 1949 return Type::Internal(); | |
| 1950 } | |
| 1951 | |
| 1952 | |
| 1953 Type* Typer::Visitor::TypeTryTruncateFloat64ToUint64(Node* node) { | |
| 1954 return Type::Internal(); | |
| 1955 } | |
| 1956 | |
| 1957 | |
| 1958 Type* Typer::Visitor::TypeChangeInt32ToFloat64(Node* node) { | |
| 1959 return Type::Intersect(Type::Signed32(), Type::UntaggedFloat64(), zone()); | |
| 1960 } | |
| 1961 | |
| 1962 Type* Typer::Visitor::TypeFloat64SilenceNaN(Node* node) { | |
| 1963 return Type::UntaggedFloat64(); | |
| 1964 } | |
| 1965 | |
| 1966 Type* Typer::Visitor::TypeChangeInt32ToInt64(Node* node) { | |
| 1967 return Type::Internal(); | |
| 1968 } | |
| 1969 | |
| 1970 Type* Typer::Visitor::TypeChangeUint32ToFloat64(Node* node) { | |
| 1971 return Type::Intersect(Type::Unsigned32(), Type::UntaggedFloat64(), zone()); | |
| 1972 } | |
| 1973 | |
| 1974 Type* Typer::Visitor::TypeChangeUint32ToUint64(Node* node) { | |
| 1975 return Type::Internal(); | |
| 1976 } | |
| 1977 | |
| 1978 Type* Typer::Visitor::TypeTruncateFloat64ToFloat32(Node* node) { | |
| 1979 return Type::Intersect(Type::Number(), Type::UntaggedFloat32(), zone()); | |
| 1980 } | |
| 1981 | |
| 1982 Type* Typer::Visitor::TypeTruncateFloat64ToWord32(Node* node) { | |
| 1983 return Type::Intersect(Type::Integral32(), Type::UntaggedIntegral32(), | |
| 1984 zone()); | |
| 1985 } | |
| 1986 | |
| 1987 Type* Typer::Visitor::TypeTruncateInt64ToInt32(Node* node) { | |
| 1988 return Type::Intersect(Type::Signed32(), Type::UntaggedIntegral32(), zone()); | |
| 1989 } | |
| 1990 | |
| 1991 Type* Typer::Visitor::TypeRoundFloat64ToInt32(Node* node) { | |
| 1992 return Type::Intersect(Type::Signed32(), Type::UntaggedIntegral32(), zone()); | |
| 1993 } | |
| 1994 | |
| 1995 Type* Typer::Visitor::TypeRoundInt32ToFloat32(Node* node) { | |
| 1996 return Type::Intersect(Type::PlainNumber(), Type::UntaggedFloat32(), zone()); | |
| 1997 } | |
| 1998 | |
| 1999 | |
| 2000 Type* Typer::Visitor::TypeRoundInt64ToFloat32(Node* node) { | |
| 2001 return Type::Intersect(Type::PlainNumber(), Type::UntaggedFloat32(), zone()); | |
| 2002 } | |
| 2003 | |
| 2004 | |
| 2005 Type* Typer::Visitor::TypeRoundInt64ToFloat64(Node* node) { | |
| 2006 return Type::Intersect(Type::PlainNumber(), Type::UntaggedFloat64(), zone()); | |
| 2007 } | |
| 2008 | |
| 2009 | |
| 2010 Type* Typer::Visitor::TypeRoundUint32ToFloat32(Node* node) { | |
| 2011 return Type::Intersect(Type::PlainNumber(), Type::UntaggedFloat32(), zone()); | |
| 2012 } | |
| 2013 | |
| 2014 | |
| 2015 Type* Typer::Visitor::TypeRoundUint64ToFloat32(Node* node) { | |
| 2016 return Type::Intersect(Type::PlainNumber(), Type::UntaggedFloat32(), zone()); | |
| 2017 } | |
| 2018 | |
| 2019 | |
| 2020 Type* Typer::Visitor::TypeRoundUint64ToFloat64(Node* node) { | |
| 2021 return Type::Intersect(Type::PlainNumber(), Type::UntaggedFloat64(), zone()); | |
| 2022 } | |
| 2023 | |
| 2024 | |
| 2025 Type* Typer::Visitor::TypeBitcastFloat32ToInt32(Node* node) { | |
| 2026 return Type::Number(); | |
| 2027 } | |
| 2028 | |
| 2029 | |
| 2030 Type* Typer::Visitor::TypeBitcastFloat64ToInt64(Node* node) { | |
| 2031 return Type::Number(); | |
| 2032 } | |
| 2033 | |
| 2034 | |
| 2035 Type* Typer::Visitor::TypeBitcastInt32ToFloat32(Node* node) { | |
| 2036 return Type::Number(); | |
| 2037 } | |
| 2038 | |
| 2039 | |
| 2040 Type* Typer::Visitor::TypeBitcastInt64ToFloat64(Node* node) { | |
| 2041 return Type::Number(); | |
| 2042 } | |
| 2043 | |
| 2044 | |
| 2045 Type* Typer::Visitor::TypeFloat32Add(Node* node) { return Type::Number(); } | |
| 2046 | |
| 2047 | |
| 2048 Type* Typer::Visitor::TypeFloat32Sub(Node* node) { return Type::Number(); } | |
| 2049 | |
| 2050 Type* Typer::Visitor::TypeFloat32Neg(Node* node) { return Type::Number(); } | |
| 2051 | |
| 2052 Type* Typer::Visitor::TypeFloat32Mul(Node* node) { return Type::Number(); } | |
| 2053 | |
| 2054 | |
| 2055 Type* Typer::Visitor::TypeFloat32Div(Node* node) { return Type::Number(); } | |
| 2056 | |
| 2057 | |
| 2058 Type* Typer::Visitor::TypeFloat32Abs(Node* node) { | |
| 2059 // TODO(turbofan): We should be able to infer a better type here. | |
| 2060 return Type::Number(); | |
| 2061 } | |
| 2062 | |
| 2063 | |
| 2064 Type* Typer::Visitor::TypeFloat32Sqrt(Node* node) { return Type::Number(); } | |
| 2065 | |
| 2066 | |
| 2067 Type* Typer::Visitor::TypeFloat32Equal(Node* node) { return Type::Boolean(); } | |
| 2068 | |
| 2069 | |
| 2070 Type* Typer::Visitor::TypeFloat32LessThan(Node* node) { | |
| 2071 return Type::Boolean(); | |
| 2072 } | |
| 2073 | |
| 2074 | |
| 2075 Type* Typer::Visitor::TypeFloat32LessThanOrEqual(Node* node) { | |
| 2076 return Type::Boolean(); | |
| 2077 } | |
| 2078 | |
| 2079 Type* Typer::Visitor::TypeFloat32Max(Node* node) { return Type::Number(); } | |
| 2080 | |
| 2081 Type* Typer::Visitor::TypeFloat32Min(Node* node) { return Type::Number(); } | |
| 2082 | |
| 2083 Type* Typer::Visitor::TypeFloat64Add(Node* node) { return Type::Number(); } | |
| 2084 | |
| 2085 | |
| 2086 Type* Typer::Visitor::TypeFloat64Sub(Node* node) { return Type::Number(); } | |
| 2087 | |
| 2088 Type* Typer::Visitor::TypeFloat64Neg(Node* node) { return Type::Number(); } | |
| 2089 | |
| 2090 Type* Typer::Visitor::TypeFloat64Mul(Node* node) { return Type::Number(); } | |
| 2091 | |
| 2092 | |
| 2093 Type* Typer::Visitor::TypeFloat64Div(Node* node) { return Type::Number(); } | |
| 2094 | |
| 2095 | |
| 2096 Type* Typer::Visitor::TypeFloat64Mod(Node* node) { return Type::Number(); } | |
| 2097 | |
| 2098 | |
| 2099 Type* Typer::Visitor::TypeFloat64Max(Node* node) { return Type::Number(); } | |
| 2100 | |
| 2101 | |
| 2102 Type* Typer::Visitor::TypeFloat64Min(Node* node) { return Type::Number(); } | |
| 2103 | |
| 2104 | |
| 2105 Type* Typer::Visitor::TypeFloat64Abs(Node* node) { | |
| 2106 // TODO(turbofan): We should be able to infer a better type here. | |
| 2107 return Type::Number(); | |
| 2108 } | |
| 2109 | |
| 2110 Type* Typer::Visitor::TypeFloat64Acos(Node* node) { return Type::Number(); } | |
| 2111 | |
| 2112 Type* Typer::Visitor::TypeFloat64Acosh(Node* node) { return Type::Number(); } | |
| 2113 | |
| 2114 Type* Typer::Visitor::TypeFloat64Asin(Node* node) { return Type::Number(); } | |
| 2115 | |
| 2116 Type* Typer::Visitor::TypeFloat64Asinh(Node* node) { return Type::Number(); } | |
| 2117 | |
| 2118 Type* Typer::Visitor::TypeFloat64Atan(Node* node) { return Type::Number(); } | |
| 2119 | |
| 2120 Type* Typer::Visitor::TypeFloat64Atanh(Node* node) { return Type::Number(); } | |
| 2121 | |
| 2122 Type* Typer::Visitor::TypeFloat64Atan2(Node* node) { return Type::Number(); } | |
| 2123 | |
| 2124 Type* Typer::Visitor::TypeFloat64Cbrt(Node* node) { return Type::Number(); } | |
| 2125 | |
| 2126 Type* Typer::Visitor::TypeFloat64Cos(Node* node) { return Type::Number(); } | |
| 2127 | |
| 2128 Type* Typer::Visitor::TypeFloat64Cosh(Node* node) { return Type::Number(); } | |
| 2129 | |
| 2130 Type* Typer::Visitor::TypeFloat64Exp(Node* node) { return Type::Number(); } | |
| 2131 | |
| 2132 Type* Typer::Visitor::TypeFloat64Expm1(Node* node) { return Type::Number(); } | |
| 2133 | |
| 2134 Type* Typer::Visitor::TypeFloat64Log(Node* node) { return Type::Number(); } | |
| 2135 | |
| 2136 Type* Typer::Visitor::TypeFloat64Log1p(Node* node) { return Type::Number(); } | |
| 2137 | |
| 2138 Type* Typer::Visitor::TypeFloat64Log10(Node* node) { return Type::Number(); } | |
| 2139 | |
| 2140 Type* Typer::Visitor::TypeFloat64Log2(Node* node) { return Type::Number(); } | |
| 2141 | |
| 2142 Type* Typer::Visitor::TypeFloat64Pow(Node* node) { return Type::Number(); } | |
| 2143 | |
| 2144 Type* Typer::Visitor::TypeFloat64Sin(Node* node) { return Type::Number(); } | |
| 2145 | |
| 2146 Type* Typer::Visitor::TypeFloat64Sinh(Node* node) { return Type::Number(); } | |
| 2147 | |
| 2148 Type* Typer::Visitor::TypeFloat64Sqrt(Node* node) { return Type::Number(); } | |
| 2149 | |
| 2150 Type* Typer::Visitor::TypeFloat64Tan(Node* node) { return Type::Number(); } | |
| 2151 | |
| 2152 Type* Typer::Visitor::TypeFloat64Tanh(Node* node) { return Type::Number(); } | |
| 2153 | |
| 2154 Type* Typer::Visitor::TypeFloat64Equal(Node* node) { return Type::Boolean(); } | |
| 2155 | |
| 2156 | |
| 2157 Type* Typer::Visitor::TypeFloat64LessThan(Node* node) { | |
| 2158 return Type::Boolean(); | |
| 2159 } | |
| 2160 | |
| 2161 | |
| 2162 Type* Typer::Visitor::TypeFloat64LessThanOrEqual(Node* node) { | |
| 2163 return Type::Boolean(); | |
| 2164 } | |
| 2165 | |
| 2166 | |
| 2167 Type* Typer::Visitor::TypeFloat32RoundDown(Node* node) { | |
| 2168 // TODO(sigurds): We could have a tighter bound here. | |
| 2169 return Type::Number(); | |
| 2170 } | |
| 2171 | |
| 2172 | |
| 2173 Type* Typer::Visitor::TypeFloat64RoundDown(Node* node) { | |
| 2174 // TODO(sigurds): We could have a tighter bound here. | |
| 2175 return Type::Number(); | |
| 2176 } | |
| 2177 | |
| 2178 | |
| 2179 Type* Typer::Visitor::TypeFloat32RoundUp(Node* node) { | |
| 2180 // TODO(sigurds): We could have a tighter bound here. | |
| 2181 return Type::Number(); | |
| 2182 } | |
| 2183 | |
| 2184 | |
| 2185 Type* Typer::Visitor::TypeFloat64RoundUp(Node* node) { | |
| 2186 // TODO(sigurds): We could have a tighter bound here. | |
| 2187 return Type::Number(); | |
| 2188 } | |
| 2189 | |
| 2190 | |
| 2191 Type* Typer::Visitor::TypeFloat32RoundTruncate(Node* node) { | |
| 2192 // TODO(sigurds): We could have a tighter bound here. | |
| 2193 return Type::Number(); | |
| 2194 } | |
| 2195 | |
| 2196 | |
| 2197 Type* Typer::Visitor::TypeFloat64RoundTruncate(Node* node) { | |
| 2198 // TODO(sigurds): We could have a tighter bound here. | |
| 2199 return Type::Number(); | |
| 2200 } | |
| 2201 | |
| 2202 | |
| 2203 Type* Typer::Visitor::TypeFloat64RoundTiesAway(Node* node) { | |
| 2204 // TODO(sigurds): We could have a tighter bound here. | |
| 2205 return Type::Number(); | |
| 2206 } | |
| 2207 | |
| 2208 | |
| 2209 Type* Typer::Visitor::TypeFloat32RoundTiesEven(Node* node) { | |
| 2210 // TODO(sigurds): We could have a tighter bound here. | |
| 2211 return Type::Number(); | |
| 2212 } | |
| 2213 | |
| 2214 | |
| 2215 Type* Typer::Visitor::TypeFloat64RoundTiesEven(Node* node) { | |
| 2216 // TODO(sigurds): We could have a tighter bound here. | |
| 2217 return Type::Number(); | |
| 2218 } | |
| 2219 | |
| 2220 | |
| 2221 Type* Typer::Visitor::TypeFloat64ExtractLowWord32(Node* node) { | |
| 2222 return Type::Signed32(); | |
| 2223 } | |
| 2224 | |
| 2225 | |
| 2226 Type* Typer::Visitor::TypeFloat64ExtractHighWord32(Node* node) { | |
| 2227 return Type::Signed32(); | |
| 2228 } | |
| 2229 | |
| 2230 | |
| 2231 Type* Typer::Visitor::TypeFloat64InsertLowWord32(Node* node) { | |
| 2232 return Type::Number(); | |
| 2233 } | |
| 2234 | |
| 2235 | |
| 2236 Type* Typer::Visitor::TypeFloat64InsertHighWord32(Node* node) { | |
| 2237 return Type::Number(); | |
| 2238 } | |
| 2239 | |
| 2240 | |
| 2241 Type* Typer::Visitor::TypeLoadStackPointer(Node* node) { | |
| 2242 return Type::Internal(); | |
| 2243 } | |
| 2244 | |
| 2245 | |
| 2246 Type* Typer::Visitor::TypeLoadFramePointer(Node* node) { | |
| 2247 return Type::Internal(); | |
| 2248 } | |
| 2249 | |
| 2250 Type* Typer::Visitor::TypeLoadParentFramePointer(Node* node) { | |
| 2251 return Type::Internal(); | |
| 2252 } | |
| 2253 | |
| 2254 Type* Typer::Visitor::TypeUnalignedLoad(Node* node) { return Type::Any(); } | |
| 2255 | |
| 2256 Type* Typer::Visitor::TypeUnalignedStore(Node* node) { | |
| 2257 UNREACHABLE(); | |
| 2258 return nullptr; | |
| 2259 } | |
| 2260 | |
| 2261 Type* Typer::Visitor::TypeCheckedLoad(Node* node) { return Type::Any(); } | |
| 2262 | |
| 2263 Type* Typer::Visitor::TypeCheckedStore(Node* node) { | |
| 2264 UNREACHABLE(); | |
| 2265 return nullptr; | |
| 2266 } | |
| 2267 | |
| 2268 Type* Typer::Visitor::TypeAtomicLoad(Node* node) { return Type::Any(); } | |
| 2269 | |
| 2270 Type* Typer::Visitor::TypeAtomicStore(Node* node) { | |
| 2271 UNREACHABLE(); | |
| 2272 return nullptr; | |
| 2273 } | |
| 2274 | |
| 2275 Type* Typer::Visitor::TypeInt32PairAdd(Node* node) { return Type::Internal(); } | |
| 2276 | |
| 2277 Type* Typer::Visitor::TypeInt32PairSub(Node* node) { return Type::Internal(); } | |
| 2278 | |
| 2279 Type* Typer::Visitor::TypeInt32PairMul(Node* node) { return Type::Internal(); } | |
| 2280 | |
| 2281 Type* Typer::Visitor::TypeWord32PairShl(Node* node) { return Type::Internal(); } | |
| 2282 | |
| 2283 Type* Typer::Visitor::TypeWord32PairShr(Node* node) { return Type::Internal(); } | |
| 2284 | |
| 2285 Type* Typer::Visitor::TypeWord32PairSar(Node* node) { return Type::Internal(); } | |
| 2286 | |
| 2287 // Heap constants. | 1698 // Heap constants. |
| 2288 | 1699 |
| 2289 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { | 1700 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { |
| 2290 if (Type::IsInteger(*value)) { | 1701 if (Type::IsInteger(*value)) { |
| 2291 return Type::Range(value->Number(), value->Number(), zone()); | 1702 return Type::Range(value->Number(), value->Number(), zone()); |
| 2292 } | 1703 } |
| 2293 return Type::Constant(value, zone()); | 1704 return Type::Constant(value, zone()); |
| 2294 } | 1705 } |
| 2295 | 1706 |
| 2296 } // namespace compiler | 1707 } // namespace compiler |
| 2297 } // namespace internal | 1708 } // namespace internal |
| 2298 } // namespace v8 | 1709 } // namespace v8 |
| OLD | NEW |