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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 | 401 |
402 | 402 |
403 Type* Typer::Visitor::FalsifyUndefined(Type* type, Typer* t) { | 403 Type* Typer::Visitor::FalsifyUndefined(Type* type, Typer* t) { |
404 if (type->Is(Type::Undefined())) return t->singleton_false; | 404 if (type->Is(Type::Undefined())) return t->singleton_false; |
405 return type; | 405 return type; |
406 } | 406 } |
407 | 407 |
408 | 408 |
409 Type* Typer::Visitor::Rangify(Type* type, Typer* t) { | 409 Type* Typer::Visitor::Rangify(Type* type, Typer* t) { |
410 if (type->IsRange()) return type; // Shortcut. | 410 if (type->IsRange()) return type; // Shortcut. |
411 if (!type->Is(t->integer)) return type; // Give up. | 411 if (!type->Is(t->integer) && !type->Is(Type::Integral32())) { |
| 412 return type; // Give up. |
| 413 } |
412 Factory* f = t->isolate()->factory(); | 414 Factory* f = t->isolate()->factory(); |
413 return Type::Range(f->NewNumber(type->Min()), f->NewNumber(type->Max()), | 415 return Type::Range(f->NewNumber(type->Min()), f->NewNumber(type->Max()), |
414 t->zone()); | 416 t->zone()); |
415 } | 417 } |
416 | 418 |
417 | 419 |
418 // Type conversion. | 420 // Type conversion. |
419 | 421 |
420 | 422 |
421 Type* Typer::Visitor::ToPrimitive(Type* type, Typer* t) { | 423 Type* Typer::Visitor::ToPrimitive(Type* type, Typer* t) { |
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1882 return typer_->float64_array_fun_; | 1884 return typer_->float64_array_fun_; |
1883 } | 1885 } |
1884 } | 1886 } |
1885 } | 1887 } |
1886 return Type::Constant(value, zone()); | 1888 return Type::Constant(value, zone()); |
1887 } | 1889 } |
1888 | 1890 |
1889 } | 1891 } |
1890 } | 1892 } |
1891 } // namespace v8::internal::compiler | 1893 } // namespace v8::internal::compiler |
OLD | NEW |