| 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 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1781 } | 1781 } |
| 1782 | 1782 |
| 1783 Type* Typer::Visitor::TypeNumberCeil(Node* node) { | 1783 Type* Typer::Visitor::TypeNumberCeil(Node* node) { |
| 1784 return TypeUnaryOp(node, NumberCeil); | 1784 return TypeUnaryOp(node, NumberCeil); |
| 1785 } | 1785 } |
| 1786 | 1786 |
| 1787 Type* Typer::Visitor::TypeNumberFloor(Node* node) { | 1787 Type* Typer::Visitor::TypeNumberFloor(Node* node) { |
| 1788 return TypeUnaryOp(node, NumberFloor); | 1788 return TypeUnaryOp(node, NumberFloor); |
| 1789 } | 1789 } |
| 1790 | 1790 |
| 1791 Type* Typer::Visitor::TypeNumberFround(Node* node) { return Type::Number(); } |
| 1792 |
| 1791 Type* Typer::Visitor::TypeNumberAtan(Node* node) { return Type::Number(); } | 1793 Type* Typer::Visitor::TypeNumberAtan(Node* node) { return Type::Number(); } |
| 1792 | 1794 |
| 1793 Type* Typer::Visitor::TypeNumberAtan2(Node* node) { return Type::Number(); } | 1795 Type* Typer::Visitor::TypeNumberAtan2(Node* node) { return Type::Number(); } |
| 1794 | 1796 |
| 1795 Type* Typer::Visitor::TypeNumberLog(Node* node) { return Type::Number(); } | 1797 Type* Typer::Visitor::TypeNumberLog(Node* node) { return Type::Number(); } |
| 1796 | 1798 |
| 1797 Type* Typer::Visitor::TypeNumberLog1p(Node* node) { return Type::Number(); } | 1799 Type* Typer::Visitor::TypeNumberLog1p(Node* node) { return Type::Number(); } |
| 1798 | 1800 |
| 1799 Type* Typer::Visitor::TypeNumberRound(Node* node) { | 1801 Type* Typer::Visitor::TypeNumberRound(Node* node) { |
| 1800 return TypeUnaryOp(node, NumberRound); | 1802 return TypeUnaryOp(node, NumberRound); |
| 1801 } | 1803 } |
| 1802 | 1804 |
| 1805 Type* Typer::Visitor::TypeNumberSqrt(Node* node) { return Type::Number(); } |
| 1806 |
| 1803 Type* Typer::Visitor::TypeNumberTrunc(Node* node) { | 1807 Type* Typer::Visitor::TypeNumberTrunc(Node* node) { |
| 1804 return TypeUnaryOp(node, NumberTrunc); | 1808 return TypeUnaryOp(node, NumberTrunc); |
| 1805 } | 1809 } |
| 1806 | 1810 |
| 1807 Type* Typer::Visitor::TypeNumberToInt32(Node* node) { | 1811 Type* Typer::Visitor::TypeNumberToInt32(Node* node) { |
| 1808 return TypeUnaryOp(node, NumberToInt32); | 1812 return TypeUnaryOp(node, NumberToInt32); |
| 1809 } | 1813 } |
| 1810 | 1814 |
| 1811 | 1815 |
| 1812 Type* Typer::Visitor::TypeNumberToUint32(Node* node) { | 1816 Type* Typer::Visitor::TypeNumberToUint32(Node* node) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1895 | 1899 |
| 1896 | 1900 |
| 1897 Type* Typer::Visitor::TypeChangeTaggedToFloat64(Node* node) { | 1901 Type* Typer::Visitor::TypeChangeTaggedToFloat64(Node* node) { |
| 1898 Type* arg = Operand(node, 0); | 1902 Type* arg = Operand(node, 0); |
| 1899 DCHECK(arg->Is(Type::Number())); | 1903 DCHECK(arg->Is(Type::Number())); |
| 1900 return ChangeRepresentation(arg, Type::UntaggedFloat64(), zone()); | 1904 return ChangeRepresentation(arg, Type::UntaggedFloat64(), zone()); |
| 1901 } | 1905 } |
| 1902 | 1906 |
| 1903 Type* Typer::Visitor::TypeTruncateTaggedToFloat64(Node* node) { | 1907 Type* Typer::Visitor::TypeTruncateTaggedToFloat64(Node* node) { |
| 1904 Type* arg = Operand(node, 0); | 1908 Type* arg = Operand(node, 0); |
| 1905 DCHECK(arg->Is(Type::NumberOrUndefined())); | 1909 DCHECK(arg->Is(Type::NumberOrOddball())); |
| 1906 return ChangeRepresentation(arg, Type::UntaggedFloat64(), zone()); | 1910 return ChangeRepresentation(arg, Type::UntaggedFloat64(), zone()); |
| 1907 } | 1911 } |
| 1908 | 1912 |
| 1909 Type* Typer::Visitor::TypeChangeInt31ToTaggedSigned(Node* node) { | 1913 Type* Typer::Visitor::TypeChangeInt31ToTaggedSigned(Node* node) { |
| 1910 Type* arg = Operand(node, 0); | 1914 Type* arg = Operand(node, 0); |
| 1911 // TODO(jarin): DCHECK(arg->Is(Type::Signed31())); | 1915 // TODO(jarin): DCHECK(arg->Is(Type::Signed31())); |
| 1912 // Some mjsunit/asm and mjsunit/wasm tests fail this check. | 1916 // Some mjsunit/asm and mjsunit/wasm tests fail this check. |
| 1913 // For instance, asm/int32-umod fails with Signed32/UntaggedIntegral32 in | 1917 // For instance, asm/int32-umod fails with Signed32/UntaggedIntegral32 in |
| 1914 // simplified-lowering (after propagation). | 1918 // simplified-lowering (after propagation). |
| 1915 Type* rep = | 1919 Type* rep = |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2690 } | 2694 } |
| 2691 if (Type::IsInteger(*value)) { | 2695 if (Type::IsInteger(*value)) { |
| 2692 return Type::Range(value->Number(), value->Number(), zone()); | 2696 return Type::Range(value->Number(), value->Number(), zone()); |
| 2693 } | 2697 } |
| 2694 return Type::Constant(value, zone()); | 2698 return Type::Constant(value, zone()); |
| 2695 } | 2699 } |
| 2696 | 2700 |
| 2697 } // namespace compiler | 2701 } // namespace compiler |
| 2698 } // namespace internal | 2702 } // namespace internal |
| 2699 } // namespace v8 | 2703 } // namespace v8 |
| OLD | NEW |