635
636 _zero_type[T_NARROWOOP] = TypeNarrowOop::NULL_PTR;
637 _zero_type[T_NARROWKLASS] = TypeNarrowKlass::NULL_PTR;
638 _zero_type[T_BOOLEAN] = TypeInt::ZERO; // false == 0
639 _zero_type[T_CHAR] = TypeInt::ZERO; // '\0' == 0
640 _zero_type[T_BYTE] = TypeInt::ZERO; // 0x00 == 0
641 _zero_type[T_SHORT] = TypeInt::ZERO; // 0x0000 == 0
642 _zero_type[T_INT] = TypeInt::ZERO;
643 _zero_type[T_LONG] = TypeLong::ZERO;
644 _zero_type[T_FLOAT] = TypeF::ZERO;
645 _zero_type[T_DOUBLE] = TypeD::ZERO;
646 _zero_type[T_OBJECT] = TypePtr::NULL_PTR;
647 _zero_type[T_ARRAY] = TypePtr::NULL_PTR; // null array is null oop
648 _zero_type[T_ADDRESS] = TypePtr::NULL_PTR; // raw pointers use the same null
649 _zero_type[T_VOID] = Type::TOP; // the only void value is no value at all
650
651 // get_zero_type() should not happen for T_CONFLICT
652 _zero_type[T_CONFLICT]= NULL;
653
654 // Vector predefined types, it needs initialized _const_basic_type[].
655 if (Matcher::vector_size_supported(T_BYTE,4)) {
656 TypeVect::VECTS = TypeVect::make(T_BYTE,4);
657 }
658 if (Matcher::vector_size_supported(T_FLOAT,2)) {
659 TypeVect::VECTD = TypeVect::make(T_FLOAT,2);
660 }
661 if (Matcher::vector_size_supported(T_FLOAT,4)) {
662 TypeVect::VECTX = TypeVect::make(T_FLOAT,4);
663 }
664 if (Matcher::vector_size_supported(T_FLOAT,8)) {
665 TypeVect::VECTY = TypeVect::make(T_FLOAT,8);
666 }
667 if (Matcher::vector_size_supported(T_FLOAT,16)) {
668 TypeVect::VECTZ = TypeVect::make(T_FLOAT,16);
669 }
670 mreg2type[Op_VecS] = TypeVect::VECTS;
671 mreg2type[Op_VecD] = TypeVect::VECTD;
672 mreg2type[Op_VecX] = TypeVect::VECTX;
673 mreg2type[Op_VecY] = TypeVect::VECTY;
674 mreg2type[Op_VecZ] = TypeVect::VECTZ;
675
676 // Restore working type arena.
677 current->set_type_arena(save);
678 current->set_type_dict(NULL);
679 }
680
681 //------------------------------Initialize-------------------------------------
682 void Type::Initialize(Compile* current) {
683 assert(current->type_arena() != NULL, "must have created type arena");
684
685 if (_shared_type_dict == NULL) {
686 Initialize_shared(current);
687 }
|
635
636 _zero_type[T_NARROWOOP] = TypeNarrowOop::NULL_PTR;
637 _zero_type[T_NARROWKLASS] = TypeNarrowKlass::NULL_PTR;
638 _zero_type[T_BOOLEAN] = TypeInt::ZERO; // false == 0
639 _zero_type[T_CHAR] = TypeInt::ZERO; // '\0' == 0
640 _zero_type[T_BYTE] = TypeInt::ZERO; // 0x00 == 0
641 _zero_type[T_SHORT] = TypeInt::ZERO; // 0x0000 == 0
642 _zero_type[T_INT] = TypeInt::ZERO;
643 _zero_type[T_LONG] = TypeLong::ZERO;
644 _zero_type[T_FLOAT] = TypeF::ZERO;
645 _zero_type[T_DOUBLE] = TypeD::ZERO;
646 _zero_type[T_OBJECT] = TypePtr::NULL_PTR;
647 _zero_type[T_ARRAY] = TypePtr::NULL_PTR; // null array is null oop
648 _zero_type[T_ADDRESS] = TypePtr::NULL_PTR; // raw pointers use the same null
649 _zero_type[T_VOID] = Type::TOP; // the only void value is no value at all
650
651 // get_zero_type() should not happen for T_CONFLICT
652 _zero_type[T_CONFLICT]= NULL;
653
654 // Vector predefined types, it needs initialized _const_basic_type[].
655 TypeVect::VECTS = TypeVect::make(T_BYTE,4);
656 TypeVect::VECTD = TypeVect::make(T_FLOAT,2);
657 if (UseSSE >= 1) { // SSE
658 TypeVect::VECTX = TypeVect::make(T_FLOAT,4);
659 }
660 if (UseAVX >= 1) { // AVX + AVX2
661 TypeVect::VECTY = TypeVect::make(T_FLOAT,8);
662 }
663 if (UseAVX >= 3) { // AVX_512
664 TypeVect::VECTZ = TypeVect::make(T_FLOAT,16);
665 }
666 mreg2type[Op_VecS] = TypeVect::VECTS;
667 mreg2type[Op_VecD] = TypeVect::VECTD;
668 mreg2type[Op_VecX] = TypeVect::VECTX;
669 mreg2type[Op_VecY] = TypeVect::VECTY;
670 mreg2type[Op_VecZ] = TypeVect::VECTZ;
671
672 // Restore working type arena.
673 current->set_type_arena(save);
674 current->set_type_dict(NULL);
675 }
676
677 //------------------------------Initialize-------------------------------------
678 void Type::Initialize(Compile* current) {
679 assert(current->type_arena() != NULL, "must have created type arena");
680
681 if (_shared_type_dict == NULL) {
682 Initialize_shared(current);
683 }
|