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 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1794 Type* Typer::Visitor::TypeNumberFloor(Node* node) { | 1794 Type* Typer::Visitor::TypeNumberFloor(Node* node) { |
1795 return TypeUnaryOp(node, NumberFloor); | 1795 return TypeUnaryOp(node, NumberFloor); |
1796 } | 1796 } |
1797 | 1797 |
1798 Type* Typer::Visitor::TypeNumberFround(Node* node) { return Type::Number(); } | 1798 Type* Typer::Visitor::TypeNumberFround(Node* node) { return Type::Number(); } |
1799 | 1799 |
1800 Type* Typer::Visitor::TypeNumberAtan(Node* node) { return Type::Number(); } | 1800 Type* Typer::Visitor::TypeNumberAtan(Node* node) { return Type::Number(); } |
1801 | 1801 |
1802 Type* Typer::Visitor::TypeNumberAtan2(Node* node) { return Type::Number(); } | 1802 Type* Typer::Visitor::TypeNumberAtan2(Node* node) { return Type::Number(); } |
1803 | 1803 |
| 1804 Type* Typer::Visitor::TypeNumberAtanh(Node* node) { return Type::Number(); } |
| 1805 |
1804 Type* Typer::Visitor::TypeNumberExp(Node* node) { | 1806 Type* Typer::Visitor::TypeNumberExp(Node* node) { |
1805 return Type::Union(Type::PlainNumber(), Type::NaN(), zone()); | 1807 return Type::Union(Type::PlainNumber(), Type::NaN(), zone()); |
1806 } | 1808 } |
1807 | 1809 |
| 1810 // TODO(mvstanton): Is this type sufficient, or should it look like Exp()? |
| 1811 Type* Typer::Visitor::TypeNumberExpm1(Node* node) { return Type::Number(); } |
| 1812 |
1808 Type* Typer::Visitor::TypeNumberLog(Node* node) { return Type::Number(); } | 1813 Type* Typer::Visitor::TypeNumberLog(Node* node) { return Type::Number(); } |
1809 | 1814 |
1810 Type* Typer::Visitor::TypeNumberLog1p(Node* node) { return Type::Number(); } | 1815 Type* Typer::Visitor::TypeNumberLog1p(Node* node) { return Type::Number(); } |
1811 | 1816 |
1812 Type* Typer::Visitor::TypeNumberLog2(Node* node) { return Type::Number(); } | 1817 Type* Typer::Visitor::TypeNumberLog2(Node* node) { return Type::Number(); } |
1813 | 1818 |
1814 Type* Typer::Visitor::TypeNumberLog10(Node* node) { return Type::Number(); } | 1819 Type* Typer::Visitor::TypeNumberLog10(Node* node) { return Type::Number(); } |
1815 | 1820 |
| 1821 Type* Typer::Visitor::TypeNumberCbrt(Node* node) { return Type::Number(); } |
| 1822 |
1816 Type* Typer::Visitor::TypeNumberRound(Node* node) { | 1823 Type* Typer::Visitor::TypeNumberRound(Node* node) { |
1817 return TypeUnaryOp(node, NumberRound); | 1824 return TypeUnaryOp(node, NumberRound); |
1818 } | 1825 } |
1819 | 1826 |
1820 Type* Typer::Visitor::TypeNumberSqrt(Node* node) { return Type::Number(); } | 1827 Type* Typer::Visitor::TypeNumberSqrt(Node* node) { return Type::Number(); } |
1821 | 1828 |
1822 Type* Typer::Visitor::TypeNumberTrunc(Node* node) { | 1829 Type* Typer::Visitor::TypeNumberTrunc(Node* node) { |
1823 return TypeUnaryOp(node, NumberTrunc); | 1830 return TypeUnaryOp(node, NumberTrunc); |
1824 } | 1831 } |
1825 | 1832 |
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2557 | 2564 |
2558 Type* Typer::Visitor::TypeFloat64Abs(Node* node) { | 2565 Type* Typer::Visitor::TypeFloat64Abs(Node* node) { |
2559 // TODO(turbofan): We should be able to infer a better type here. | 2566 // TODO(turbofan): We should be able to infer a better type here. |
2560 return Type::Number(); | 2567 return Type::Number(); |
2561 } | 2568 } |
2562 | 2569 |
2563 Type* Typer::Visitor::TypeFloat64Atan(Node* node) { return Type::Number(); } | 2570 Type* Typer::Visitor::TypeFloat64Atan(Node* node) { return Type::Number(); } |
2564 | 2571 |
2565 Type* Typer::Visitor::TypeFloat64Atan2(Node* node) { return Type::Number(); } | 2572 Type* Typer::Visitor::TypeFloat64Atan2(Node* node) { return Type::Number(); } |
2566 | 2573 |
| 2574 Type* Typer::Visitor::TypeFloat64Atanh(Node* node) { return Type::Number(); } |
| 2575 |
2567 Type* Typer::Visitor::TypeFloat64Exp(Node* node) { return Type::Number(); } | 2576 Type* Typer::Visitor::TypeFloat64Exp(Node* node) { return Type::Number(); } |
2568 | 2577 |
| 2578 Type* Typer::Visitor::TypeFloat64Expm1(Node* node) { return Type::Number(); } |
| 2579 |
2569 Type* Typer::Visitor::TypeFloat64Log(Node* node) { return Type::Number(); } | 2580 Type* Typer::Visitor::TypeFloat64Log(Node* node) { return Type::Number(); } |
2570 | 2581 |
2571 Type* Typer::Visitor::TypeFloat64Log1p(Node* node) { return Type::Number(); } | 2582 Type* Typer::Visitor::TypeFloat64Log1p(Node* node) { return Type::Number(); } |
2572 | 2583 |
2573 Type* Typer::Visitor::TypeFloat64Log2(Node* node) { return Type::Number(); } | 2584 Type* Typer::Visitor::TypeFloat64Log2(Node* node) { return Type::Number(); } |
2574 | 2585 |
2575 Type* Typer::Visitor::TypeFloat64Log10(Node* node) { return Type::Number(); } | 2586 Type* Typer::Visitor::TypeFloat64Log10(Node* node) { return Type::Number(); } |
2576 | 2587 |
| 2588 Type* Typer::Visitor::TypeFloat64Cbrt(Node* node) { return Type::Number(); } |
| 2589 |
2577 Type* Typer::Visitor::TypeFloat64Sqrt(Node* node) { return Type::Number(); } | 2590 Type* Typer::Visitor::TypeFloat64Sqrt(Node* node) { return Type::Number(); } |
2578 | 2591 |
2579 | 2592 |
2580 Type* Typer::Visitor::TypeFloat64Equal(Node* node) { return Type::Boolean(); } | 2593 Type* Typer::Visitor::TypeFloat64Equal(Node* node) { return Type::Boolean(); } |
2581 | 2594 |
2582 | 2595 |
2583 Type* Typer::Visitor::TypeFloat64LessThan(Node* node) { | 2596 Type* Typer::Visitor::TypeFloat64LessThan(Node* node) { |
2584 return Type::Boolean(); | 2597 return Type::Boolean(); |
2585 } | 2598 } |
2586 | 2599 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2735 } | 2748 } |
2736 if (Type::IsInteger(*value)) { | 2749 if (Type::IsInteger(*value)) { |
2737 return Type::Range(value->Number(), value->Number(), zone()); | 2750 return Type::Range(value->Number(), value->Number(), zone()); |
2738 } | 2751 } |
2739 return Type::Constant(value, zone()); | 2752 return Type::Constant(value, zone()); |
2740 } | 2753 } |
2741 | 2754 |
2742 } // namespace compiler | 2755 } // namespace compiler |
2743 } // namespace internal | 2756 } // namespace internal |
2744 } // namespace v8 | 2757 } // namespace v8 |
OLD | NEW |