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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 Type* Typer::Visitor::JSLessThanOrEqualTyper(Type* lhs, Type* rhs, Typer* t) { | 866 Type* Typer::Visitor::JSLessThanOrEqualTyper(Type* lhs, Type* rhs, Typer* t) { |
867 return FalsifyUndefined(Invert(JSCompareTyper(rhs, lhs, t), t), t); | 867 return FalsifyUndefined(Invert(JSCompareTyper(rhs, lhs, t), t), t); |
868 } | 868 } |
869 | 869 |
870 | 870 |
871 Type* Typer::Visitor::JSGreaterThanOrEqualTyper( | 871 Type* Typer::Visitor::JSGreaterThanOrEqualTyper( |
872 Type* lhs, Type* rhs, Typer* t) { | 872 Type* lhs, Type* rhs, Typer* t) { |
873 return FalsifyUndefined(Invert(JSCompareTyper(lhs, rhs, t), t), t); | 873 return FalsifyUndefined(Invert(JSCompareTyper(lhs, rhs, t), t), t); |
874 } | 874 } |
875 | 875 |
876 | |
877 // JS bitwise operators. | 876 // JS bitwise operators. |
878 | 877 |
879 | 878 |
880 Type* Typer::Visitor::JSBitwiseOrTyper(Type* lhs, Type* rhs, Typer* t) { | 879 Type* Typer::Visitor::JSBitwiseOrTyper(Type* lhs, Type* rhs, Typer* t) { |
881 lhs = NumberToInt32(ToNumber(lhs, t), t); | 880 lhs = NumberToInt32(ToNumber(lhs, t), t); |
882 rhs = NumberToInt32(ToNumber(rhs, t), t); | 881 rhs = NumberToInt32(ToNumber(rhs, t), t); |
883 double lmin = lhs->Min(); | 882 double lmin = lhs->Min(); |
884 double rmin = rhs->Min(); | 883 double rmin = rhs->Min(); |
885 double lmax = lhs->Max(); | 884 double lmax = lhs->Max(); |
886 double rmax = rhs->Max(); | 885 double rmax = rhs->Max(); |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1703 } | 1702 } |
1704 | 1703 |
1705 Type* Typer::Visitor::TypeNumberEqual(Node* node) { return Type::Boolean(); } | 1704 Type* Typer::Visitor::TypeNumberEqual(Node* node) { return Type::Boolean(); } |
1706 | 1705 |
1707 Type* Typer::Visitor::TypeNumberLessThan(Node* node) { return Type::Boolean(); } | 1706 Type* Typer::Visitor::TypeNumberLessThan(Node* node) { return Type::Boolean(); } |
1708 | 1707 |
1709 Type* Typer::Visitor::TypeNumberLessThanOrEqual(Node* node) { | 1708 Type* Typer::Visitor::TypeNumberLessThanOrEqual(Node* node) { |
1710 return Type::Boolean(); | 1709 return Type::Boolean(); |
1711 } | 1710 } |
1712 | 1711 |
| 1712 Type* Typer::Visitor::TypeSpeculativeNumberEqual(Node* node) { |
| 1713 return Type::Boolean(); |
| 1714 } |
| 1715 |
| 1716 Type* Typer::Visitor::TypeSpeculativeNumberLessThan(Node* node) { |
| 1717 return Type::Boolean(); |
| 1718 } |
| 1719 |
| 1720 Type* Typer::Visitor::TypeSpeculativeNumberLessThanOrEqual(Node* node) { |
| 1721 return Type::Boolean(); |
| 1722 } |
| 1723 |
1713 Type* Typer::Visitor::TypeNumberAdd(Node* node) { return Type::Number(); } | 1724 Type* Typer::Visitor::TypeNumberAdd(Node* node) { return Type::Number(); } |
1714 | 1725 |
1715 Type* Typer::Visitor::TypeNumberSubtract(Node* node) { return Type::Number(); } | 1726 Type* Typer::Visitor::TypeNumberSubtract(Node* node) { return Type::Number(); } |
1716 | 1727 |
1717 Type* Typer::Visitor::TypeSpeculativeNumberAdd(Node* node) { | 1728 Type* Typer::Visitor::TypeSpeculativeNumberAdd(Node* node) { |
1718 return Type::Number(); | 1729 return Type::Number(); |
1719 } | 1730 } |
1720 | 1731 |
1721 Type* Typer::Visitor::TypeSpeculativeNumberSubtract(Node* node) { | 1732 Type* Typer::Visitor::TypeSpeculativeNumberSubtract(Node* node) { |
1722 return Type::Number(); | 1733 return Type::Number(); |
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2709 } | 2720 } |
2710 if (Type::IsInteger(*value)) { | 2721 if (Type::IsInteger(*value)) { |
2711 return Type::Range(value->Number(), value->Number(), zone()); | 2722 return Type::Range(value->Number(), value->Number(), zone()); |
2712 } | 2723 } |
2713 return Type::Constant(value, zone()); | 2724 return Type::Constant(value, zone()); |
2714 } | 2725 } |
2715 | 2726 |
2716 } // namespace compiler | 2727 } // namespace compiler |
2717 } // namespace internal | 2728 } // namespace internal |
2718 } // namespace v8 | 2729 } // namespace v8 |
OLD | NEW |