| 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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 Type* Typer::Visitor::JSLessThanOrEqualTyper(Type* lhs, Type* rhs, Typer* t) { | 870 Type* Typer::Visitor::JSLessThanOrEqualTyper(Type* lhs, Type* rhs, Typer* t) { |
| 871 return FalsifyUndefined(Invert(JSCompareTyper(rhs, lhs, t), t), t); | 871 return FalsifyUndefined(Invert(JSCompareTyper(rhs, lhs, t), t), t); |
| 872 } | 872 } |
| 873 | 873 |
| 874 | 874 |
| 875 Type* Typer::Visitor::JSGreaterThanOrEqualTyper( | 875 Type* Typer::Visitor::JSGreaterThanOrEqualTyper( |
| 876 Type* lhs, Type* rhs, Typer* t) { | 876 Type* lhs, Type* rhs, Typer* t) { |
| 877 return FalsifyUndefined(Invert(JSCompareTyper(lhs, rhs, t), t), t); | 877 return FalsifyUndefined(Invert(JSCompareTyper(lhs, rhs, t), t), t); |
| 878 } | 878 } |
| 879 | 879 |
| 880 | |
| 881 // JS bitwise operators. | 880 // JS bitwise operators. |
| 882 | 881 |
| 883 | 882 |
| 884 Type* Typer::Visitor::JSBitwiseOrTyper(Type* lhs, Type* rhs, Typer* t) { | 883 Type* Typer::Visitor::JSBitwiseOrTyper(Type* lhs, Type* rhs, Typer* t) { |
| 885 lhs = NumberToInt32(ToNumber(lhs, t), t); | 884 lhs = NumberToInt32(ToNumber(lhs, t), t); |
| 886 rhs = NumberToInt32(ToNumber(rhs, t), t); | 885 rhs = NumberToInt32(ToNumber(rhs, t), t); |
| 887 double lmin = lhs->Min(); | 886 double lmin = lhs->Min(); |
| 888 double rmin = rhs->Min(); | 887 double rmin = rhs->Min(); |
| 889 double lmax = lhs->Max(); | 888 double lmax = lhs->Max(); |
| 890 double rmax = rhs->Max(); | 889 double rmax = rhs->Max(); |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1711 } | 1710 } |
| 1712 | 1711 |
| 1713 Type* Typer::Visitor::TypeNumberEqual(Node* node) { return Type::Boolean(); } | 1712 Type* Typer::Visitor::TypeNumberEqual(Node* node) { return Type::Boolean(); } |
| 1714 | 1713 |
| 1715 Type* Typer::Visitor::TypeNumberLessThan(Node* node) { return Type::Boolean(); } | 1714 Type* Typer::Visitor::TypeNumberLessThan(Node* node) { return Type::Boolean(); } |
| 1716 | 1715 |
| 1717 Type* Typer::Visitor::TypeNumberLessThanOrEqual(Node* node) { | 1716 Type* Typer::Visitor::TypeNumberLessThanOrEqual(Node* node) { |
| 1718 return Type::Boolean(); | 1717 return Type::Boolean(); |
| 1719 } | 1718 } |
| 1720 | 1719 |
| 1720 Type* Typer::Visitor::TypeSpeculativeNumberEqual(Node* node) { |
| 1721 return Type::Boolean(); |
| 1722 } |
| 1723 |
| 1724 Type* Typer::Visitor::TypeSpeculativeNumberLessThan(Node* node) { |
| 1725 return Type::Boolean(); |
| 1726 } |
| 1727 |
| 1728 Type* Typer::Visitor::TypeSpeculativeNumberLessThanOrEqual(Node* node) { |
| 1729 return Type::Boolean(); |
| 1730 } |
| 1731 |
| 1721 Type* Typer::Visitor::TypeNumberAdd(Node* node) { return Type::Number(); } | 1732 Type* Typer::Visitor::TypeNumberAdd(Node* node) { return Type::Number(); } |
| 1722 | 1733 |
| 1723 Type* Typer::Visitor::TypeNumberSubtract(Node* node) { return Type::Number(); } | 1734 Type* Typer::Visitor::TypeNumberSubtract(Node* node) { return Type::Number(); } |
| 1724 | 1735 |
| 1725 Type* Typer::Visitor::TypeSpeculativeNumberAdd(Node* node) { | 1736 Type* Typer::Visitor::TypeSpeculativeNumberAdd(Node* node) { |
| 1726 return Type::Number(); | 1737 return Type::Number(); |
| 1727 } | 1738 } |
| 1728 | 1739 |
| 1729 Type* Typer::Visitor::TypeSpeculativeNumberSubtract(Node* node) { | 1740 Type* Typer::Visitor::TypeSpeculativeNumberSubtract(Node* node) { |
| 1730 return Type::Number(); | 1741 return Type::Number(); |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2642 } | 2653 } |
| 2643 if (Type::IsInteger(*value)) { | 2654 if (Type::IsInteger(*value)) { |
| 2644 return Type::Range(value->Number(), value->Number(), zone()); | 2655 return Type::Range(value->Number(), value->Number(), zone()); |
| 2645 } | 2656 } |
| 2646 return Type::Constant(value, zone()); | 2657 return Type::Constant(value, zone()); |
| 2647 } | 2658 } |
| 2648 | 2659 |
| 2649 } // namespace compiler | 2660 } // namespace compiler |
| 2650 } // namespace internal | 2661 } // namespace internal |
| 2651 } // namespace v8 | 2662 } // namespace v8 |
| OLD | NEW |