< prev index next >

src/hotspot/share/utilities/globalDefinitions.hpp

Print this page

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









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

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

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

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

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

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

 859 #else
 860   T_OBJECT_aelem_bytes      = 4,
 861   T_ARRAY_aelem_bytes       = 4,

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

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

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

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






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

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

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

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

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

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