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 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1350 case kStringToUpperCase: | 1350 case kStringToUpperCase: |
1351 return Type::String(); | 1351 return Type::String(); |
1352 | 1352 |
1353 case kStringIteratorNext: | 1353 case kStringIteratorNext: |
1354 return Type::OtherObject(); | 1354 return Type::OtherObject(); |
1355 | 1355 |
1356 // Array functions. | 1356 // Array functions. |
1357 case kArrayIndexOf: | 1357 case kArrayIndexOf: |
1358 case kArrayLastIndexOf: | 1358 case kArrayLastIndexOf: |
1359 return Type::Range(-1, kMaxSafeInteger, t->zone()); | 1359 return Type::Range(-1, kMaxSafeInteger, t->zone()); |
| 1360 case kArrayPush: |
| 1361 return t->cache_.kPositiveSafeInteger; |
1360 // Object functions. | 1362 // Object functions. |
1361 case kObjectHasOwnProperty: | 1363 case kObjectHasOwnProperty: |
1362 return Type::Boolean(); | 1364 return Type::Boolean(); |
1363 // Global functions. | 1365 // Global functions. |
1364 case kGlobalDecodeURI: | 1366 case kGlobalDecodeURI: |
1365 case kGlobalDecodeURIComponent: | 1367 case kGlobalDecodeURIComponent: |
1366 case kGlobalEncodeURI: | 1368 case kGlobalEncodeURI: |
1367 case kGlobalEncodeURIComponent: | 1369 case kGlobalEncodeURIComponent: |
1368 case kGlobalEscape: | 1370 case kGlobalEscape: |
1369 case kGlobalUnescape: | 1371 case kGlobalUnescape: |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1703 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { | 1705 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { |
1704 if (Type::IsInteger(*value)) { | 1706 if (Type::IsInteger(*value)) { |
1705 return Type::Range(value->Number(), value->Number(), zone()); | 1707 return Type::Range(value->Number(), value->Number(), zone()); |
1706 } | 1708 } |
1707 return Type::NewConstant(value, zone()); | 1709 return Type::NewConstant(value, zone()); |
1708 } | 1710 } |
1709 | 1711 |
1710 } // namespace compiler | 1712 } // namespace compiler |
1711 } // namespace internal | 1713 } // namespace internal |
1712 } // namespace v8 | 1714 } // namespace v8 |
OLD | NEW |