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 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1727 Type* Typer::Visitor::TypeNumberSubtract(Node* node) { return Type::Number(); } | 1727 Type* Typer::Visitor::TypeNumberSubtract(Node* node) { return Type::Number(); } |
1728 | 1728 |
1729 Type* Typer::Visitor::TypeSpeculativeNumberAdd(Node* node) { | 1729 Type* Typer::Visitor::TypeSpeculativeNumberAdd(Node* node) { |
1730 return Type::Number(); | 1730 return Type::Number(); |
1731 } | 1731 } |
1732 | 1732 |
1733 Type* Typer::Visitor::TypeSpeculativeNumberSubtract(Node* node) { | 1733 Type* Typer::Visitor::TypeSpeculativeNumberSubtract(Node* node) { |
1734 return Type::Number(); | 1734 return Type::Number(); |
1735 } | 1735 } |
1736 | 1736 |
| 1737 Type* Typer::Visitor::TypeSpeculativeNumberMultiply(Node* node) { |
| 1738 return Type::Number(); |
| 1739 } |
| 1740 |
| 1741 Type* Typer::Visitor::TypeSpeculativeNumberDivide(Node* node) { |
| 1742 return Type::Number(); |
| 1743 } |
| 1744 |
| 1745 Type* Typer::Visitor::TypeSpeculativeNumberModulus(Node* node) { |
| 1746 return Type::Number(); |
| 1747 } |
| 1748 |
1737 Type* Typer::Visitor::TypeNumberMultiply(Node* node) { return Type::Number(); } | 1749 Type* Typer::Visitor::TypeNumberMultiply(Node* node) { return Type::Number(); } |
1738 | 1750 |
1739 Type* Typer::Visitor::TypeNumberDivide(Node* node) { return Type::Number(); } | 1751 Type* Typer::Visitor::TypeNumberDivide(Node* node) { return Type::Number(); } |
1740 | 1752 |
1741 Type* Typer::Visitor::TypeNumberModulus(Node* node) { return Type::Number(); } | 1753 Type* Typer::Visitor::TypeNumberModulus(Node* node) { return Type::Number(); } |
1742 | 1754 |
1743 Type* Typer::Visitor::TypeNumberBitwiseOr(Node* node) { | 1755 Type* Typer::Visitor::TypeNumberBitwiseOr(Node* node) { |
1744 return Type::Signed32(); | 1756 return Type::Signed32(); |
1745 } | 1757 } |
1746 | 1758 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1913 | 1925 |
1914 | 1926 |
1915 Type* Typer::Visitor::TypeChangeTaggedToFloat64(Node* node) { | 1927 Type* Typer::Visitor::TypeChangeTaggedToFloat64(Node* node) { |
1916 Type* arg = Operand(node, 0); | 1928 Type* arg = Operand(node, 0); |
1917 DCHECK(arg->Is(Type::Number())); | 1929 DCHECK(arg->Is(Type::Number())); |
1918 return ChangeRepresentation(arg, Type::UntaggedFloat64(), zone()); | 1930 return ChangeRepresentation(arg, Type::UntaggedFloat64(), zone()); |
1919 } | 1931 } |
1920 | 1932 |
1921 Type* Typer::Visitor::TypeTruncateTaggedToFloat64(Node* node) { | 1933 Type* Typer::Visitor::TypeTruncateTaggedToFloat64(Node* node) { |
1922 Type* arg = Operand(node, 0); | 1934 Type* arg = Operand(node, 0); |
1923 DCHECK(arg->Is(Type::NumberOrOddball())); | 1935 // TODO(jarin) This DCHECK does not work because of speculative feedback. |
| 1936 // Re-enable once we record the speculative feedback in types. |
| 1937 // DCHECK(arg->Is(Type::NumberOrOddball())); |
1924 return ChangeRepresentation(arg, Type::UntaggedFloat64(), zone()); | 1938 return ChangeRepresentation(arg, Type::UntaggedFloat64(), zone()); |
1925 } | 1939 } |
1926 | 1940 |
1927 Type* Typer::Visitor::TypeChangeInt31ToTaggedSigned(Node* node) { | 1941 Type* Typer::Visitor::TypeChangeInt31ToTaggedSigned(Node* node) { |
1928 Type* arg = Operand(node, 0); | 1942 Type* arg = Operand(node, 0); |
1929 // TODO(jarin): DCHECK(arg->Is(Type::Signed31())); | 1943 // TODO(jarin): DCHECK(arg->Is(Type::Signed31())); |
1930 // Some mjsunit/asm and mjsunit/wasm tests fail this check. | 1944 // Some mjsunit/asm and mjsunit/wasm tests fail this check. |
1931 // For instance, asm/int32-umod fails with Signed32/UntaggedIntegral32 in | 1945 // For instance, asm/int32-umod fails with Signed32/UntaggedIntegral32 in |
1932 // simplified-lowering (after propagation). | 1946 // simplified-lowering (after propagation). |
1933 Type* rep = | 1947 Type* rep = |
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2748 } | 2762 } |
2749 if (Type::IsInteger(*value)) { | 2763 if (Type::IsInteger(*value)) { |
2750 return Type::Range(value->Number(), value->Number(), zone()); | 2764 return Type::Range(value->Number(), value->Number(), zone()); |
2751 } | 2765 } |
2752 return Type::Constant(value, zone()); | 2766 return Type::Constant(value, zone()); |
2753 } | 2767 } |
2754 | 2768 |
2755 } // namespace compiler | 2769 } // namespace compiler |
2756 } // namespace internal | 2770 } // namespace internal |
2757 } // namespace v8 | 2771 } // namespace v8 |
OLD | NEW |