32 #include "memory/oopFactory.hpp"
33 #include "memory/resourceArea.hpp"
34 #include "oops/instanceKlass.hpp"
35 #include "oops/instanceMirrorKlass.hpp"
36 #include "oops/objArrayKlass.hpp"
37 #include "oops/typeArrayKlass.hpp"
38 #include "opto/arraycopynode.hpp"
39 #include "opto/callnode.hpp"
40 #include "opto/matcher.hpp"
41 #include "opto/node.hpp"
42 #include "opto/opcodes.hpp"
43 #include "opto/rangeinference.hpp"
44 #include "opto/runtime.hpp"
45 #include "opto/type.hpp"
46 #include "runtime/stubRoutines.hpp"
47 #include "utilities/checkedCast.hpp"
48 #include "utilities/debug.hpp"
49 #include "utilities/ostream.hpp"
50 #include "utilities/powerOfTwo.hpp"
51 #include "utilities/stringUtils.hpp"
52 #if INCLUDE_SHENANDOAHGC
53 #include "gc/shenandoah/c2/shenandoahBarrierSetC2.hpp"
54 #endif // INCLUDE_SHENANDOAHGC
55
56 // Portions of code courtesy of Clifford Click
57
58 // Optimization - Graph Style
59
60 // Dictionary of types shared among compilations.
61 Dict* Type::_shared_type_dict = nullptr;
62
63 // Array which maps compiler types to Basic Types
64 const Type::TypeInfo Type::_type_info[Type::lastype] = {
65 { Bad, T_ILLEGAL, "bad", false, Node::NotAMachineReg, relocInfo::none }, // Bad
66 { Control, T_ILLEGAL, "control", false, 0, relocInfo::none }, // Control
67 { Bottom, T_VOID, "top", false, 0, relocInfo::none }, // Top
68 { Bad, T_INT, "int:", false, Op_RegI, relocInfo::none }, // Int
69 { Bad, T_LONG, "long:", false, Op_RegL, relocInfo::none }, // Long
70 { Half, T_VOID, "half", false, 0, relocInfo::none }, // Half
71 { Bad, T_NARROWOOP, "narrowoop:", false, Op_RegN, relocInfo::none }, // NarrowOop
72 { Bad, T_NARROWKLASS,"narrowklass:", false, Op_RegN, relocInfo::none }, // NarrowKlass
73 { Bad, T_ILLEGAL, "tuple:", false, Node::NotAMachineReg, relocInfo::none }, // Tuple
74 { Bad, T_ARRAY, "array:", false, Node::NotAMachineReg, relocInfo::none }, // Array
718 if (Matcher::vector_size_supported(T_FLOAT, 2)) {
719 TypeVect::VECTD = TypeVect::make(T_FLOAT, 2);
720 }
721 if (Matcher::vector_size_supported(T_FLOAT, 4)) {
722 TypeVect::VECTX = TypeVect::make(T_FLOAT, 4);
723 }
724 if (Matcher::vector_size_supported(T_FLOAT, 8)) {
725 TypeVect::VECTY = TypeVect::make(T_FLOAT, 8);
726 }
727 if (Matcher::vector_size_supported(T_FLOAT, 16)) {
728 TypeVect::VECTZ = TypeVect::make(T_FLOAT, 16);
729 }
730
731 mreg2type[Op_VecA] = TypeVect::VECTA;
732 mreg2type[Op_VecS] = TypeVect::VECTS;
733 mreg2type[Op_VecD] = TypeVect::VECTD;
734 mreg2type[Op_VecX] = TypeVect::VECTX;
735 mreg2type[Op_VecY] = TypeVect::VECTY;
736 mreg2type[Op_VecZ] = TypeVect::VECTZ;
737
738 #if INCLUDE_SHENANDOAHGC
739 ShenandoahBarrierSetC2::init();
740 #endif //INCLUDE_SHENANDOAHGC
741
742 BarrierSetC2::make_clone_type();
743 LockNode::initialize_lock_Type();
744 ArrayCopyNode::initialize_arraycopy_Type();
745 OptoRuntime::initialize_types();
746
747 // Restore working type arena.
748 current->set_type_arena(save);
749 current->set_type_dict(nullptr);
750 }
751
752 //------------------------------Initialize-------------------------------------
753 void Type::Initialize(Compile* current) {
754 assert(current->type_arena() != nullptr, "must have created type arena");
755
756 if (_shared_type_dict == nullptr) {
757 Initialize_shared(current);
758 }
759
760 Arena* type_arena = current->type_arena();
761
|
32 #include "memory/oopFactory.hpp"
33 #include "memory/resourceArea.hpp"
34 #include "oops/instanceKlass.hpp"
35 #include "oops/instanceMirrorKlass.hpp"
36 #include "oops/objArrayKlass.hpp"
37 #include "oops/typeArrayKlass.hpp"
38 #include "opto/arraycopynode.hpp"
39 #include "opto/callnode.hpp"
40 #include "opto/matcher.hpp"
41 #include "opto/node.hpp"
42 #include "opto/opcodes.hpp"
43 #include "opto/rangeinference.hpp"
44 #include "opto/runtime.hpp"
45 #include "opto/type.hpp"
46 #include "runtime/stubRoutines.hpp"
47 #include "utilities/checkedCast.hpp"
48 #include "utilities/debug.hpp"
49 #include "utilities/ostream.hpp"
50 #include "utilities/powerOfTwo.hpp"
51 #include "utilities/stringUtils.hpp"
52
53 // Portions of code courtesy of Clifford Click
54
55 // Optimization - Graph Style
56
57 // Dictionary of types shared among compilations.
58 Dict* Type::_shared_type_dict = nullptr;
59
60 // Array which maps compiler types to Basic Types
61 const Type::TypeInfo Type::_type_info[Type::lastype] = {
62 { Bad, T_ILLEGAL, "bad", false, Node::NotAMachineReg, relocInfo::none }, // Bad
63 { Control, T_ILLEGAL, "control", false, 0, relocInfo::none }, // Control
64 { Bottom, T_VOID, "top", false, 0, relocInfo::none }, // Top
65 { Bad, T_INT, "int:", false, Op_RegI, relocInfo::none }, // Int
66 { Bad, T_LONG, "long:", false, Op_RegL, relocInfo::none }, // Long
67 { Half, T_VOID, "half", false, 0, relocInfo::none }, // Half
68 { Bad, T_NARROWOOP, "narrowoop:", false, Op_RegN, relocInfo::none }, // NarrowOop
69 { Bad, T_NARROWKLASS,"narrowklass:", false, Op_RegN, relocInfo::none }, // NarrowKlass
70 { Bad, T_ILLEGAL, "tuple:", false, Node::NotAMachineReg, relocInfo::none }, // Tuple
71 { Bad, T_ARRAY, "array:", false, Node::NotAMachineReg, relocInfo::none }, // Array
715 if (Matcher::vector_size_supported(T_FLOAT, 2)) {
716 TypeVect::VECTD = TypeVect::make(T_FLOAT, 2);
717 }
718 if (Matcher::vector_size_supported(T_FLOAT, 4)) {
719 TypeVect::VECTX = TypeVect::make(T_FLOAT, 4);
720 }
721 if (Matcher::vector_size_supported(T_FLOAT, 8)) {
722 TypeVect::VECTY = TypeVect::make(T_FLOAT, 8);
723 }
724 if (Matcher::vector_size_supported(T_FLOAT, 16)) {
725 TypeVect::VECTZ = TypeVect::make(T_FLOAT, 16);
726 }
727
728 mreg2type[Op_VecA] = TypeVect::VECTA;
729 mreg2type[Op_VecS] = TypeVect::VECTS;
730 mreg2type[Op_VecD] = TypeVect::VECTD;
731 mreg2type[Op_VecX] = TypeVect::VECTX;
732 mreg2type[Op_VecY] = TypeVect::VECTY;
733 mreg2type[Op_VecZ] = TypeVect::VECTZ;
734
735 BarrierSetC2::make_clone_type();
736 LockNode::initialize_lock_Type();
737 ArrayCopyNode::initialize_arraycopy_Type();
738 OptoRuntime::initialize_types();
739
740 // Restore working type arena.
741 current->set_type_arena(save);
742 current->set_type_dict(nullptr);
743 }
744
745 //------------------------------Initialize-------------------------------------
746 void Type::Initialize(Compile* current) {
747 assert(current->type_arena() != nullptr, "must have created type arena");
748
749 if (_shared_type_dict == nullptr) {
750 Initialize_shared(current);
751 }
752
753 Arena* type_arena = current->type_arena();
754
|