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 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1605 return TypeUnaryOp(node, ObjectIsSmi); | 1605 return TypeUnaryOp(node, ObjectIsSmi); |
1606 case Runtime::kInlineIsArray: | 1606 case Runtime::kInlineIsArray: |
1607 case Runtime::kInlineIsDate: | 1607 case Runtime::kInlineIsDate: |
1608 case Runtime::kInlineIsTypedArray: | 1608 case Runtime::kInlineIsTypedArray: |
1609 case Runtime::kInlineIsRegExp: | 1609 case Runtime::kInlineIsRegExp: |
1610 return Type::Boolean(); | 1610 return Type::Boolean(); |
1611 case Runtime::kInlineDoubleLo: | 1611 case Runtime::kInlineDoubleLo: |
1612 case Runtime::kInlineDoubleHi: | 1612 case Runtime::kInlineDoubleHi: |
1613 return Type::Signed32(); | 1613 return Type::Signed32(); |
1614 case Runtime::kInlineConstructDouble: | 1614 case Runtime::kInlineConstructDouble: |
1615 case Runtime::kInlineMathAtan2: | |
1616 return Type::Number(); | 1615 return Type::Number(); |
1617 case Runtime::kInlineCreateIterResultObject: | 1616 case Runtime::kInlineCreateIterResultObject: |
1618 case Runtime::kInlineRegExpConstructResult: | 1617 case Runtime::kInlineRegExpConstructResult: |
1619 return Type::OtherObject(); | 1618 return Type::OtherObject(); |
1620 case Runtime::kInlineSubString: | 1619 case Runtime::kInlineSubString: |
1621 case Runtime::kInlineStringCharFromCode: | 1620 case Runtime::kInlineStringCharFromCode: |
1622 return Type::String(); | 1621 return Type::String(); |
1623 case Runtime::kInlineToInteger: | 1622 case Runtime::kInlineToInteger: |
1624 return TypeUnaryOp(node, ToInteger); | 1623 return TypeUnaryOp(node, ToInteger); |
1625 case Runtime::kInlineToLength: | 1624 case Runtime::kInlineToLength: |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1778 } | 1777 } |
1779 | 1778 |
1780 Type* Typer::Visitor::TypeNumberCeil(Node* node) { | 1779 Type* Typer::Visitor::TypeNumberCeil(Node* node) { |
1781 return TypeUnaryOp(node, NumberCeil); | 1780 return TypeUnaryOp(node, NumberCeil); |
1782 } | 1781 } |
1783 | 1782 |
1784 Type* Typer::Visitor::TypeNumberFloor(Node* node) { | 1783 Type* Typer::Visitor::TypeNumberFloor(Node* node) { |
1785 return TypeUnaryOp(node, NumberFloor); | 1784 return TypeUnaryOp(node, NumberFloor); |
1786 } | 1785 } |
1787 | 1786 |
| 1787 Type* Typer::Visitor::TypeNumberAtan(Node* node) { return Type::Number(); } |
| 1788 |
| 1789 Type* Typer::Visitor::TypeNumberAtan2(Node* node) { return Type::Number(); } |
| 1790 |
1788 Type* Typer::Visitor::TypeNumberLog(Node* node) { return Type::Number(); } | 1791 Type* Typer::Visitor::TypeNumberLog(Node* node) { return Type::Number(); } |
1789 | 1792 |
1790 Type* Typer::Visitor::TypeNumberLog1p(Node* node) { return Type::Number(); } | 1793 Type* Typer::Visitor::TypeNumberLog1p(Node* node) { return Type::Number(); } |
1791 | 1794 |
1792 Type* Typer::Visitor::TypeNumberRound(Node* node) { | 1795 Type* Typer::Visitor::TypeNumberRound(Node* node) { |
1793 return TypeUnaryOp(node, NumberRound); | 1796 return TypeUnaryOp(node, NumberRound); |
1794 } | 1797 } |
1795 | 1798 |
1796 Type* Typer::Visitor::TypeNumberTrunc(Node* node) { | 1799 Type* Typer::Visitor::TypeNumberTrunc(Node* node) { |
1797 return TypeUnaryOp(node, NumberTrunc); | 1800 return TypeUnaryOp(node, NumberTrunc); |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2497 | 2500 |
2498 | 2501 |
2499 Type* Typer::Visitor::TypeFloat64Min(Node* node) { return Type::Number(); } | 2502 Type* Typer::Visitor::TypeFloat64Min(Node* node) { return Type::Number(); } |
2500 | 2503 |
2501 | 2504 |
2502 Type* Typer::Visitor::TypeFloat64Abs(Node* node) { | 2505 Type* Typer::Visitor::TypeFloat64Abs(Node* node) { |
2503 // TODO(turbofan): We should be able to infer a better type here. | 2506 // TODO(turbofan): We should be able to infer a better type here. |
2504 return Type::Number(); | 2507 return Type::Number(); |
2505 } | 2508 } |
2506 | 2509 |
| 2510 Type* Typer::Visitor::TypeFloat64Atan(Node* node) { return Type::Number(); } |
| 2511 |
| 2512 Type* Typer::Visitor::TypeFloat64Atan2(Node* node) { return Type::Number(); } |
| 2513 |
2507 Type* Typer::Visitor::TypeFloat64Log(Node* node) { return Type::Number(); } | 2514 Type* Typer::Visitor::TypeFloat64Log(Node* node) { return Type::Number(); } |
2508 | 2515 |
2509 Type* Typer::Visitor::TypeFloat64Log1p(Node* node) { return Type::Number(); } | 2516 Type* Typer::Visitor::TypeFloat64Log1p(Node* node) { return Type::Number(); } |
2510 | 2517 |
2511 Type* Typer::Visitor::TypeFloat64Sqrt(Node* node) { return Type::Number(); } | 2518 Type* Typer::Visitor::TypeFloat64Sqrt(Node* node) { return Type::Number(); } |
2512 | 2519 |
2513 | 2520 |
2514 Type* Typer::Visitor::TypeFloat64Equal(Node* node) { return Type::Boolean(); } | 2521 Type* Typer::Visitor::TypeFloat64Equal(Node* node) { return Type::Boolean(); } |
2515 | 2522 |
2516 | 2523 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2669 } | 2676 } |
2670 if (Type::IsInteger(*value)) { | 2677 if (Type::IsInteger(*value)) { |
2671 return Type::Range(value->Number(), value->Number(), zone()); | 2678 return Type::Range(value->Number(), value->Number(), zone()); |
2672 } | 2679 } |
2673 return Type::Constant(value, zone()); | 2680 return Type::Constant(value, zone()); |
2674 } | 2681 } |
2675 | 2682 |
2676 } // namespace compiler | 2683 } // namespace compiler |
2677 } // namespace internal | 2684 } // namespace internal |
2678 } // namespace v8 | 2685 } // namespace v8 |
OLD | NEW |