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 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 return Type::Union(Type::Range(0, kMaxUInt16, t->zone()), Type::NaN(), | 1343 return Type::Union(Type::Range(0, kMaxUInt16, t->zone()), Type::NaN(), |
1344 t->zone()); | 1344 t->zone()); |
1345 case kStringCharAt: | 1345 case kStringCharAt: |
1346 case kStringConcat: | 1346 case kStringConcat: |
1347 case kStringFromCharCode: | 1347 case kStringFromCharCode: |
1348 case kStringSubstr: | 1348 case kStringSubstr: |
1349 case kStringToLowerCase: | 1349 case kStringToLowerCase: |
1350 case kStringToUpperCase: | 1350 case kStringToUpperCase: |
1351 return Type::String(); | 1351 return Type::String(); |
1352 | 1352 |
| 1353 case kStringIterator: |
1353 case kStringIteratorNext: | 1354 case kStringIteratorNext: |
1354 return Type::OtherObject(); | 1355 return Type::OtherObject(); |
1355 | 1356 |
1356 // Array functions. | 1357 // Array functions. |
1357 case kArrayIndexOf: | 1358 case kArrayIndexOf: |
1358 case kArrayLastIndexOf: | 1359 case kArrayLastIndexOf: |
1359 return Type::Range(-1, kMaxSafeInteger, t->zone()); | 1360 return Type::Range(-1, kMaxSafeInteger, t->zone()); |
1360 // Object functions. | 1361 // Object functions. |
1361 case kObjectHasOwnProperty: | 1362 case kObjectHasOwnProperty: |
1362 return Type::Boolean(); | 1363 return Type::Boolean(); |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1703 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { | 1704 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { |
1704 if (Type::IsInteger(*value)) { | 1705 if (Type::IsInteger(*value)) { |
1705 return Type::Range(value->Number(), value->Number(), zone()); | 1706 return Type::Range(value->Number(), value->Number(), zone()); |
1706 } | 1707 } |
1707 return Type::NewConstant(value, zone()); | 1708 return Type::NewConstant(value, zone()); |
1708 } | 1709 } |
1709 | 1710 |
1710 } // namespace compiler | 1711 } // namespace compiler |
1711 } // namespace internal | 1712 } // namespace internal |
1712 } // namespace v8 | 1713 } // namespace v8 |
OLD | NEW |