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 <iomanip> | 7 #include <iomanip> |
8 | 8 |
9 #include "src/base/flags.h" | 9 #include "src/base/flags.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 return TypeUnaryOp(node, ToString); | 1109 return TypeUnaryOp(node, ToString); |
1110 } | 1110 } |
1111 | 1111 |
1112 // JS object operators. | 1112 // JS object operators. |
1113 | 1113 |
1114 | 1114 |
1115 Type* Typer::Visitor::TypeJSCreate(Node* node) { return Type::Object(); } | 1115 Type* Typer::Visitor::TypeJSCreate(Node* node) { return Type::Object(); } |
1116 | 1116 |
1117 | 1117 |
1118 Type* Typer::Visitor::TypeJSCreateArguments(Node* node) { | 1118 Type* Typer::Visitor::TypeJSCreateArguments(Node* node) { |
1119 return Type::OtherObject(); | 1119 switch (CreateArgumentsTypeOf(node->op())) { |
| 1120 case CreateArgumentsType::kRestParameter: |
| 1121 return Type::Array(); |
| 1122 case CreateArgumentsType::kMappedArguments: |
| 1123 case CreateArgumentsType::kUnmappedArguments: |
| 1124 return Type::OtherObject(); |
| 1125 } |
| 1126 UNREACHABLE(); |
| 1127 return nullptr; |
1120 } | 1128 } |
1121 | 1129 |
1122 Type* Typer::Visitor::TypeJSCreateArray(Node* node) { return Type::Array(); } | 1130 Type* Typer::Visitor::TypeJSCreateArray(Node* node) { return Type::Array(); } |
1123 | 1131 |
1124 Type* Typer::Visitor::TypeJSCreateClosure(Node* node) { | 1132 Type* Typer::Visitor::TypeJSCreateClosure(Node* node) { |
1125 return Type::Function(); | 1133 return Type::Function(); |
1126 } | 1134 } |
1127 | 1135 |
1128 | 1136 |
1129 Type* Typer::Visitor::TypeJSCreateIterResultObject(Node* node) { | 1137 Type* Typer::Visitor::TypeJSCreateIterResultObject(Node* node) { |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1995 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { | 2003 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { |
1996 if (Type::IsInteger(*value)) { | 2004 if (Type::IsInteger(*value)) { |
1997 return Type::Range(value->Number(), value->Number(), zone()); | 2005 return Type::Range(value->Number(), value->Number(), zone()); |
1998 } | 2006 } |
1999 return Type::NewConstant(value, zone()); | 2007 return Type::NewConstant(value, zone()); |
2000 } | 2008 } |
2001 | 2009 |
2002 } // namespace compiler | 2010 } // namespace compiler |
2003 } // namespace internal | 2011 } // namespace internal |
2004 } // namespace v8 | 2012 } // namespace v8 |
OLD | NEW |