| 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/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
| 6 #include "src/compiler/graph-inl.h" | 6 #include "src/compiler/graph-inl.h" |
| 7 #include "src/compiler/js-operator.h" | 7 #include "src/compiler/js-operator.h" |
| 8 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
| 9 #include "src/compiler/node-properties-inl.h" | 9 #include "src/compiler/node-properties-inl.h" |
| 10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 Type* Typer::Visitor::ToString(Type* type, Typer* t) { | 460 Type* Typer::Visitor::ToString(Type* type, Typer* t) { |
| 461 if (type->Is(Type::String())) return type; | 461 if (type->Is(Type::String())) return type; |
| 462 return Type::String(); | 462 return Type::String(); |
| 463 } | 463 } |
| 464 | 464 |
| 465 | 465 |
| 466 Type* Typer::Visitor::NumberToInt32(Type* type, Typer* t) { | 466 Type* Typer::Visitor::NumberToInt32(Type* type, Typer* t) { |
| 467 // TODO(neis): DCHECK(type->Is(Type::Number())); | 467 // TODO(neis): DCHECK(type->Is(Type::Number())); |
| 468 if (type->Is(Type::Signed32())) return type; | 468 if (type->Is(Type::Signed32())) return type; |
| 469 if (type->Is(t->zeroish)) return t->singleton_zero; | 469 if (type->Is(t->zeroish)) return t->singleton_zero; |
| 470 if (type->Is(Type::Union(Type::MinusZero(), Type::Signed32(), t->zone()))) { |
| 471 return Type::Intersect(Type::Union(type, t->singleton_zero, t->zone()), |
| 472 Type::Signed32(), t->zone()); |
| 473 } |
| 470 return Type::Signed32(); | 474 return Type::Signed32(); |
| 471 } | 475 } |
| 472 | 476 |
| 473 | 477 |
| 474 Type* Typer::Visitor::NumberToUint32(Type* type, Typer* t) { | 478 Type* Typer::Visitor::NumberToUint32(Type* type, Typer* t) { |
| 475 // TODO(neis): DCHECK(type->Is(Type::Number())); | 479 // TODO(neis): DCHECK(type->Is(Type::Number())); |
| 476 if (type->Is(Type::Unsigned32())) return type; | 480 if (type->Is(Type::Unsigned32())) return type; |
| 477 if (type->Is(t->zeroish)) return t->singleton_zero; | 481 if (type->Is(t->zeroish)) return t->singleton_zero; |
| 478 return Type::Unsigned32(); | 482 return Type::Unsigned32(); |
| 479 } | 483 } |
| (...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1960 return typer_->float64_array_fun_; | 1964 return typer_->float64_array_fun_; |
| 1961 } | 1965 } |
| 1962 } | 1966 } |
| 1963 } | 1967 } |
| 1964 return Type::Constant(value, zone()); | 1968 return Type::Constant(value, zone()); |
| 1965 } | 1969 } |
| 1966 | 1970 |
| 1967 } | 1971 } |
| 1968 } | 1972 } |
| 1969 } // namespace v8::internal::compiler | 1973 } // namespace v8::internal::compiler |
| OLD | NEW |