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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 return Type::Any(); | 481 return Type::Any(); |
482 } | 482 } |
483 | 483 |
484 | 484 |
485 Type* Typer::Visitor::TypeOsrValue(Node* node) { return Type::Any(); } | 485 Type* Typer::Visitor::TypeOsrValue(Node* node) { return Type::Any(); } |
486 | 486 |
487 | 487 |
488 Type* Typer::Visitor::TypeInt32Constant(Node* node) { | 488 Type* Typer::Visitor::TypeInt32Constant(Node* node) { |
489 double number = OpParameter<int32_t>(node); | 489 double number = OpParameter<int32_t>(node); |
490 return Type::Intersect(Type::Range(number, number, zone()), | 490 return Type::Intersect(Type::Range(number, number, zone()), |
491 Type::UntaggedSigned32(), zone()); | 491 Type::UntaggedIntegral32(), zone()); |
492 } | 492 } |
493 | 493 |
494 | 494 |
495 Type* Typer::Visitor::TypeInt64Constant(Node* node) { | 495 Type* Typer::Visitor::TypeInt64Constant(Node* node) { |
496 // TODO(rossberg): This actually seems to be a PointerConstant so far... | 496 // TODO(rossberg): This actually seems to be a PointerConstant so far... |
497 return Type::Internal(); // TODO(rossberg): Add int64 bitset type? | 497 return Type::Internal(); // TODO(rossberg): Add int64 bitset type? |
498 } | 498 } |
499 | 499 |
500 | 500 |
501 Type* Typer::Visitor::TypeFloat32Constant(Node* node) { | 501 Type* Typer::Visitor::TypeFloat32Constant(Node* node) { |
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 return Type::Union(Type::Semantic(type, zone), | 1633 return Type::Union(Type::Semantic(type, zone), |
1634 Type::Representation(rep, zone), zone); | 1634 Type::Representation(rep, zone), zone); |
1635 } | 1635 } |
1636 | 1636 |
1637 } // namespace | 1637 } // namespace |
1638 | 1638 |
1639 | 1639 |
1640 Type* Typer::Visitor::TypeChangeTaggedToInt32(Node* node) { | 1640 Type* Typer::Visitor::TypeChangeTaggedToInt32(Node* node) { |
1641 Type* arg = Operand(node, 0); | 1641 Type* arg = Operand(node, 0); |
1642 // TODO(neis): DCHECK(arg->Is(Type::Signed32())); | 1642 // TODO(neis): DCHECK(arg->Is(Type::Signed32())); |
1643 return ChangeRepresentation(arg, Type::UntaggedSigned32(), zone()); | 1643 return ChangeRepresentation(arg, Type::UntaggedIntegral32(), zone()); |
1644 } | 1644 } |
1645 | 1645 |
1646 | 1646 |
1647 Type* Typer::Visitor::TypeChangeTaggedToUint32(Node* node) { | 1647 Type* Typer::Visitor::TypeChangeTaggedToUint32(Node* node) { |
1648 Type* arg = Operand(node, 0); | 1648 Type* arg = Operand(node, 0); |
1649 // TODO(neis): DCHECK(arg->Is(Type::Unsigned32())); | 1649 // TODO(neis): DCHECK(arg->Is(Type::Unsigned32())); |
1650 return ChangeRepresentation(arg, Type::UntaggedUnsigned32(), zone()); | 1650 return ChangeRepresentation(arg, Type::UntaggedIntegral32(), zone()); |
1651 } | 1651 } |
1652 | 1652 |
1653 | 1653 |
1654 Type* Typer::Visitor::TypeChangeTaggedToFloat64(Node* node) { | 1654 Type* Typer::Visitor::TypeChangeTaggedToFloat64(Node* node) { |
1655 Type* arg = Operand(node, 0); | 1655 Type* arg = Operand(node, 0); |
1656 // TODO(neis): DCHECK(arg->Is(Type::Number())); | 1656 // TODO(neis): DCHECK(arg->Is(Type::Number())); |
1657 return ChangeRepresentation(arg, Type::UntaggedFloat64(), zone()); | 1657 return ChangeRepresentation(arg, Type::UntaggedFloat64(), zone()); |
1658 } | 1658 } |
1659 | 1659 |
1660 | 1660 |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1965 | 1965 |
1966 Type* Typer::Visitor::TypeUint64Mod(Node* node) { return Type::Internal(); } | 1966 Type* Typer::Visitor::TypeUint64Mod(Node* node) { return Type::Internal(); } |
1967 | 1967 |
1968 | 1968 |
1969 Type* Typer::Visitor::TypeChangeFloat32ToFloat64(Node* node) { | 1969 Type* Typer::Visitor::TypeChangeFloat32ToFloat64(Node* node) { |
1970 return Type::Intersect(Type::Number(), Type::UntaggedFloat64(), zone()); | 1970 return Type::Intersect(Type::Number(), Type::UntaggedFloat64(), zone()); |
1971 } | 1971 } |
1972 | 1972 |
1973 | 1973 |
1974 Type* Typer::Visitor::TypeChangeFloat64ToInt32(Node* node) { | 1974 Type* Typer::Visitor::TypeChangeFloat64ToInt32(Node* node) { |
1975 return Type::Intersect(Type::Signed32(), Type::UntaggedSigned32(), zone()); | 1975 return Type::Intersect(Type::Signed32(), Type::UntaggedIntegral32(), zone()); |
1976 } | 1976 } |
1977 | 1977 |
1978 | 1978 |
1979 Type* Typer::Visitor::TypeChangeFloat64ToUint32(Node* node) { | 1979 Type* Typer::Visitor::TypeChangeFloat64ToUint32(Node* node) { |
1980 return Type::Intersect(Type::Unsigned32(), Type::UntaggedUnsigned32(), | 1980 return Type::Intersect(Type::Unsigned32(), Type::UntaggedIntegral32(), |
1981 zone()); | 1981 zone()); |
1982 } | 1982 } |
1983 | 1983 |
1984 | 1984 |
1985 Type* Typer::Visitor::TypeChangeInt32ToFloat64(Node* node) { | 1985 Type* Typer::Visitor::TypeChangeInt32ToFloat64(Node* node) { |
1986 return Type::Intersect(Type::Signed32(), Type::UntaggedFloat64(), zone()); | 1986 return Type::Intersect(Type::Signed32(), Type::UntaggedFloat64(), zone()); |
1987 } | 1987 } |
1988 | 1988 |
1989 | 1989 |
1990 Type* Typer::Visitor::TypeChangeInt32ToInt64(Node* node) { | 1990 Type* Typer::Visitor::TypeChangeInt32ToInt64(Node* node) { |
(...skipping 10 matching lines...) Expand all Loading... |
2001 return Type::Internal(); | 2001 return Type::Internal(); |
2002 } | 2002 } |
2003 | 2003 |
2004 | 2004 |
2005 Type* Typer::Visitor::TypeTruncateFloat64ToFloat32(Node* node) { | 2005 Type* Typer::Visitor::TypeTruncateFloat64ToFloat32(Node* node) { |
2006 return Type::Intersect(Type::Number(), Type::UntaggedFloat32(), zone()); | 2006 return Type::Intersect(Type::Number(), Type::UntaggedFloat32(), zone()); |
2007 } | 2007 } |
2008 | 2008 |
2009 | 2009 |
2010 Type* Typer::Visitor::TypeTruncateFloat64ToInt32(Node* node) { | 2010 Type* Typer::Visitor::TypeTruncateFloat64ToInt32(Node* node) { |
2011 return Type::Intersect(Type::Signed32(), Type::UntaggedSigned32(), zone()); | 2011 return Type::Intersect(Type::Signed32(), Type::UntaggedIntegral32(), zone()); |
2012 } | 2012 } |
2013 | 2013 |
2014 | 2014 |
2015 Type* Typer::Visitor::TypeTruncateInt64ToInt32(Node* node) { | 2015 Type* Typer::Visitor::TypeTruncateInt64ToInt32(Node* node) { |
2016 return Type::Intersect(Type::Signed32(), Type::UntaggedSigned32(), zone()); | 2016 return Type::Intersect(Type::Signed32(), Type::UntaggedIntegral32(), zone()); |
2017 } | 2017 } |
2018 | 2018 |
2019 | 2019 |
2020 Type* Typer::Visitor::TypeRoundInt64ToFloat64(Node* node) { | 2020 Type* Typer::Visitor::TypeRoundInt64ToFloat64(Node* node) { |
2021 return Type::Intersect(Type::PlainNumber(), Type::UntaggedFloat64(), zone()); | 2021 return Type::Intersect(Type::PlainNumber(), Type::UntaggedFloat64(), zone()); |
2022 } | 2022 } |
2023 | 2023 |
2024 | 2024 |
2025 Type* Typer::Visitor::TypeBitcastFloat32ToInt32(Node* node) { | 2025 Type* Typer::Visitor::TypeBitcastFloat32ToInt32(Node* node) { |
2026 return Type::Number(); | 2026 return Type::Number(); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2197 } | 2197 } |
2198 if (Type::IsInteger(*value)) { | 2198 if (Type::IsInteger(*value)) { |
2199 return Type::Range(value->Number(), value->Number(), zone()); | 2199 return Type::Range(value->Number(), value->Number(), zone()); |
2200 } | 2200 } |
2201 return Type::Constant(value, zone()); | 2201 return Type::Constant(value, zone()); |
2202 } | 2202 } |
2203 | 2203 |
2204 } // namespace compiler | 2204 } // namespace compiler |
2205 } // namespace internal | 2205 } // namespace internal |
2206 } // namespace v8 | 2206 } // namespace v8 |
OLD | NEW |