< prev index next >

src/hotspot/share/utilities/globalDefinitions.hpp

Print this page

 567 const bool support_IRIW_for_not_multiple_copy_atomic_cpu = false;
 568 #else
 569 // From all non-multi-copy-atomic architectures, only PPC64 supports IRIW at the moment.
 570 // Final decision is subject to JEP 188: Java Memory Model Update.
 571 const bool support_IRIW_for_not_multiple_copy_atomic_cpu = PPC64_ONLY(true) NOT_PPC64(false);
 572 #endif
 573 
 574 // The expected size in bytes of a cache line, used to pad data structures.
 575 #ifndef DEFAULT_CACHE_LINE_SIZE
 576   #define DEFAULT_CACHE_LINE_SIZE 64
 577 #endif
 578 
 579 
 580 //----------------------------------------------------------------------------------------------------
 581 // Utility macros for compilers
 582 // used to silence compiler warnings
 583 
 584 #define Unused_Variable(var) var
 585 
 586 









 587 //----------------------------------------------------------------------------------------------------
 588 // Miscellaneous
 589 
 590 // 6302670 Eliminate Hotspot __fabsf dependency
 591 // All fabs() callers should call this function instead, which will implicitly
 592 // convert the operand to double, avoiding a dependency on __fabsf which
 593 // doesn't exist in early versions of Solaris 8.
 594 inline double fabsd(double value) {
 595   return fabs(value);
 596 }
 597 
 598 // Returns numerator/denominator as percentage value from 0 to 100. If denominator
 599 // is zero, return 0.0.
 600 template<typename T>
 601 inline double percent_of(T numerator, T denominator) {
 602   return denominator != 0 ? (double)numerator / denominator * 100.0 : 0.0;
 603 }
 604 
 605 //----------------------------------------------------------------------------------------------------
 606 // Special casts

 652 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
 653 enum BasicType {
 654 // The values T_BOOLEAN..T_LONG (4..11) are derived from the JVMS.
 655   T_BOOLEAN     = JVM_T_BOOLEAN,
 656   T_CHAR        = JVM_T_CHAR,
 657   T_FLOAT       = JVM_T_FLOAT,
 658   T_DOUBLE      = JVM_T_DOUBLE,
 659   T_BYTE        = JVM_T_BYTE,
 660   T_SHORT       = JVM_T_SHORT,
 661   T_INT         = JVM_T_INT,
 662   T_LONG        = JVM_T_LONG,
 663   // The remaining values are not part of any standard.
 664   // T_OBJECT and T_VOID denote two more semantic choices
 665   // for method return values.
 666   // T_OBJECT and T_ARRAY describe signature syntax.
 667   // T_ADDRESS, T_METADATA, T_NARROWOOP, T_NARROWKLASS describe
 668   // internal references within the JVM as if they were Java
 669   // types in their own right.
 670   T_OBJECT      = 12,
 671   T_ARRAY       = 13,
 672   T_VOID        = 14,
 673   T_ADDRESS     = 15,
 674   T_NARROWOOP   = 16,
 675   T_METADATA    = 17,
 676   T_NARROWKLASS = 18,
 677   T_CONFLICT    = 19, // for stack value type with conflicting contents

 678   T_ILLEGAL     = 99
 679 };
 680 
 681 #define SIGNATURE_TYPES_DO(F, N)                \
 682     F(JVM_SIGNATURE_BOOLEAN, T_BOOLEAN, N)      \
 683     F(JVM_SIGNATURE_CHAR,    T_CHAR,    N)      \
 684     F(JVM_SIGNATURE_FLOAT,   T_FLOAT,   N)      \
 685     F(JVM_SIGNATURE_DOUBLE,  T_DOUBLE,  N)      \
 686     F(JVM_SIGNATURE_BYTE,    T_BYTE,    N)      \
 687     F(JVM_SIGNATURE_SHORT,   T_SHORT,   N)      \
 688     F(JVM_SIGNATURE_INT,     T_INT,     N)      \
 689     F(JVM_SIGNATURE_LONG,    T_LONG,    N)      \
 690     F(JVM_SIGNATURE_CLASS,   T_OBJECT,  N)      \
 691     F(JVM_SIGNATURE_ARRAY,   T_ARRAY,   N)      \

 692     F(JVM_SIGNATURE_VOID,    T_VOID,    N)      \
 693     /*end*/
 694 
 695 inline bool is_java_type(BasicType t) {
 696   return T_BOOLEAN <= t && t <= T_VOID;
 697 }
 698 
 699 inline bool is_java_primitive(BasicType t) {
 700   return T_BOOLEAN <= t && t <= T_LONG;
 701 }
 702 
 703 inline bool is_subword_type(BasicType t) {
 704   // these guys are processed exactly like T_INT in calling sequences:
 705   return (t == T_BOOLEAN || t == T_CHAR || t == T_BYTE || t == T_SHORT);
 706 }
 707 
 708 inline bool is_signed_subword_type(BasicType t) {
 709   return (t == T_BYTE || t == T_SHORT);
 710 }
 711 
 712 inline bool is_double_word_type(BasicType t) {
 713   return (t == T_DOUBLE || t == T_LONG);
 714 }
 715 
 716 inline bool is_reference_type(BasicType t) {
 717   return (t == T_OBJECT || t == T_ARRAY);
 718 }
 719 
 720 inline bool is_integral_type(BasicType t) {
 721   return is_subword_type(t) || t == T_INT || t == T_LONG;
 722 }
 723 
 724 inline bool is_floating_point_type(BasicType t) {
 725   return (t == T_FLOAT || t == T_DOUBLE);
 726 }
 727 
 728 extern char type2char_tab[T_CONFLICT+1];     // Map a BasicType to a jchar
 729 inline char type2char(BasicType t) { return (uint)t < T_CONFLICT+1 ? type2char_tab[t] : 0; }
 730 extern int type2size[T_CONFLICT+1];         // Map BasicType to result stack elements
 731 extern const char* type2name_tab[T_CONFLICT+1];     // Map a BasicType to a jchar
 732 inline const char* type2name(BasicType t) { return (uint)t < T_CONFLICT+1 ? type2name_tab[t] : NULL; }
 733 extern BasicType name2type(const char* name);
 734 
 735 inline jlong max_signed_integer(BasicType bt) {
 736   if (bt == T_INT) {
 737     return max_jint;

 750 
 751 // Auxiliary math routines
 752 // least common multiple
 753 extern size_t lcm(size_t a, size_t b);
 754 
 755 
 756 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
 757 enum BasicTypeSize {
 758   T_BOOLEAN_size     = 1,
 759   T_CHAR_size        = 1,
 760   T_FLOAT_size       = 1,
 761   T_DOUBLE_size      = 2,
 762   T_BYTE_size        = 1,
 763   T_SHORT_size       = 1,
 764   T_INT_size         = 1,
 765   T_LONG_size        = 2,
 766   T_OBJECT_size      = 1,
 767   T_ARRAY_size       = 1,
 768   T_NARROWOOP_size   = 1,
 769   T_NARROWKLASS_size = 1,
 770   T_VOID_size        = 0

 771 };
 772 
 773 // this works on valid parameter types but not T_VOID, T_CONFLICT, etc.
 774 inline int parameter_type_word_count(BasicType t) {
 775   if (is_double_word_type(t))  return 2;
 776   assert(is_java_primitive(t) || is_reference_type(t), "no goofy types here please");
 777   assert(type2size[t] == 1, "must be");
 778   return 1;
 779 }
 780 
 781 // maps a BasicType to its instance field storage type:
 782 // all sub-word integral types are widened to T_INT
 783 extern BasicType type2field[T_CONFLICT+1];
 784 extern BasicType type2wfield[T_CONFLICT+1];
 785 
 786 
 787 // size in bytes
 788 enum ArrayElementSize {
 789   T_BOOLEAN_aelem_bytes     = 1,
 790   T_CHAR_aelem_bytes        = 2,
 791   T_FLOAT_aelem_bytes       = 4,
 792   T_DOUBLE_aelem_bytes      = 8,
 793   T_BYTE_aelem_bytes        = 1,
 794   T_SHORT_aelem_bytes       = 2,
 795   T_INT_aelem_bytes         = 4,
 796   T_LONG_aelem_bytes        = 8,
 797 #ifdef _LP64
 798   T_OBJECT_aelem_bytes      = 8,
 799   T_ARRAY_aelem_bytes       = 8,

 800 #else
 801   T_OBJECT_aelem_bytes      = 4,
 802   T_ARRAY_aelem_bytes       = 4,

 803 #endif
 804   T_NARROWOOP_aelem_bytes   = 4,
 805   T_NARROWKLASS_aelem_bytes = 4,
 806   T_VOID_aelem_bytes        = 0
 807 };
 808 
 809 extern int _type2aelembytes[T_CONFLICT+1]; // maps a BasicType to nof bytes used by its array element
 810 #ifdef ASSERT
 811 extern int type2aelembytes(BasicType t, bool allow_address = false); // asserts
 812 #else
 813 inline int type2aelembytes(BasicType t, bool allow_address = false) { return _type2aelembytes[t]; }
 814 #endif
 815 
 816 
 817 // JavaValue serves as a container for arbitrary Java values.
 818 
 819 class JavaValue {
 820 
 821  public:
 822   typedef union JavaCallValue {

 872 
 873 // TosState describes the top-of-stack state before and after the execution of
 874 // a bytecode or method. The top-of-stack value may be cached in one or more CPU
 875 // registers. The TosState corresponds to the 'machine representation' of this cached
 876 // value. There's 4 states corresponding to the JAVA types int, long, float & double
 877 // as well as a 5th state in case the top-of-stack value is actually on the top
 878 // of stack (in memory) and thus not cached. The atos state corresponds to the itos
 879 // state when it comes to machine representation but is used separately for (oop)
 880 // type specific operations (e.g. verification code).
 881 
 882 enum TosState {         // describes the tos cache contents
 883   btos = 0,             // byte, bool tos cached
 884   ztos = 1,             // byte, bool tos cached
 885   ctos = 2,             // char tos cached
 886   stos = 3,             // short tos cached
 887   itos = 4,             // int tos cached
 888   ltos = 5,             // long tos cached
 889   ftos = 6,             // float tos cached
 890   dtos = 7,             // double tos cached
 891   atos = 8,             // object cached
 892   vtos = 9,             // tos not cached
 893   number_of_states,
 894   ilgl                  // illegal state: should not occur
 895 };
 896 
 897 
 898 inline TosState as_TosState(BasicType type) {
 899   switch (type) {
 900     case T_BYTE   : return btos;
 901     case T_BOOLEAN: return ztos;
 902     case T_CHAR   : return ctos;
 903     case T_SHORT  : return stos;
 904     case T_INT    : return itos;
 905     case T_LONG   : return ltos;
 906     case T_FLOAT  : return ftos;
 907     case T_DOUBLE : return dtos;
 908     case T_VOID   : return vtos;
 909     case T_ARRAY  : // fall through

 910     case T_OBJECT : return atos;
 911     default       : return ilgl;
 912   }
 913 }
 914 
 915 inline BasicType as_BasicType(TosState state) {
 916   switch (state) {
 917     case btos : return T_BYTE;
 918     case ztos : return T_BOOLEAN;
 919     case ctos : return T_CHAR;
 920     case stos : return T_SHORT;
 921     case itos : return T_INT;
 922     case ltos : return T_LONG;
 923     case ftos : return T_FLOAT;
 924     case dtos : return T_DOUBLE;
 925     case atos : return T_OBJECT;
 926     case vtos : return T_VOID;
 927     default   : return T_ILLEGAL;
 928   }
 929 }

1202 
1203 //----------------------------------------------------------------------------------------------------
1204 // String type aliases used by command line flag declarations and
1205 // processing utilities.
1206 
1207 typedef const char* ccstr;
1208 typedef const char* ccstrlist;   // represents string arguments which accumulate
1209 
1210 //----------------------------------------------------------------------------------------------------
1211 // Default hash/equals functions used by ResourceHashtable
1212 
1213 template<typename K> unsigned primitive_hash(const K& k) {
1214   unsigned hash = (unsigned)((uintptr_t)k);
1215   return hash ^ (hash >> 3); // just in case we're dealing with aligned ptrs
1216 }
1217 
1218 template<typename K> bool primitive_equals(const K& k0, const K& k1) {
1219   return k0 == k1;
1220 }
1221 






1222 //----------------------------------------------------------------------------------------------------
1223 
1224 // Allow use of C++ thread_local when approved - see JDK-8282469.
1225 #define APPROVED_CPP_THREAD_LOCAL thread_local
1226 
1227 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_HPP

 567 const bool support_IRIW_for_not_multiple_copy_atomic_cpu = false;
 568 #else
 569 // From all non-multi-copy-atomic architectures, only PPC64 supports IRIW at the moment.
 570 // Final decision is subject to JEP 188: Java Memory Model Update.
 571 const bool support_IRIW_for_not_multiple_copy_atomic_cpu = PPC64_ONLY(true) NOT_PPC64(false);
 572 #endif
 573 
 574 // The expected size in bytes of a cache line, used to pad data structures.
 575 #ifndef DEFAULT_CACHE_LINE_SIZE
 576   #define DEFAULT_CACHE_LINE_SIZE 64
 577 #endif
 578 
 579 
 580 //----------------------------------------------------------------------------------------------------
 581 // Utility macros for compilers
 582 // used to silence compiler warnings
 583 
 584 #define Unused_Variable(var) var
 585 
 586 
 587 //----------------------------------------------------------------------------------------------------
 588 // Prototyping
 589 // "Code Missing Here" macro, un-define when integrating back from prototyping stage and break
 590 // compilation on purpose (i.e. "forget me not")
 591 #define PROTOTYPE
 592 #ifdef PROTOTYPE
 593 #define CMH(m)
 594 #endif
 595 
 596 //----------------------------------------------------------------------------------------------------
 597 // Miscellaneous
 598 
 599 // 6302670 Eliminate Hotspot __fabsf dependency
 600 // All fabs() callers should call this function instead, which will implicitly
 601 // convert the operand to double, avoiding a dependency on __fabsf which
 602 // doesn't exist in early versions of Solaris 8.
 603 inline double fabsd(double value) {
 604   return fabs(value);
 605 }
 606 
 607 // Returns numerator/denominator as percentage value from 0 to 100. If denominator
 608 // is zero, return 0.0.
 609 template<typename T>
 610 inline double percent_of(T numerator, T denominator) {
 611   return denominator != 0 ? (double)numerator / denominator * 100.0 : 0.0;
 612 }
 613 
 614 //----------------------------------------------------------------------------------------------------
 615 // Special casts

 661 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
 662 enum BasicType {
 663 // The values T_BOOLEAN..T_LONG (4..11) are derived from the JVMS.
 664   T_BOOLEAN     = JVM_T_BOOLEAN,
 665   T_CHAR        = JVM_T_CHAR,
 666   T_FLOAT       = JVM_T_FLOAT,
 667   T_DOUBLE      = JVM_T_DOUBLE,
 668   T_BYTE        = JVM_T_BYTE,
 669   T_SHORT       = JVM_T_SHORT,
 670   T_INT         = JVM_T_INT,
 671   T_LONG        = JVM_T_LONG,
 672   // The remaining values are not part of any standard.
 673   // T_OBJECT and T_VOID denote two more semantic choices
 674   // for method return values.
 675   // T_OBJECT and T_ARRAY describe signature syntax.
 676   // T_ADDRESS, T_METADATA, T_NARROWOOP, T_NARROWKLASS describe
 677   // internal references within the JVM as if they were Java
 678   // types in their own right.
 679   T_OBJECT      = 12,
 680   T_ARRAY       = 13,
 681   T_PRIMITIVE_OBJECT = 14,
 682   T_VOID        = 15,
 683   T_ADDRESS     = 16,
 684   T_NARROWOOP   = 17,
 685   T_METADATA    = 18,
 686   T_NARROWKLASS = 19,
 687   T_CONFLICT    = 20, // for stack value type with conflicting contents
 688   T_ILLEGAL     = 99
 689 };
 690 
 691 #define SIGNATURE_TYPES_DO(F, N)                \
 692     F(JVM_SIGNATURE_BOOLEAN, T_BOOLEAN, N)      \
 693     F(JVM_SIGNATURE_CHAR,    T_CHAR,    N)      \
 694     F(JVM_SIGNATURE_FLOAT,   T_FLOAT,   N)      \
 695     F(JVM_SIGNATURE_DOUBLE,  T_DOUBLE,  N)      \
 696     F(JVM_SIGNATURE_BYTE,    T_BYTE,    N)      \
 697     F(JVM_SIGNATURE_SHORT,   T_SHORT,   N)      \
 698     F(JVM_SIGNATURE_INT,     T_INT,     N)      \
 699     F(JVM_SIGNATURE_LONG,    T_LONG,    N)      \
 700     F(JVM_SIGNATURE_CLASS,   T_OBJECT,  N)      \
 701     F(JVM_SIGNATURE_ARRAY,   T_ARRAY,   N)      \
 702     F(JVM_SIGNATURE_PRIMITIVE_OBJECT, T_PRIMITIVE_OBJECT, N) \
 703     F(JVM_SIGNATURE_VOID,    T_VOID,    N)      \
 704     /*end*/
 705 
 706 inline bool is_java_type(BasicType t) {
 707   return T_BOOLEAN <= t && t <= T_VOID;
 708 }
 709 
 710 inline bool is_java_primitive(BasicType t) {
 711   return T_BOOLEAN <= t && t <= T_LONG;
 712 }
 713 
 714 inline bool is_subword_type(BasicType t) {
 715   // these guys are processed exactly like T_INT in calling sequences:
 716   return (t == T_BOOLEAN || t == T_CHAR || t == T_BYTE || t == T_SHORT);
 717 }
 718 
 719 inline bool is_signed_subword_type(BasicType t) {
 720   return (t == T_BYTE || t == T_SHORT);
 721 }
 722 
 723 inline bool is_double_word_type(BasicType t) {
 724   return (t == T_DOUBLE || t == T_LONG);
 725 }
 726 
 727 inline bool is_reference_type(BasicType t) {
 728   return (t == T_OBJECT || t == T_ARRAY || t == T_PRIMITIVE_OBJECT);
 729 }
 730 
 731 inline bool is_integral_type(BasicType t) {
 732   return is_subword_type(t) || t == T_INT || t == T_LONG;
 733 }
 734 
 735 inline bool is_floating_point_type(BasicType t) {
 736   return (t == T_FLOAT || t == T_DOUBLE);
 737 }
 738 
 739 extern char type2char_tab[T_CONFLICT+1];     // Map a BasicType to a jchar
 740 inline char type2char(BasicType t) { return (uint)t < T_CONFLICT+1 ? type2char_tab[t] : 0; }
 741 extern int type2size[T_CONFLICT+1];         // Map BasicType to result stack elements
 742 extern const char* type2name_tab[T_CONFLICT+1];     // Map a BasicType to a jchar
 743 inline const char* type2name(BasicType t) { return (uint)t < T_CONFLICT+1 ? type2name_tab[t] : NULL; }
 744 extern BasicType name2type(const char* name);
 745 
 746 inline jlong max_signed_integer(BasicType bt) {
 747   if (bt == T_INT) {
 748     return max_jint;

 761 
 762 // Auxiliary math routines
 763 // least common multiple
 764 extern size_t lcm(size_t a, size_t b);
 765 
 766 
 767 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
 768 enum BasicTypeSize {
 769   T_BOOLEAN_size     = 1,
 770   T_CHAR_size        = 1,
 771   T_FLOAT_size       = 1,
 772   T_DOUBLE_size      = 2,
 773   T_BYTE_size        = 1,
 774   T_SHORT_size       = 1,
 775   T_INT_size         = 1,
 776   T_LONG_size        = 2,
 777   T_OBJECT_size      = 1,
 778   T_ARRAY_size       = 1,
 779   T_NARROWOOP_size   = 1,
 780   T_NARROWKLASS_size = 1,
 781   T_VOID_size        = 0,
 782   T_PRIMITIVE_OBJECT_size = 1
 783 };
 784 
 785 // this works on valid parameter types but not T_VOID, T_CONFLICT, etc.
 786 inline int parameter_type_word_count(BasicType t) {
 787   if (is_double_word_type(t))  return 2;
 788   assert(is_java_primitive(t) || is_reference_type(t), "no goofy types here please");
 789   assert(type2size[t] == 1, "must be");
 790   return 1;
 791 }
 792 
 793 // maps a BasicType to its instance field storage type:
 794 // all sub-word integral types are widened to T_INT
 795 extern BasicType type2field[T_CONFLICT+1];
 796 extern BasicType type2wfield[T_CONFLICT+1];
 797 
 798 
 799 // size in bytes
 800 enum ArrayElementSize {
 801   T_BOOLEAN_aelem_bytes     = 1,
 802   T_CHAR_aelem_bytes        = 2,
 803   T_FLOAT_aelem_bytes       = 4,
 804   T_DOUBLE_aelem_bytes      = 8,
 805   T_BYTE_aelem_bytes        = 1,
 806   T_SHORT_aelem_bytes       = 2,
 807   T_INT_aelem_bytes         = 4,
 808   T_LONG_aelem_bytes        = 8,
 809 #ifdef _LP64
 810   T_OBJECT_aelem_bytes      = 8,
 811   T_ARRAY_aelem_bytes       = 8,
 812   T_PRIMITIVE_OBJECT_aelem_bytes = 8,
 813 #else
 814   T_OBJECT_aelem_bytes      = 4,
 815   T_ARRAY_aelem_bytes       = 4,
 816   T_PRIMITIVE_OBJECT_aelem_bytes = 4,
 817 #endif
 818   T_NARROWOOP_aelem_bytes   = 4,
 819   T_NARROWKLASS_aelem_bytes = 4,
 820   T_VOID_aelem_bytes        = 0
 821 };
 822 
 823 extern int _type2aelembytes[T_CONFLICT+1]; // maps a BasicType to nof bytes used by its array element
 824 #ifdef ASSERT
 825 extern int type2aelembytes(BasicType t, bool allow_address = false); // asserts
 826 #else
 827 inline int type2aelembytes(BasicType t, bool allow_address = false) { return _type2aelembytes[t]; }
 828 #endif
 829 
 830 
 831 // JavaValue serves as a container for arbitrary Java values.
 832 
 833 class JavaValue {
 834 
 835  public:
 836   typedef union JavaCallValue {

 886 
 887 // TosState describes the top-of-stack state before and after the execution of
 888 // a bytecode or method. The top-of-stack value may be cached in one or more CPU
 889 // registers. The TosState corresponds to the 'machine representation' of this cached
 890 // value. There's 4 states corresponding to the JAVA types int, long, float & double
 891 // as well as a 5th state in case the top-of-stack value is actually on the top
 892 // of stack (in memory) and thus not cached. The atos state corresponds to the itos
 893 // state when it comes to machine representation but is used separately for (oop)
 894 // type specific operations (e.g. verification code).
 895 
 896 enum TosState {         // describes the tos cache contents
 897   btos = 0,             // byte, bool tos cached
 898   ztos = 1,             // byte, bool tos cached
 899   ctos = 2,             // char tos cached
 900   stos = 3,             // short tos cached
 901   itos = 4,             // int tos cached
 902   ltos = 5,             // long tos cached
 903   ftos = 6,             // float tos cached
 904   dtos = 7,             // double tos cached
 905   atos = 8,             // object cached
 906   vtos = 9,             // tos not cached,
 907   number_of_states,
 908   ilgl                  // illegal state: should not occur
 909 };
 910 
 911 
 912 inline TosState as_TosState(BasicType type) {
 913   switch (type) {
 914     case T_BYTE   : return btos;
 915     case T_BOOLEAN: return ztos;
 916     case T_CHAR   : return ctos;
 917     case T_SHORT  : return stos;
 918     case T_INT    : return itos;
 919     case T_LONG   : return ltos;
 920     case T_FLOAT  : return ftos;
 921     case T_DOUBLE : return dtos;
 922     case T_VOID   : return vtos;
 923     case T_PRIMITIVE_OBJECT: // fall through
 924     case T_ARRAY  :   // fall through
 925     case T_OBJECT : return atos;
 926     default       : return ilgl;
 927   }
 928 }
 929 
 930 inline BasicType as_BasicType(TosState state) {
 931   switch (state) {
 932     case btos : return T_BYTE;
 933     case ztos : return T_BOOLEAN;
 934     case ctos : return T_CHAR;
 935     case stos : return T_SHORT;
 936     case itos : return T_INT;
 937     case ltos : return T_LONG;
 938     case ftos : return T_FLOAT;
 939     case dtos : return T_DOUBLE;
 940     case atos : return T_OBJECT;
 941     case vtos : return T_VOID;
 942     default   : return T_ILLEGAL;
 943   }
 944 }

1217 
1218 //----------------------------------------------------------------------------------------------------
1219 // String type aliases used by command line flag declarations and
1220 // processing utilities.
1221 
1222 typedef const char* ccstr;
1223 typedef const char* ccstrlist;   // represents string arguments which accumulate
1224 
1225 //----------------------------------------------------------------------------------------------------
1226 // Default hash/equals functions used by ResourceHashtable
1227 
1228 template<typename K> unsigned primitive_hash(const K& k) {
1229   unsigned hash = (unsigned)((uintptr_t)k);
1230   return hash ^ (hash >> 3); // just in case we're dealing with aligned ptrs
1231 }
1232 
1233 template<typename K> bool primitive_equals(const K& k0, const K& k1) {
1234   return k0 == k1;
1235 }
1236 
1237 // TEMP!!!!
1238 // This should be removed after LW2 arrays are implemented (JDK-8220790).
1239 // It's an alias to (EnableValhalla && (FlatArrayElementMaxSize != 0)),
1240 // which is actually not 100% correct, but works for the current set of C1/C2
1241 // implementation and test cases.
1242 #define UseFlatArray (EnableValhalla && (FlatArrayElementMaxSize != 0))
1243 //----------------------------------------------------------------------------------------------------
1244 
1245 // Allow use of C++ thread_local when approved - see JDK-8282469.
1246 #define APPROVED_CPP_THREAD_LOCAL thread_local
1247 
1248 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_HPP
< prev index next >