OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 case Token::SHL: | 597 case Token::SHL: |
598 case Token::SAR: | 598 case Token::SAR: |
599 RECURSE(Visit(expr->left())); | 599 RECURSE(Visit(expr->left())); |
600 RECURSE(Visit(expr->right())); | 600 RECURSE(Visit(expr->right())); |
601 NarrowType(expr, Bounds(Type::Smi(), Type::Signed32(), isolate_)); | 601 NarrowType(expr, Bounds(Type::Smi(), Type::Signed32(), isolate_)); |
602 break; | 602 break; |
603 case Token::SHR: | 603 case Token::SHR: |
604 RECURSE(Visit(expr->left())); | 604 RECURSE(Visit(expr->left())); |
605 RECURSE(Visit(expr->right())); | 605 RECURSE(Visit(expr->right())); |
606 // TODO(rossberg): we could use an UnsignedSmi as lower bound here... | 606 // TODO(rossberg): we could use an UnsignedSmi as lower bound here... |
607 NarrowType(expr, Bounds(Type::Unsigned32(), isolate_)); | 607 NarrowType(expr, Bounds(Type::Smi(), Type::Number(), isolate_)); |
608 break; | 608 break; |
609 case Token::ADD: { | 609 case Token::ADD: { |
610 RECURSE(Visit(expr->left())); | 610 RECURSE(Visit(expr->left())); |
611 RECURSE(Visit(expr->right())); | 611 RECURSE(Visit(expr->right())); |
612 Bounds l = expr->left()->bounds(); | 612 Bounds l = expr->left()->bounds(); |
613 Bounds r = expr->right()->bounds(); | 613 Bounds r = expr->right()->bounds(); |
614 Type* lower = | 614 Type* lower = |
615 l.lower->Is(Type::None()) || r.lower->Is(Type::None()) ? | 615 l.lower->Is(Type::None()) || r.lower->Is(Type::None()) ? |
616 Type::None() : | 616 Type::None() : |
617 l.lower->Is(Type::String()) || r.lower->Is(Type::String()) ? | 617 l.lower->Is(Type::String()) || r.lower->Is(Type::String()) ? |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 void AstTyper::VisitModuleUrl(ModuleUrl* module) { | 708 void AstTyper::VisitModuleUrl(ModuleUrl* module) { |
709 } | 709 } |
710 | 710 |
711 | 711 |
712 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { | 712 void AstTyper::VisitModuleStatement(ModuleStatement* stmt) { |
713 RECURSE(Visit(stmt->body())); | 713 RECURSE(Visit(stmt->body())); |
714 } | 714 } |
715 | 715 |
716 | 716 |
717 } } // namespace v8::internal | 717 } } // namespace v8::internal |
OLD | NEW |