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 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 case kArrayIndexOf: | 1408 case kArrayIndexOf: |
1409 case kArrayLastIndexOf: | 1409 case kArrayLastIndexOf: |
1410 return Type::Range(-1, kMaxSafeInteger, t->zone()); | 1410 return Type::Range(-1, kMaxSafeInteger, t->zone()); |
1411 case kArrayPush: | 1411 case kArrayPush: |
1412 return t->cache_.kPositiveSafeInteger; | 1412 return t->cache_.kPositiveSafeInteger; |
1413 | 1413 |
1414 // Object functions. | 1414 // Object functions. |
1415 case kObjectHasOwnProperty: | 1415 case kObjectHasOwnProperty: |
1416 return Type::Boolean(); | 1416 return Type::Boolean(); |
1417 | 1417 |
| 1418 // RegExp functions. |
| 1419 case kRegExpCompile: |
| 1420 return Type::OtherObject(); |
| 1421 case kRegExpExec: |
| 1422 return Type::Union(Type::OtherObject(), Type::Null(), t->zone()); |
| 1423 case kRegExpTest: |
| 1424 return Type::Boolean(); |
| 1425 case kRegExpToString: |
| 1426 return Type::String(); |
| 1427 |
1418 // Function functions. | 1428 // Function functions. |
1419 case kFunctionHasInstance: | 1429 case kFunctionHasInstance: |
1420 return Type::Boolean(); | 1430 return Type::Boolean(); |
1421 | 1431 |
1422 // Global functions. | 1432 // Global functions. |
1423 case kGlobalDecodeURI: | 1433 case kGlobalDecodeURI: |
1424 case kGlobalDecodeURIComponent: | 1434 case kGlobalDecodeURIComponent: |
1425 case kGlobalEncodeURI: | 1435 case kGlobalEncodeURI: |
1426 case kGlobalEncodeURIComponent: | 1436 case kGlobalEncodeURIComponent: |
1427 case kGlobalEscape: | 1437 case kGlobalEscape: |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { | 1775 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { |
1766 if (Type::IsInteger(*value)) { | 1776 if (Type::IsInteger(*value)) { |
1767 return Type::Range(value->Number(), value->Number(), zone()); | 1777 return Type::Range(value->Number(), value->Number(), zone()); |
1768 } | 1778 } |
1769 return Type::NewConstant(value, zone()); | 1779 return Type::NewConstant(value, zone()); |
1770 } | 1780 } |
1771 | 1781 |
1772 } // namespace compiler | 1782 } // namespace compiler |
1773 } // namespace internal | 1783 } // namespace internal |
1774 } // namespace v8 | 1784 } // namespace v8 |
OLD | NEW |