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/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
10 #include "src/compiler/graph-reducer.h" | 10 #include "src/compiler/graph-reducer.h" |
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1968 } | 1968 } |
1969 UNREACHABLE(); | 1969 UNREACHABLE(); |
1970 return nullptr; | 1970 return nullptr; |
1971 } | 1971 } |
1972 | 1972 |
1973 | 1973 |
1974 Type* Typer::Visitor::TypeLoadElement(Node* node) { | 1974 Type* Typer::Visitor::TypeLoadElement(Node* node) { |
1975 return ElementAccessOf(node->op()).type; | 1975 return ElementAccessOf(node->op()).type; |
1976 } | 1976 } |
1977 | 1977 |
| 1978 Type* Typer::Visitor::TypeLoadTypedElement(Node* node) { |
| 1979 switch (ExternalArrayTypeOf(node->op())) { |
| 1980 #define TYPED_ARRAY_CASE(ElemType, type, TYPE, ctype, size) \ |
| 1981 case kExternal##ElemType##Array: \ |
| 1982 return typer_->cache_.k##ElemType; |
| 1983 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
| 1984 #undef TYPED_ARRAY_CASE |
| 1985 } |
| 1986 UNREACHABLE(); |
| 1987 return nullptr; |
| 1988 } |
1978 | 1989 |
1979 Type* Typer::Visitor::TypeStoreField(Node* node) { | 1990 Type* Typer::Visitor::TypeStoreField(Node* node) { |
1980 UNREACHABLE(); | 1991 UNREACHABLE(); |
1981 return nullptr; | 1992 return nullptr; |
1982 } | 1993 } |
1983 | 1994 |
1984 | 1995 |
1985 Type* Typer::Visitor::TypeStoreBuffer(Node* node) { | 1996 Type* Typer::Visitor::TypeStoreBuffer(Node* node) { |
1986 UNREACHABLE(); | 1997 UNREACHABLE(); |
1987 return nullptr; | 1998 return nullptr; |
1988 } | 1999 } |
1989 | 2000 |
1990 | 2001 |
1991 Type* Typer::Visitor::TypeStoreElement(Node* node) { | 2002 Type* Typer::Visitor::TypeStoreElement(Node* node) { |
1992 UNREACHABLE(); | 2003 UNREACHABLE(); |
1993 return nullptr; | 2004 return nullptr; |
1994 } | 2005 } |
1995 | 2006 |
| 2007 Type* Typer::Visitor::TypeStoreTypedElement(Node* node) { |
| 2008 UNREACHABLE(); |
| 2009 return nullptr; |
| 2010 } |
| 2011 |
1996 Type* Typer::Visitor::TypeObjectIsCallable(Node* node) { | 2012 Type* Typer::Visitor::TypeObjectIsCallable(Node* node) { |
1997 return TypeUnaryOp(node, ObjectIsCallable); | 2013 return TypeUnaryOp(node, ObjectIsCallable); |
1998 } | 2014 } |
1999 | 2015 |
2000 Type* Typer::Visitor::TypeObjectIsNumber(Node* node) { | 2016 Type* Typer::Visitor::TypeObjectIsNumber(Node* node) { |
2001 return TypeUnaryOp(node, ObjectIsNumber); | 2017 return TypeUnaryOp(node, ObjectIsNumber); |
2002 } | 2018 } |
2003 | 2019 |
2004 | 2020 |
2005 Type* Typer::Visitor::TypeObjectIsReceiver(Node* node) { | 2021 Type* Typer::Visitor::TypeObjectIsReceiver(Node* node) { |
(...skipping 13 matching lines...) Expand all Loading... |
2019 return TypeUnaryOp(node, ObjectIsUndetectable); | 2035 return TypeUnaryOp(node, ObjectIsUndetectable); |
2020 } | 2036 } |
2021 | 2037 |
2022 | 2038 |
2023 // Machine operators. | 2039 // Machine operators. |
2024 | 2040 |
2025 Type* Typer::Visitor::TypeDebugBreak(Node* node) { return Type::None(); } | 2041 Type* Typer::Visitor::TypeDebugBreak(Node* node) { return Type::None(); } |
2026 | 2042 |
2027 Type* Typer::Visitor::TypeComment(Node* node) { return Type::None(); } | 2043 Type* Typer::Visitor::TypeComment(Node* node) { return Type::None(); } |
2028 | 2044 |
| 2045 Type* Typer::Visitor::TypeRetain(Node* node) { |
| 2046 UNREACHABLE(); |
| 2047 return nullptr; |
| 2048 } |
| 2049 |
| 2050 Type* Typer::Visitor::TypeUnsafePointerAdd(Node* node) { return Type::None(); } |
| 2051 |
2029 Type* Typer::Visitor::TypeLoad(Node* node) { return Type::Any(); } | 2052 Type* Typer::Visitor::TypeLoad(Node* node) { return Type::Any(); } |
2030 | 2053 |
2031 Type* Typer::Visitor::TypeStackSlot(Node* node) { return Type::Any(); } | 2054 Type* Typer::Visitor::TypeStackSlot(Node* node) { return Type::Any(); } |
2032 | 2055 |
2033 Type* Typer::Visitor::TypeStore(Node* node) { | 2056 Type* Typer::Visitor::TypeStore(Node* node) { |
2034 UNREACHABLE(); | 2057 UNREACHABLE(); |
2035 return nullptr; | 2058 return nullptr; |
2036 } | 2059 } |
2037 | 2060 |
2038 | 2061 |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2669 } | 2692 } |
2670 if (Type::IsInteger(*value)) { | 2693 if (Type::IsInteger(*value)) { |
2671 return Type::Range(value->Number(), value->Number(), zone()); | 2694 return Type::Range(value->Number(), value->Number(), zone()); |
2672 } | 2695 } |
2673 return Type::Constant(value, zone()); | 2696 return Type::Constant(value, zone()); |
2674 } | 2697 } |
2675 | 2698 |
2676 } // namespace compiler | 2699 } // namespace compiler |
2677 } // namespace internal | 2700 } // namespace internal |
2678 } // namespace v8 | 2701 } // namespace v8 |
OLD | NEW |