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 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1328 // Binary math functions. | 1328 // Binary math functions. |
1329 case kMathAtan2: | 1329 case kMathAtan2: |
1330 case kMathPow: | 1330 case kMathPow: |
1331 case kMathMax: | 1331 case kMathMax: |
1332 case kMathMin: | 1332 case kMathMin: |
1333 return Type::Number(); | 1333 return Type::Number(); |
1334 case kMathImul: | 1334 case kMathImul: |
1335 return Type::Signed32(); | 1335 return Type::Signed32(); |
1336 case kMathClz32: | 1336 case kMathClz32: |
1337 return t->cache_.kZeroToThirtyTwo; | 1337 return t->cache_.kZeroToThirtyTwo; |
| 1338 // Date functions. |
| 1339 case kDateGetFullYear: |
| 1340 return Type::Union(Type::Range(-271821.0, 275760.0, t->zone()), |
| 1341 Type::NaN(), t->zone()); |
| 1342 case kDateGetDate: |
| 1343 return Type::Union(Type::Range(1.0, 31.0, t->zone()), Type::NaN(), |
| 1344 t->zone()); |
| 1345 case kDateGetHours: |
| 1346 return Type::Union(Type::Range(0.0, 23.0, t->zone()), Type::NaN(), |
| 1347 t->zone()); |
| 1348 case kDateGetMilliseconds: |
| 1349 return Type::Union(Type::Range(0.0, 59.0, t->zone()), Type::NaN(), |
| 1350 t->zone()); |
| 1351 case kDateGetMonth: |
| 1352 return Type::Union(Type::Range(0.0, 11.0, t->zone()), Type::NaN(), |
| 1353 t->zone()); |
| 1354 case kDateGetSeconds: |
| 1355 return Type::Union(Type::Range(0.0, 59.0, t->zone()), Type::NaN(), |
| 1356 t->zone()); |
| 1357 case kDateGetTime: |
| 1358 return t->cache_.kJSDateValueType; |
1338 // Number functions. | 1359 // Number functions. |
1339 case kNumberParseInt: | 1360 case kNumberParseInt: |
1340 return t->cache_.kIntegerOrMinusZeroOrNaN; | 1361 return t->cache_.kIntegerOrMinusZeroOrNaN; |
1341 case kNumberToString: | 1362 case kNumberToString: |
1342 return Type::String(); | 1363 return Type::String(); |
1343 // String functions. | 1364 // String functions. |
1344 case kStringCharCodeAt: | 1365 case kStringCharCodeAt: |
1345 return Type::Union(Type::Range(0, kMaxUInt16, t->zone()), Type::NaN(), | 1366 return Type::Union(Type::Range(0, kMaxUInt16, t->zone()), Type::NaN(), |
1346 t->zone()); | 1367 t->zone()); |
1347 case kStringCharAt: | 1368 case kStringCharAt: |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1700 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { | 1721 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { |
1701 if (Type::IsInteger(*value)) { | 1722 if (Type::IsInteger(*value)) { |
1702 return Type::Range(value->Number(), value->Number(), zone()); | 1723 return Type::Range(value->Number(), value->Number(), zone()); |
1703 } | 1724 } |
1704 return Type::Constant(value, zone()); | 1725 return Type::Constant(value, zone()); |
1705 } | 1726 } |
1706 | 1727 |
1707 } // namespace compiler | 1728 } // namespace compiler |
1708 } // namespace internal | 1729 } // namespace internal |
1709 } // namespace v8 | 1730 } // namespace v8 |
OLD | NEW |