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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 UNREACHABLE(); | 591 UNREACHABLE(); |
592 return nullptr; | 592 return nullptr; |
593 } | 593 } |
594 | 594 |
595 Type* Typer::Visitor::TypeRetain(Node* node) { | 595 Type* Typer::Visitor::TypeRetain(Node* node) { |
596 UNREACHABLE(); | 596 UNREACHABLE(); |
597 return nullptr; | 597 return nullptr; |
598 } | 598 } |
599 | 599 |
600 Type* Typer::Visitor::TypeInt32Constant(Node* node) { | 600 Type* Typer::Visitor::TypeInt32Constant(Node* node) { |
601 double number = OpParameter<int32_t>(node); | 601 UNREACHABLE(); |
602 return Type::Intersect(Type::Range(number, number, zone()), | 602 return nullptr; |
603 Type::Integral32(), zone()); | |
604 } | 603 } |
605 | 604 |
606 | |
607 Type* Typer::Visitor::TypeInt64Constant(Node* node) { | 605 Type* Typer::Visitor::TypeInt64Constant(Node* node) { |
608 // TODO(rossberg): This actually seems to be a PointerConstant so far... | 606 UNREACHABLE(); |
609 return Type::Internal(); // TODO(rossberg): Add int64 bitset type? | 607 return nullptr; |
610 } | 608 } |
611 | 609 |
612 Type* Typer::Visitor::TypeRelocatableInt32Constant(Node* node) { | 610 Type* Typer::Visitor::TypeRelocatableInt32Constant(Node* node) { |
613 UNREACHABLE(); | 611 UNREACHABLE(); |
614 return nullptr; | 612 return nullptr; |
615 } | 613 } |
616 | 614 |
617 Type* Typer::Visitor::TypeRelocatableInt64Constant(Node* node) { | 615 Type* Typer::Visitor::TypeRelocatableInt64Constant(Node* node) { |
618 UNREACHABLE(); | 616 UNREACHABLE(); |
619 return nullptr; | 617 return nullptr; |
620 } | 618 } |
621 | 619 |
622 Type* Typer::Visitor::TypeFloat32Constant(Node* node) { | 620 Type* Typer::Visitor::TypeFloat32Constant(Node* node) { |
623 UNREACHABLE(); | 621 UNREACHABLE(); |
624 return nullptr; | 622 return nullptr; |
625 } | 623 } |
626 | 624 |
627 | |
628 Type* Typer::Visitor::TypeFloat64Constant(Node* node) { | 625 Type* Typer::Visitor::TypeFloat64Constant(Node* node) { |
629 UNREACHABLE(); | 626 UNREACHABLE(); |
630 return nullptr; | 627 return nullptr; |
631 } | 628 } |
632 | 629 |
633 | |
634 Type* Typer::Visitor::TypeNumberConstant(Node* node) { | 630 Type* Typer::Visitor::TypeNumberConstant(Node* node) { |
635 double number = OpParameter<double>(node); | 631 double number = OpParameter<double>(node); |
636 return Type::NewConstant(number, zone()); | 632 return Type::NewConstant(number, zone()); |
637 } | 633 } |
638 | 634 |
639 Type* Typer::Visitor::TypeHeapConstant(Node* node) { | 635 Type* Typer::Visitor::TypeHeapConstant(Node* node) { |
640 return TypeConstant(OpParameter<Handle<HeapObject>>(node)); | 636 return TypeConstant(OpParameter<Handle<HeapObject>>(node)); |
641 } | 637 } |
642 | 638 |
643 | |
644 Type* Typer::Visitor::TypeExternalConstant(Node* node) { | 639 Type* Typer::Visitor::TypeExternalConstant(Node* node) { |
645 return Type::Internal(); | 640 return Type::ExternalPointer(); |
646 } | 641 } |
647 | 642 |
| 643 Type* Typer::Visitor::TypePointerConstant(Node* node) { |
| 644 return Type::ExternalPointer(); |
| 645 } |
648 | 646 |
649 Type* Typer::Visitor::TypeSelect(Node* node) { | 647 Type* Typer::Visitor::TypeSelect(Node* node) { |
650 return Type::Union(Operand(node, 1), Operand(node, 2), zone()); | 648 return Type::Union(Operand(node, 1), Operand(node, 2), zone()); |
651 } | 649 } |
652 | 650 |
653 Type* Typer::Visitor::TypePhi(Node* node) { | 651 Type* Typer::Visitor::TypePhi(Node* node) { |
654 int arity = node->op()->ValueInputCount(); | 652 int arity = node->op()->ValueInputCount(); |
655 Type* type = Operand(node, 0); | 653 Type* type = Operand(node, 0); |
656 for (int i = 1; i < arity; ++i) { | 654 for (int i = 1; i < arity; ++i) { |
657 type = Type::Union(type, Operand(node, i), zone()); | 655 type = Type::Union(type, Operand(node, i), zone()); |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1741 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { | 1739 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { |
1742 if (Type::IsInteger(*value)) { | 1740 if (Type::IsInteger(*value)) { |
1743 return Type::Range(value->Number(), value->Number(), zone()); | 1741 return Type::Range(value->Number(), value->Number(), zone()); |
1744 } | 1742 } |
1745 return Type::NewConstant(value, zone()); | 1743 return Type::NewConstant(value, zone()); |
1746 } | 1744 } |
1747 | 1745 |
1748 } // namespace compiler | 1746 } // namespace compiler |
1749 } // namespace internal | 1747 } // namespace internal |
1750 } // namespace v8 | 1748 } // namespace v8 |
OLD | NEW |