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 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 case kDateGetSeconds: | 1355 case kDateGetSeconds: |
1356 return t->cache_.kJSDateSecondType; | 1356 return t->cache_.kJSDateSecondType; |
1357 case kDateGetTime: | 1357 case kDateGetTime: |
1358 return t->cache_.kJSDateValueType; | 1358 return t->cache_.kJSDateValueType; |
1359 // Number functions. | 1359 // Number functions. |
1360 case kNumberIsFinite: | 1360 case kNumberIsFinite: |
1361 case kNumberIsInteger: | 1361 case kNumberIsInteger: |
1362 case kNumberIsNaN: | 1362 case kNumberIsNaN: |
1363 case kNumberIsSafeInteger: | 1363 case kNumberIsSafeInteger: |
1364 return Type::Boolean(); | 1364 return Type::Boolean(); |
| 1365 case kNumberParseFloat: |
| 1366 return Type::Number(); |
1365 case kNumberParseInt: | 1367 case kNumberParseInt: |
1366 return t->cache_.kIntegerOrMinusZeroOrNaN; | 1368 return t->cache_.kIntegerOrMinusZeroOrNaN; |
1367 case kNumberToString: | 1369 case kNumberToString: |
1368 return Type::String(); | 1370 return Type::String(); |
1369 // String functions. | 1371 // String functions. |
1370 case kStringCharCodeAt: | 1372 case kStringCharCodeAt: |
1371 return Type::Union(Type::Range(0, kMaxUInt16, t->zone()), Type::NaN(), | 1373 return Type::Union(Type::Range(0, kMaxUInt16, t->zone()), Type::NaN(), |
1372 t->zone()); | 1374 t->zone()); |
1373 case kStringCharAt: | 1375 case kStringCharAt: |
1374 case kStringConcat: | 1376 case kStringConcat: |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1749 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { | 1751 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { |
1750 if (Type::IsInteger(*value)) { | 1752 if (Type::IsInteger(*value)) { |
1751 return Type::Range(value->Number(), value->Number(), zone()); | 1753 return Type::Range(value->Number(), value->Number(), zone()); |
1752 } | 1754 } |
1753 return Type::NewConstant(value, zone()); | 1755 return Type::NewConstant(value, zone()); |
1754 } | 1756 } |
1755 | 1757 |
1756 } // namespace compiler | 1758 } // namespace compiler |
1757 } // namespace internal | 1759 } // namespace internal |
1758 } // namespace v8 | 1760 } // namespace v8 |
OLD | NEW |