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 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1498 return Type::Receiver(); | 1498 return Type::Receiver(); |
1499 case kArrayUnshift: | 1499 case kArrayUnshift: |
1500 return t->cache_.kPositiveSafeInteger; | 1500 return t->cache_.kPositiveSafeInteger; |
1501 | 1501 |
1502 // Object functions. | 1502 // Object functions. |
1503 case kObjectAssign: | 1503 case kObjectAssign: |
1504 case kObjectCreate: | 1504 case kObjectCreate: |
1505 return Type::OtherObject(); | 1505 return Type::OtherObject(); |
1506 case kObjectHasOwnProperty: | 1506 case kObjectHasOwnProperty: |
1507 return Type::Boolean(); | 1507 return Type::Boolean(); |
| 1508 case kObjectToString: |
| 1509 return Type::String(); |
1508 | 1510 |
1509 // RegExp functions. | 1511 // RegExp functions. |
1510 case kRegExpCompile: | 1512 case kRegExpCompile: |
1511 return Type::OtherObject(); | 1513 return Type::OtherObject(); |
1512 case kRegExpExec: | 1514 case kRegExpExec: |
1513 return Type::Union(Type::OtherObject(), Type::Null(), t->zone()); | 1515 return Type::Union(Type::OtherObject(), Type::Null(), t->zone()); |
1514 case kRegExpTest: | 1516 case kRegExpTest: |
1515 return Type::Boolean(); | 1517 return Type::Boolean(); |
1516 case kRegExpToString: | 1518 case kRegExpToString: |
1517 return Type::String(); | 1519 return Type::String(); |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1938 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { | 1940 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { |
1939 if (Type::IsInteger(*value)) { | 1941 if (Type::IsInteger(*value)) { |
1940 return Type::Range(value->Number(), value->Number(), zone()); | 1942 return Type::Range(value->Number(), value->Number(), zone()); |
1941 } | 1943 } |
1942 return Type::NewConstant(value, zone()); | 1944 return Type::NewConstant(value, zone()); |
1943 } | 1945 } |
1944 | 1946 |
1945 } // namespace compiler | 1947 } // namespace compiler |
1946 } // namespace internal | 1948 } // namespace internal |
1947 } // namespace v8 | 1949 } // namespace v8 |
OLD | NEW |