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 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1864 return ChangeRepresentation(arg, Type::UntaggedIntegral32(), zone()); | 1864 return ChangeRepresentation(arg, Type::UntaggedIntegral32(), zone()); |
1865 } | 1865 } |
1866 | 1866 |
1867 | 1867 |
1868 Type* Typer::Visitor::TypeChangeTaggedToFloat64(Node* node) { | 1868 Type* Typer::Visitor::TypeChangeTaggedToFloat64(Node* node) { |
1869 Type* arg = Operand(node, 0); | 1869 Type* arg = Operand(node, 0); |
1870 // TODO(neis): DCHECK(arg->Is(Type::Number())); | 1870 // TODO(neis): DCHECK(arg->Is(Type::Number())); |
1871 return ChangeRepresentation(arg, Type::UntaggedFloat64(), zone()); | 1871 return ChangeRepresentation(arg, Type::UntaggedFloat64(), zone()); |
1872 } | 1872 } |
1873 | 1873 |
1874 Type* Typer::Visitor::TypeChangeInt31ToTaggedSigned(Node* node) { | 1874 Type* Typer::Visitor::TypeChangeInt31ToTagged(Node* node) { |
1875 Type* arg = Operand(node, 0); | 1875 Type* arg = Operand(node, 0); |
1876 // TODO(neis): DCHECK(arg->Is(Type::Signed31())); | 1876 // TODO(neis): DCHECK(arg->Is(Type::Signed31())); |
1877 Type* rep = | 1877 Type* rep = |
1878 arg->Is(Type::SignedSmall()) ? Type::TaggedSigned() : Type::Tagged(); | 1878 arg->Is(Type::SignedSmall()) ? Type::TaggedSigned() : Type::Tagged(); |
1879 return ChangeRepresentation(arg, rep, zone()); | 1879 return ChangeRepresentation(arg, rep, zone()); |
1880 } | 1880 } |
1881 | 1881 |
1882 Type* Typer::Visitor::TypeChangeInt32ToTagged(Node* node) { | 1882 Type* Typer::Visitor::TypeChangeInt32ToTagged(Node* node) { |
1883 Type* arg = Operand(node, 0); | 1883 Type* arg = Operand(node, 0); |
1884 // TODO(neis): DCHECK(arg->Is(Type::Signed32())); | 1884 // TODO(neis): DCHECK(arg->Is(Type::Signed32())); |
1885 Type* rep = | 1885 Type* rep = |
1886 arg->Is(Type::SignedSmall()) ? Type::TaggedSigned() : Type::Tagged(); | 1886 arg->Is(Type::SignedSmall()) ? Type::TaggedSigned() : Type::Tagged(); |
1887 return ChangeRepresentation(arg, rep, zone()); | 1887 return ChangeRepresentation(arg, rep, zone()); |
1888 } | 1888 } |
1889 | 1889 |
1890 | 1890 |
1891 Type* Typer::Visitor::TypeChangeUint32ToTagged(Node* node) { | 1891 Type* Typer::Visitor::TypeChangeUint32ToTagged(Node* node) { |
1892 Type* arg = Operand(node, 0); | 1892 Type* arg = Operand(node, 0); |
1893 // TODO(neis): DCHECK(arg->Is(Type::Unsigned32())); | 1893 // TODO(neis): DCHECK(arg->Is(Type::Unsigned32())); |
1894 return ChangeRepresentation(arg, Type::Tagged(), zone()); | 1894 return ChangeRepresentation(arg, Type::Tagged(), zone()); |
1895 } | 1895 } |
1896 | 1896 |
1897 | 1897 |
1898 Type* Typer::Visitor::TypeChangeFloat64ToTagged(Node* node) { | 1898 Type* Typer::Visitor::TypeChangeFloat64ToTagged(Node* node) { |
1899 Type* arg = Operand(node, 0); | 1899 Type* arg = Operand(node, 0); |
1900 // TODO(neis): CHECK(arg.upper->Is(Type::Number())); | 1900 // TODO(neis): CHECK(arg.upper->Is(Type::Number())); |
1901 return ChangeRepresentation(arg, Type::Tagged(), zone()); | 1901 return ChangeRepresentation(arg, Type::Tagged(), zone()); |
1902 } | 1902 } |
1903 | 1903 |
1904 Type* Typer::Visitor::TypeChangeTaggedToBit(Node* node) { | 1904 |
| 1905 Type* Typer::Visitor::TypeChangeBoolToBit(Node* node) { |
1905 Type* arg = Operand(node, 0); | 1906 Type* arg = Operand(node, 0); |
1906 // TODO(neis): DCHECK(arg.upper->Is(Type::Boolean())); | 1907 // TODO(neis): DCHECK(arg.upper->Is(Type::Boolean())); |
1907 return ChangeRepresentation(arg, Type::UntaggedBit(), zone()); | 1908 return ChangeRepresentation(arg, Type::UntaggedBit(), zone()); |
1908 } | 1909 } |
1909 | 1910 |
1910 Type* Typer::Visitor::TypeChangeBitToTagged(Node* node) { | 1911 |
| 1912 Type* Typer::Visitor::TypeChangeBitToBool(Node* node) { |
1911 Type* arg = Operand(node, 0); | 1913 Type* arg = Operand(node, 0); |
1912 // TODO(neis): DCHECK(arg.upper->Is(Type::Boolean())); | 1914 // TODO(neis): DCHECK(arg.upper->Is(Type::Boolean())); |
1913 return ChangeRepresentation(arg, Type::TaggedPointer(), zone()); | 1915 return ChangeRepresentation(arg, Type::TaggedPointer(), zone()); |
1914 } | 1916 } |
1915 | 1917 |
1916 Type* Typer::Visitor::TypeTruncateTaggedToWord32(Node* node) { | 1918 Type* Typer::Visitor::TypeTruncateTaggedToWord32(Node* node) { |
1917 Type* arg = Operand(node, 0); | 1919 Type* arg = Operand(node, 0); |
1918 // TODO(neis): DCHECK(arg->Is(Type::Number())); | 1920 // TODO(neis): DCHECK(arg->Is(Type::Number())); |
1919 return ChangeRepresentation(arg, Type::UntaggedIntegral32(), zone()); | 1921 return ChangeRepresentation(arg, Type::UntaggedIntegral32(), zone()); |
1920 } | 1922 } |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2576 } | 2578 } |
2577 if (Type::IsInteger(*value)) { | 2579 if (Type::IsInteger(*value)) { |
2578 return Type::Range(value->Number(), value->Number(), zone()); | 2580 return Type::Range(value->Number(), value->Number(), zone()); |
2579 } | 2581 } |
2580 return Type::Constant(value, zone()); | 2582 return Type::Constant(value, zone()); |
2581 } | 2583 } |
2582 | 2584 |
2583 } // namespace compiler | 2585 } // namespace compiler |
2584 } // namespace internal | 2586 } // namespace internal |
2585 } // namespace v8 | 2587 } // namespace v8 |
OLD | NEW |