< prev index next >

src/hotspot/share/utilities/globalDefinitions.hpp

Print this page

 619 const bool support_IRIW_for_not_multiple_copy_atomic_cpu = false;
 620 #else
 621 // From all non-multi-copy-atomic architectures, only PPC64 supports IRIW at the moment.
 622 // Final decision is subject to JEP 188: Java Memory Model Update.
 623 const bool support_IRIW_for_not_multiple_copy_atomic_cpu = PPC64_ONLY(true) NOT_PPC64(false);
 624 #endif
 625 
 626 // The expected size in bytes of a cache line, used to pad data structures.
 627 #ifndef DEFAULT_CACHE_LINE_SIZE
 628   #define DEFAULT_CACHE_LINE_SIZE 64
 629 #endif
 630 
 631 
 632 //----------------------------------------------------------------------------------------------------
 633 // Utility macros for compilers
 634 // used to silence compiler warnings
 635 
 636 #define Unused_Variable(var) var
 637 
 638 









 639 //----------------------------------------------------------------------------------------------------
 640 // Miscellaneous
 641 
 642 // 6302670 Eliminate Hotspot __fabsf dependency
 643 // All fabs() callers should call this function instead, which will implicitly
 644 // convert the operand to double, avoiding a dependency on __fabsf which
 645 // doesn't exist in early versions of Solaris 8.
 646 inline double fabsd(double value) {
 647   return fabs(value);
 648 }
 649 
 650 // Returns numerator/denominator as percentage value from 0 to 100. If denominator
 651 // is zero, return 0.0.
 652 template<typename T>
 653 inline double percent_of(T numerator, T denominator) {
 654   return denominator != 0 ? (double)numerator / denominator * 100.0 : 0.0;
 655 }
 656 
 657 //----------------------------------------------------------------------------------------------------
 658 // Special casts

 704 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
 705 enum BasicType {
 706 // The values T_BOOLEAN..T_LONG (4..11) are derived from the JVMS.
 707   T_BOOLEAN     = JVM_T_BOOLEAN,
 708   T_CHAR        = JVM_T_CHAR,
 709   T_FLOAT       = JVM_T_FLOAT,
 710   T_DOUBLE      = JVM_T_DOUBLE,
 711   T_BYTE        = JVM_T_BYTE,
 712   T_SHORT       = JVM_T_SHORT,
 713   T_INT         = JVM_T_INT,
 714   T_LONG        = JVM_T_LONG,
 715   // The remaining values are not part of any standard.
 716   // T_OBJECT and T_VOID denote two more semantic choices
 717   // for method return values.
 718   // T_OBJECT and T_ARRAY describe signature syntax.
 719   // T_ADDRESS, T_METADATA, T_NARROWOOP, T_NARROWKLASS describe
 720   // internal references within the JVM as if they were Java
 721   // types in their own right.
 722   T_OBJECT      = 12,
 723   T_ARRAY       = 13,
 724   T_VOID        = 14,
 725   T_ADDRESS     = 15,
 726   T_NARROWOOP   = 16,
 727   T_METADATA    = 17,
 728   T_NARROWKLASS = 18,
 729   T_CONFLICT    = 19, // for stack value type with conflicting contents

 730   T_ILLEGAL     = 99
 731 };
 732 
 733 #define SIGNATURE_TYPES_DO(F, N)                \
 734     F(JVM_SIGNATURE_BOOLEAN, T_BOOLEAN, N)      \
 735     F(JVM_SIGNATURE_CHAR,    T_CHAR,    N)      \
 736     F(JVM_SIGNATURE_FLOAT,   T_FLOAT,   N)      \
 737     F(JVM_SIGNATURE_DOUBLE,  T_DOUBLE,  N)      \
 738     F(JVM_SIGNATURE_BYTE,    T_BYTE,    N)      \
 739     F(JVM_SIGNATURE_SHORT,   T_SHORT,   N)      \
 740     F(JVM_SIGNATURE_INT,     T_INT,     N)      \
 741     F(JVM_SIGNATURE_LONG,    T_LONG,    N)      \
 742     F(JVM_SIGNATURE_CLASS,   T_OBJECT,  N)      \
 743     F(JVM_SIGNATURE_ARRAY,   T_ARRAY,   N)      \

 744     F(JVM_SIGNATURE_VOID,    T_VOID,    N)      \
 745     /*end*/
 746 
 747 inline bool is_java_type(BasicType t) {
 748   return T_BOOLEAN <= t && t <= T_VOID;
 749 }
 750 
 751 inline bool is_java_primitive(BasicType t) {
 752   return T_BOOLEAN <= t && t <= T_LONG;
 753 }
 754 
 755 inline bool is_subword_type(BasicType t) {
 756   // these guys are processed exactly like T_INT in calling sequences:
 757   return (t == T_BOOLEAN || t == T_CHAR || t == T_BYTE || t == T_SHORT);
 758 }
 759 
 760 inline bool is_signed_subword_type(BasicType t) {
 761   return (t == T_BYTE || t == T_SHORT);
 762 }
 763 
 764 inline bool is_unsigned_subword_type(BasicType t) {
 765   return (t == T_BOOLEAN || t == T_CHAR);
 766 }
 767 
 768 inline bool is_double_word_type(BasicType t) {
 769   return (t == T_DOUBLE || t == T_LONG);
 770 }
 771 
 772 inline bool is_reference_type(BasicType t, bool include_narrow_oop = false) {
 773   return (t == T_OBJECT || t == T_ARRAY || (include_narrow_oop && t == T_NARROWOOP));
 774 }
 775 
 776 inline bool is_integral_type(BasicType t) {
 777   return is_subword_type(t) || t == T_INT || t == T_LONG;
 778 }
 779 
 780 inline bool is_non_subword_integral_type(BasicType t) {
 781   return t == T_INT || t == T_LONG;
 782 }
 783 
 784 inline bool is_floating_point_type(BasicType t) {
 785   return (t == T_FLOAT || t == T_DOUBLE);
 786 }
 787 
 788 extern char type2char_tab[T_CONFLICT+1];     // Map a BasicType to a jchar
 789 inline char type2char(BasicType t) { return (uint)t < T_CONFLICT+1 ? type2char_tab[t] : 0; }
 790 extern int type2size[T_CONFLICT+1];         // Map BasicType to result stack elements
 791 extern const char* type2name_tab[T_CONFLICT+1];     // Map a BasicType to a char*
 792 extern BasicType name2type(const char* name);
 793 

 811 
 812 // Auxiliary math routines
 813 // least common multiple
 814 extern size_t lcm(size_t a, size_t b);
 815 
 816 
 817 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
 818 enum BasicTypeSize {
 819   T_BOOLEAN_size     = 1,
 820   T_CHAR_size        = 1,
 821   T_FLOAT_size       = 1,
 822   T_DOUBLE_size      = 2,
 823   T_BYTE_size        = 1,
 824   T_SHORT_size       = 1,
 825   T_INT_size         = 1,
 826   T_LONG_size        = 2,
 827   T_OBJECT_size      = 1,
 828   T_ARRAY_size       = 1,
 829   T_NARROWOOP_size   = 1,
 830   T_NARROWKLASS_size = 1,
 831   T_VOID_size        = 0

 832 };
 833 
 834 // this works on valid parameter types but not T_VOID, T_CONFLICT, etc.
 835 inline int parameter_type_word_count(BasicType t) {
 836   if (is_double_word_type(t))  return 2;
 837   assert(is_java_primitive(t) || is_reference_type(t), "no goofy types here please");
 838   assert(type2size[t] == 1, "must be");
 839   return 1;
 840 }
 841 
 842 // maps a BasicType to its instance field storage type:
 843 // all sub-word integral types are widened to T_INT
 844 extern BasicType type2field[T_CONFLICT+1];
 845 extern BasicType type2wfield[T_CONFLICT+1];
 846 
 847 
 848 // size in bytes
 849 enum ArrayElementSize {
 850   T_BOOLEAN_aelem_bytes     = 1,
 851   T_CHAR_aelem_bytes        = 2,
 852   T_FLOAT_aelem_bytes       = 4,
 853   T_DOUBLE_aelem_bytes      = 8,
 854   T_BYTE_aelem_bytes        = 1,
 855   T_SHORT_aelem_bytes       = 2,
 856   T_INT_aelem_bytes         = 4,
 857   T_LONG_aelem_bytes        = 8,
 858 #ifdef _LP64
 859   T_OBJECT_aelem_bytes      = 8,
 860   T_ARRAY_aelem_bytes       = 8,

 861 #else
 862   T_OBJECT_aelem_bytes      = 4,
 863   T_ARRAY_aelem_bytes       = 4,

 864 #endif
 865   T_NARROWOOP_aelem_bytes   = 4,
 866   T_NARROWKLASS_aelem_bytes = 4,
 867   T_VOID_aelem_bytes        = 0
 868 };
 869 
 870 extern int _type2aelembytes[T_CONFLICT+1]; // maps a BasicType to nof bytes used by its array element
 871 #ifdef ASSERT
 872 extern int type2aelembytes(BasicType t, bool allow_address = false); // asserts
 873 #else
 874 inline int type2aelembytes(BasicType t, bool allow_address = false) { return _type2aelembytes[t]; }
 875 #endif
 876 
 877 inline bool same_type_or_subword_size(BasicType t1, BasicType t2) {
 878   return (t1 == t2) || (is_subword_type(t1) && type2aelembytes(t1) == type2aelembytes(t2));
 879 }
 880 
 881 // JavaValue serves as a container for arbitrary Java values.
 882 
 883 class JavaValue {

 936 
 937 // TosState describes the top-of-stack state before and after the execution of
 938 // a bytecode or method. The top-of-stack value may be cached in one or more CPU
 939 // registers. The TosState corresponds to the 'machine representation' of this cached
 940 // value. There's 4 states corresponding to the JAVA types int, long, float & double
 941 // as well as a 5th state in case the top-of-stack value is actually on the top
 942 // of stack (in memory) and thus not cached. The atos state corresponds to the itos
 943 // state when it comes to machine representation but is used separately for (oop)
 944 // type specific operations (e.g. verification code).
 945 
 946 enum TosState {         // describes the tos cache contents
 947   btos = 0,             // byte, bool tos cached
 948   ztos = 1,             // byte, bool tos cached
 949   ctos = 2,             // char tos cached
 950   stos = 3,             // short tos cached
 951   itos = 4,             // int tos cached
 952   ltos = 5,             // long tos cached
 953   ftos = 6,             // float tos cached
 954   dtos = 7,             // double tos cached
 955   atos = 8,             // object cached
 956   vtos = 9,             // tos not cached
 957   number_of_states,
 958   ilgl                  // illegal state: should not occur
 959 };
 960 
 961 
 962 inline TosState as_TosState(BasicType type) {
 963   switch (type) {
 964     case T_BYTE   : return btos;
 965     case T_BOOLEAN: return ztos;
 966     case T_CHAR   : return ctos;
 967     case T_SHORT  : return stos;
 968     case T_INT    : return itos;
 969     case T_LONG   : return ltos;
 970     case T_FLOAT  : return ftos;
 971     case T_DOUBLE : return dtos;
 972     case T_VOID   : return vtos;
 973     case T_ARRAY  : // fall through

 974     case T_OBJECT : return atos;
 975     default       : return ilgl;
 976   }
 977 }
 978 
 979 inline BasicType as_BasicType(TosState state) {
 980   switch (state) {
 981     case btos : return T_BYTE;
 982     case ztos : return T_BOOLEAN;
 983     case ctos : return T_CHAR;
 984     case stos : return T_SHORT;
 985     case itos : return T_INT;
 986     case ltos : return T_LONG;
 987     case ftos : return T_FLOAT;
 988     case dtos : return T_DOUBLE;
 989     case atos : return T_OBJECT;
 990     case vtos : return T_VOID;
 991     default   : return T_ILLEGAL;
 992   }
 993 }

1265 
1266 //----------------------------------------------------------------------------------------------------
1267 // String type aliases used by command line flag declarations and
1268 // processing utilities.
1269 
1270 typedef const char* ccstr;
1271 typedef const char* ccstrlist;   // represents string arguments which accumulate
1272 
1273 //----------------------------------------------------------------------------------------------------
1274 // Default hash/equals functions used by ResourceHashtable
1275 
1276 template<typename K> unsigned primitive_hash(const K& k) {
1277   unsigned hash = (unsigned)((uintptr_t)k);
1278   return hash ^ (hash >> 3); // just in case we're dealing with aligned ptrs
1279 }
1280 
1281 template<typename K> bool primitive_equals(const K& k0, const K& k1) {
1282   return k0 == k1;
1283 }
1284 






1285 //----------------------------------------------------------------------------------------------------
1286 
1287 // Allow use of C++ thread_local when approved - see JDK-8282469.
1288 #define APPROVED_CPP_THREAD_LOCAL thread_local
1289 
1290 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_HPP

 619 const bool support_IRIW_for_not_multiple_copy_atomic_cpu = false;
 620 #else
 621 // From all non-multi-copy-atomic architectures, only PPC64 supports IRIW at the moment.
 622 // Final decision is subject to JEP 188: Java Memory Model Update.
 623 const bool support_IRIW_for_not_multiple_copy_atomic_cpu = PPC64_ONLY(true) NOT_PPC64(false);
 624 #endif
 625 
 626 // The expected size in bytes of a cache line, used to pad data structures.
 627 #ifndef DEFAULT_CACHE_LINE_SIZE
 628   #define DEFAULT_CACHE_LINE_SIZE 64
 629 #endif
 630 
 631 
 632 //----------------------------------------------------------------------------------------------------
 633 // Utility macros for compilers
 634 // used to silence compiler warnings
 635 
 636 #define Unused_Variable(var) var
 637 
 638 
 639 //----------------------------------------------------------------------------------------------------
 640 // Prototyping
 641 // "Code Missing Here" macro, un-define when integrating back from prototyping stage and break
 642 // compilation on purpose (i.e. "forget me not")
 643 #define PROTOTYPE
 644 #ifdef PROTOTYPE
 645 #define CMH(m)
 646 #endif
 647 
 648 //----------------------------------------------------------------------------------------------------
 649 // Miscellaneous
 650 
 651 // 6302670 Eliminate Hotspot __fabsf dependency
 652 // All fabs() callers should call this function instead, which will implicitly
 653 // convert the operand to double, avoiding a dependency on __fabsf which
 654 // doesn't exist in early versions of Solaris 8.
 655 inline double fabsd(double value) {
 656   return fabs(value);
 657 }
 658 
 659 // Returns numerator/denominator as percentage value from 0 to 100. If denominator
 660 // is zero, return 0.0.
 661 template<typename T>
 662 inline double percent_of(T numerator, T denominator) {
 663   return denominator != 0 ? (double)numerator / denominator * 100.0 : 0.0;
 664 }
 665 
 666 //----------------------------------------------------------------------------------------------------
 667 // Special casts

 713 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
 714 enum BasicType {
 715 // The values T_BOOLEAN..T_LONG (4..11) are derived from the JVMS.
 716   T_BOOLEAN     = JVM_T_BOOLEAN,
 717   T_CHAR        = JVM_T_CHAR,
 718   T_FLOAT       = JVM_T_FLOAT,
 719   T_DOUBLE      = JVM_T_DOUBLE,
 720   T_BYTE        = JVM_T_BYTE,
 721   T_SHORT       = JVM_T_SHORT,
 722   T_INT         = JVM_T_INT,
 723   T_LONG        = JVM_T_LONG,
 724   // The remaining values are not part of any standard.
 725   // T_OBJECT and T_VOID denote two more semantic choices
 726   // for method return values.
 727   // T_OBJECT and T_ARRAY describe signature syntax.
 728   // T_ADDRESS, T_METADATA, T_NARROWOOP, T_NARROWKLASS describe
 729   // internal references within the JVM as if they were Java
 730   // types in their own right.
 731   T_OBJECT      = 12,
 732   T_ARRAY       = 13,
 733   T_PRIMITIVE_OBJECT = 14,
 734   T_VOID        = 15,
 735   T_ADDRESS     = 16,
 736   T_NARROWOOP   = 17,
 737   T_METADATA    = 18,
 738   T_NARROWKLASS = 19,
 739   T_CONFLICT    = 20, // for stack value type with conflicting contents
 740   T_ILLEGAL     = 99
 741 };
 742 
 743 #define SIGNATURE_TYPES_DO(F, N)                \
 744     F(JVM_SIGNATURE_BOOLEAN, T_BOOLEAN, N)      \
 745     F(JVM_SIGNATURE_CHAR,    T_CHAR,    N)      \
 746     F(JVM_SIGNATURE_FLOAT,   T_FLOAT,   N)      \
 747     F(JVM_SIGNATURE_DOUBLE,  T_DOUBLE,  N)      \
 748     F(JVM_SIGNATURE_BYTE,    T_BYTE,    N)      \
 749     F(JVM_SIGNATURE_SHORT,   T_SHORT,   N)      \
 750     F(JVM_SIGNATURE_INT,     T_INT,     N)      \
 751     F(JVM_SIGNATURE_LONG,    T_LONG,    N)      \
 752     F(JVM_SIGNATURE_CLASS,   T_OBJECT,  N)      \
 753     F(JVM_SIGNATURE_ARRAY,   T_ARRAY,   N)      \
 754     F(JVM_SIGNATURE_PRIMITIVE_OBJECT, T_PRIMITIVE_OBJECT, N) \
 755     F(JVM_SIGNATURE_VOID,    T_VOID,    N)      \
 756     /*end*/
 757 
 758 inline bool is_java_type(BasicType t) {
 759   return T_BOOLEAN <= t && t <= T_VOID;
 760 }
 761 
 762 inline bool is_java_primitive(BasicType t) {
 763   return T_BOOLEAN <= t && t <= T_LONG;
 764 }
 765 
 766 inline bool is_subword_type(BasicType t) {
 767   // these guys are processed exactly like T_INT in calling sequences:
 768   return (t == T_BOOLEAN || t == T_CHAR || t == T_BYTE || t == T_SHORT);
 769 }
 770 
 771 inline bool is_signed_subword_type(BasicType t) {
 772   return (t == T_BYTE || t == T_SHORT);
 773 }
 774 
 775 inline bool is_unsigned_subword_type(BasicType t) {
 776   return (t == T_BOOLEAN || t == T_CHAR);
 777 }
 778 
 779 inline bool is_double_word_type(BasicType t) {
 780   return (t == T_DOUBLE || t == T_LONG);
 781 }
 782 
 783 inline bool is_reference_type(BasicType t, bool include_narrow_oop = false) {
 784   return (t == T_OBJECT || t == T_ARRAY || t == T_PRIMITIVE_OBJECT || (include_narrow_oop && t == T_NARROWOOP));
 785 }
 786 
 787 inline bool is_integral_type(BasicType t) {
 788   return is_subword_type(t) || t == T_INT || t == T_LONG;
 789 }
 790 
 791 inline bool is_non_subword_integral_type(BasicType t) {
 792   return t == T_INT || t == T_LONG;
 793 }
 794 
 795 inline bool is_floating_point_type(BasicType t) {
 796   return (t == T_FLOAT || t == T_DOUBLE);
 797 }
 798 
 799 extern char type2char_tab[T_CONFLICT+1];     // Map a BasicType to a jchar
 800 inline char type2char(BasicType t) { return (uint)t < T_CONFLICT+1 ? type2char_tab[t] : 0; }
 801 extern int type2size[T_CONFLICT+1];         // Map BasicType to result stack elements
 802 extern const char* type2name_tab[T_CONFLICT+1];     // Map a BasicType to a char*
 803 extern BasicType name2type(const char* name);
 804 

 822 
 823 // Auxiliary math routines
 824 // least common multiple
 825 extern size_t lcm(size_t a, size_t b);
 826 
 827 
 828 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
 829 enum BasicTypeSize {
 830   T_BOOLEAN_size     = 1,
 831   T_CHAR_size        = 1,
 832   T_FLOAT_size       = 1,
 833   T_DOUBLE_size      = 2,
 834   T_BYTE_size        = 1,
 835   T_SHORT_size       = 1,
 836   T_INT_size         = 1,
 837   T_LONG_size        = 2,
 838   T_OBJECT_size      = 1,
 839   T_ARRAY_size       = 1,
 840   T_NARROWOOP_size   = 1,
 841   T_NARROWKLASS_size = 1,
 842   T_VOID_size        = 0,
 843   T_PRIMITIVE_OBJECT_size = 1
 844 };
 845 
 846 // this works on valid parameter types but not T_VOID, T_CONFLICT, etc.
 847 inline int parameter_type_word_count(BasicType t) {
 848   if (is_double_word_type(t))  return 2;
 849   assert(is_java_primitive(t) || is_reference_type(t), "no goofy types here please");
 850   assert(type2size[t] == 1, "must be");
 851   return 1;
 852 }
 853 
 854 // maps a BasicType to its instance field storage type:
 855 // all sub-word integral types are widened to T_INT
 856 extern BasicType type2field[T_CONFLICT+1];
 857 extern BasicType type2wfield[T_CONFLICT+1];
 858 
 859 
 860 // size in bytes
 861 enum ArrayElementSize {
 862   T_BOOLEAN_aelem_bytes     = 1,
 863   T_CHAR_aelem_bytes        = 2,
 864   T_FLOAT_aelem_bytes       = 4,
 865   T_DOUBLE_aelem_bytes      = 8,
 866   T_BYTE_aelem_bytes        = 1,
 867   T_SHORT_aelem_bytes       = 2,
 868   T_INT_aelem_bytes         = 4,
 869   T_LONG_aelem_bytes        = 8,
 870 #ifdef _LP64
 871   T_OBJECT_aelem_bytes      = 8,
 872   T_ARRAY_aelem_bytes       = 8,
 873   T_PRIMITIVE_OBJECT_aelem_bytes = 8,
 874 #else
 875   T_OBJECT_aelem_bytes      = 4,
 876   T_ARRAY_aelem_bytes       = 4,
 877   T_PRIMITIVE_OBJECT_aelem_bytes = 4,
 878 #endif
 879   T_NARROWOOP_aelem_bytes   = 4,
 880   T_NARROWKLASS_aelem_bytes = 4,
 881   T_VOID_aelem_bytes        = 0
 882 };
 883 
 884 extern int _type2aelembytes[T_CONFLICT+1]; // maps a BasicType to nof bytes used by its array element
 885 #ifdef ASSERT
 886 extern int type2aelembytes(BasicType t, bool allow_address = false); // asserts
 887 #else
 888 inline int type2aelembytes(BasicType t, bool allow_address = false) { return _type2aelembytes[t]; }
 889 #endif
 890 
 891 inline bool same_type_or_subword_size(BasicType t1, BasicType t2) {
 892   return (t1 == t2) || (is_subword_type(t1) && type2aelembytes(t1) == type2aelembytes(t2));
 893 }
 894 
 895 // JavaValue serves as a container for arbitrary Java values.
 896 
 897 class JavaValue {

 950 
 951 // TosState describes the top-of-stack state before and after the execution of
 952 // a bytecode or method. The top-of-stack value may be cached in one or more CPU
 953 // registers. The TosState corresponds to the 'machine representation' of this cached
 954 // value. There's 4 states corresponding to the JAVA types int, long, float & double
 955 // as well as a 5th state in case the top-of-stack value is actually on the top
 956 // of stack (in memory) and thus not cached. The atos state corresponds to the itos
 957 // state when it comes to machine representation but is used separately for (oop)
 958 // type specific operations (e.g. verification code).
 959 
 960 enum TosState {         // describes the tos cache contents
 961   btos = 0,             // byte, bool tos cached
 962   ztos = 1,             // byte, bool tos cached
 963   ctos = 2,             // char tos cached
 964   stos = 3,             // short tos cached
 965   itos = 4,             // int tos cached
 966   ltos = 5,             // long tos cached
 967   ftos = 6,             // float tos cached
 968   dtos = 7,             // double tos cached
 969   atos = 8,             // object cached
 970   vtos = 9,             // tos not cached,
 971   number_of_states,
 972   ilgl                  // illegal state: should not occur
 973 };
 974 
 975 
 976 inline TosState as_TosState(BasicType type) {
 977   switch (type) {
 978     case T_BYTE   : return btos;
 979     case T_BOOLEAN: return ztos;
 980     case T_CHAR   : return ctos;
 981     case T_SHORT  : return stos;
 982     case T_INT    : return itos;
 983     case T_LONG   : return ltos;
 984     case T_FLOAT  : return ftos;
 985     case T_DOUBLE : return dtos;
 986     case T_VOID   : return vtos;
 987     case T_PRIMITIVE_OBJECT: // fall through
 988     case T_ARRAY  :   // fall through
 989     case T_OBJECT : return atos;
 990     default       : return ilgl;
 991   }
 992 }
 993 
 994 inline BasicType as_BasicType(TosState state) {
 995   switch (state) {
 996     case btos : return T_BYTE;
 997     case ztos : return T_BOOLEAN;
 998     case ctos : return T_CHAR;
 999     case stos : return T_SHORT;
1000     case itos : return T_INT;
1001     case ltos : return T_LONG;
1002     case ftos : return T_FLOAT;
1003     case dtos : return T_DOUBLE;
1004     case atos : return T_OBJECT;
1005     case vtos : return T_VOID;
1006     default   : return T_ILLEGAL;
1007   }
1008 }

1280 
1281 //----------------------------------------------------------------------------------------------------
1282 // String type aliases used by command line flag declarations and
1283 // processing utilities.
1284 
1285 typedef const char* ccstr;
1286 typedef const char* ccstrlist;   // represents string arguments which accumulate
1287 
1288 //----------------------------------------------------------------------------------------------------
1289 // Default hash/equals functions used by ResourceHashtable
1290 
1291 template<typename K> unsigned primitive_hash(const K& k) {
1292   unsigned hash = (unsigned)((uintptr_t)k);
1293   return hash ^ (hash >> 3); // just in case we're dealing with aligned ptrs
1294 }
1295 
1296 template<typename K> bool primitive_equals(const K& k0, const K& k1) {
1297   return k0 == k1;
1298 }
1299 
1300 // TEMP!!!!
1301 // This should be removed after LW2 arrays are implemented (JDK-8220790).
1302 // It's an alias to (EnableValhalla && (FlatArrayElementMaxSize != 0)),
1303 // which is actually not 100% correct, but works for the current set of C1/C2
1304 // implementation and test cases.
1305 #define UseFlatArray (EnablePrimitiveClasses && (FlatArrayElementMaxSize != 0))
1306 //----------------------------------------------------------------------------------------------------
1307 
1308 // Allow use of C++ thread_local when approved - see JDK-8282469.
1309 #define APPROVED_CPP_THREAD_LOCAL thread_local
1310 
1311 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_HPP
< prev index next >