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 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 case Runtime::kInlineIsDate: | 1624 case Runtime::kInlineIsDate: |
1625 case Runtime::kInlineIsTypedArray: | 1625 case Runtime::kInlineIsTypedArray: |
1626 case Runtime::kInlineIsRegExp: | 1626 case Runtime::kInlineIsRegExp: |
1627 return Type::Boolean(); | 1627 return Type::Boolean(); |
1628 case Runtime::kInlineDoubleLo: | 1628 case Runtime::kInlineDoubleLo: |
1629 case Runtime::kInlineDoubleHi: | 1629 case Runtime::kInlineDoubleHi: |
1630 return Type::Signed32(); | 1630 return Type::Signed32(); |
1631 case Runtime::kInlineConstructDouble: | 1631 case Runtime::kInlineConstructDouble: |
1632 case Runtime::kInlineMathAtan2: | 1632 case Runtime::kInlineMathAtan2: |
1633 return Type::Number(); | 1633 return Type::Number(); |
1634 case Runtime::kInlineMathClz32: | |
1635 return Type::Range(0, 32, zone()); | |
1636 case Runtime::kInlineCreateIterResultObject: | 1634 case Runtime::kInlineCreateIterResultObject: |
1637 case Runtime::kInlineRegExpConstructResult: | 1635 case Runtime::kInlineRegExpConstructResult: |
1638 return Type::OtherObject(); | 1636 return Type::OtherObject(); |
1639 case Runtime::kInlineSubString: | 1637 case Runtime::kInlineSubString: |
1640 case Runtime::kInlineStringCharFromCode: | 1638 case Runtime::kInlineStringCharFromCode: |
1641 return Type::String(); | 1639 return Type::String(); |
1642 case Runtime::kInlineToInteger: | 1640 case Runtime::kInlineToInteger: |
1643 return TypeUnaryOp(node, ToInteger); | 1641 return TypeUnaryOp(node, ToInteger); |
1644 case Runtime::kInlineToLength: | 1642 case Runtime::kInlineToLength: |
1645 return TypeUnaryOp(node, ToLength); | 1643 return TypeUnaryOp(node, ToLength); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1752 | 1750 |
1753 Type* Typer::Visitor::TypeNumberShiftRight(Node* node) { | 1751 Type* Typer::Visitor::TypeNumberShiftRight(Node* node) { |
1754 return Type::Signed32(); | 1752 return Type::Signed32(); |
1755 } | 1753 } |
1756 | 1754 |
1757 | 1755 |
1758 Type* Typer::Visitor::TypeNumberShiftRightLogical(Node* node) { | 1756 Type* Typer::Visitor::TypeNumberShiftRightLogical(Node* node) { |
1759 return Type::Unsigned32(); | 1757 return Type::Unsigned32(); |
1760 } | 1758 } |
1761 | 1759 |
| 1760 Type* Typer::Visitor::TypeNumberClz32(Node* node) { |
| 1761 return typer_->cache_.kZeroToThirtyTwo; |
| 1762 } |
| 1763 |
1762 Type* Typer::Visitor::TypeNumberCeil(Node* node) { | 1764 Type* Typer::Visitor::TypeNumberCeil(Node* node) { |
1763 return TypeUnaryOp(node, NumberCeil); | 1765 return TypeUnaryOp(node, NumberCeil); |
1764 } | 1766 } |
1765 | 1767 |
1766 Type* Typer::Visitor::TypeNumberFloor(Node* node) { | 1768 Type* Typer::Visitor::TypeNumberFloor(Node* node) { |
1767 return TypeUnaryOp(node, NumberFloor); | 1769 return TypeUnaryOp(node, NumberFloor); |
1768 } | 1770 } |
1769 | 1771 |
1770 Type* Typer::Visitor::TypeNumberRound(Node* node) { | 1772 Type* Typer::Visitor::TypeNumberRound(Node* node) { |
1771 return TypeUnaryOp(node, NumberRound); | 1773 return TypeUnaryOp(node, NumberRound); |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2532 } | 2534 } |
2533 if (Type::IsInteger(*value)) { | 2535 if (Type::IsInteger(*value)) { |
2534 return Type::Range(value->Number(), value->Number(), zone()); | 2536 return Type::Range(value->Number(), value->Number(), zone()); |
2535 } | 2537 } |
2536 return Type::Constant(value, zone()); | 2538 return Type::Constant(value, zone()); |
2537 } | 2539 } |
2538 | 2540 |
2539 } // namespace compiler | 2541 } // namespace compiler |
2540 } // namespace internal | 2542 } // namespace internal |
2541 } // namespace v8 | 2543 } // namespace v8 |
OLD | NEW |