< prev index next >

src/hotspot/share/utilities/globalDefinitions.hpp

Print this page

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









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

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

 668   T_ILLEGAL     = 99
 669 };
 670 
 671 #define SIGNATURE_TYPES_DO(F, N)                \
 672     F(JVM_SIGNATURE_BOOLEAN, T_BOOLEAN, N)      \
 673     F(JVM_SIGNATURE_CHAR,    T_CHAR,    N)      \
 674     F(JVM_SIGNATURE_FLOAT,   T_FLOAT,   N)      \
 675     F(JVM_SIGNATURE_DOUBLE,  T_DOUBLE,  N)      \
 676     F(JVM_SIGNATURE_BYTE,    T_BYTE,    N)      \
 677     F(JVM_SIGNATURE_SHORT,   T_SHORT,   N)      \
 678     F(JVM_SIGNATURE_INT,     T_INT,     N)      \
 679     F(JVM_SIGNATURE_LONG,    T_LONG,    N)      \
 680     F(JVM_SIGNATURE_CLASS,   T_OBJECT,  N)      \
 681     F(JVM_SIGNATURE_ARRAY,   T_ARRAY,   N)      \

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

 740 
 741 // Auxiliary math routines
 742 // least common multiple
 743 extern size_t lcm(size_t a, size_t b);
 744 
 745 
 746 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
 747 enum BasicTypeSize {
 748   T_BOOLEAN_size     = 1,
 749   T_CHAR_size        = 1,
 750   T_FLOAT_size       = 1,
 751   T_DOUBLE_size      = 2,
 752   T_BYTE_size        = 1,
 753   T_SHORT_size       = 1,
 754   T_INT_size         = 1,
 755   T_LONG_size        = 2,
 756   T_OBJECT_size      = 1,
 757   T_ARRAY_size       = 1,
 758   T_NARROWOOP_size   = 1,
 759   T_NARROWKLASS_size = 1,
 760   T_VOID_size        = 0

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

 790 #else
 791   T_OBJECT_aelem_bytes      = 4,
 792   T_ARRAY_aelem_bytes       = 4,

 793 #endif
 794   T_NARROWOOP_aelem_bytes   = 4,
 795   T_NARROWKLASS_aelem_bytes = 4,
 796   T_VOID_aelem_bytes        = 0
 797 };
 798 
 799 extern int _type2aelembytes[T_CONFLICT+1]; // maps a BasicType to nof bytes used by its array element
 800 #ifdef ASSERT
 801 extern int type2aelembytes(BasicType t, bool allow_address = false); // asserts
 802 #else
 803 inline int type2aelembytes(BasicType t, bool allow_address = false) { return _type2aelembytes[t]; }
 804 #endif
 805 
 806 
 807 // JavaValue serves as a container for arbitrary Java values.
 808 
 809 class JavaValue {
 810 
 811  public:
 812   typedef union JavaCallValue {

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

 900     case T_OBJECT : return atos;
 901     default       : return ilgl;
 902   }
 903 }
 904 
 905 inline BasicType as_BasicType(TosState state) {
 906   switch (state) {
 907     case btos : return T_BYTE;
 908     case ztos : return T_BOOLEAN;
 909     case ctos : return T_CHAR;
 910     case stos : return T_SHORT;
 911     case itos : return T_INT;
 912     case ltos : return T_LONG;
 913     case ftos : return T_FLOAT;
 914     case dtos : return T_DOUBLE;
 915     case atos : return T_OBJECT;
 916     case vtos : return T_VOID;
 917     default   : return T_ILLEGAL;
 918   }
 919 }

1192 
1193 //----------------------------------------------------------------------------------------------------
1194 // String type aliases used by command line flag declarations and
1195 // processing utilities.
1196 
1197 typedef const char* ccstr;
1198 typedef const char* ccstrlist;   // represents string arguments which accumulate
1199 
1200 //----------------------------------------------------------------------------------------------------
1201 // Default hash/equals functions used by ResourceHashtable
1202 
1203 template<typename K> unsigned primitive_hash(const K& k) {
1204   unsigned hash = (unsigned)((uintptr_t)k);
1205   return hash ^ (hash >> 3); // just in case we're dealing with aligned ptrs
1206 }
1207 
1208 template<typename K> bool primitive_equals(const K& k0, const K& k1) {
1209   return k0 == k1;
1210 }
1211 






1212 
1213 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_HPP

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

 651 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
 652 enum BasicType {
 653 // The values T_BOOLEAN..T_LONG (4..11) are derived from the JVMS.
 654   T_BOOLEAN     = JVM_T_BOOLEAN,
 655   T_CHAR        = JVM_T_CHAR,
 656   T_FLOAT       = JVM_T_FLOAT,
 657   T_DOUBLE      = JVM_T_DOUBLE,
 658   T_BYTE        = JVM_T_BYTE,
 659   T_SHORT       = JVM_T_SHORT,
 660   T_INT         = JVM_T_INT,
 661   T_LONG        = JVM_T_LONG,
 662   // The remaining values are not part of any standard.
 663   // T_OBJECT and T_VOID denote two more semantic choices
 664   // for method return values.
 665   // T_OBJECT and T_ARRAY describe signature syntax.
 666   // T_ADDRESS, T_METADATA, T_NARROWOOP, T_NARROWKLASS describe
 667   // internal references within the JVM as if they were Java
 668   // types in their own right.
 669   T_OBJECT      = 12,
 670   T_ARRAY       = 13,
 671   T_INLINE_TYPE = 14,
 672   T_VOID        = 15,
 673   T_ADDRESS     = 16,
 674   T_NARROWOOP   = 17,
 675   T_METADATA    = 18,
 676   T_NARROWKLASS = 19,
 677   T_CONFLICT    = 20, // 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_INLINE_TYPE, T_INLINE_TYPE, N) \
 693     F(JVM_SIGNATURE_VOID,    T_VOID,    N)      \
 694     /*end*/
 695 
 696 inline bool is_java_type(BasicType t) {
 697   return T_BOOLEAN <= t && t <= T_VOID;
 698 }
 699 
 700 inline bool is_java_primitive(BasicType t) {
 701   return T_BOOLEAN <= t && t <= T_LONG;
 702 }
 703 
 704 inline bool is_subword_type(BasicType t) {
 705   // these guys are processed exactly like T_INT in calling sequences:
 706   return (t == T_BOOLEAN || t == T_CHAR || t == T_BYTE || t == T_SHORT);
 707 }
 708 
 709 inline bool is_signed_subword_type(BasicType t) {
 710   return (t == T_BYTE || t == T_SHORT);
 711 }
 712 
 713 inline bool is_double_word_type(BasicType t) {
 714   return (t == T_DOUBLE || t == T_LONG);
 715 }
 716 
 717 inline bool is_reference_type(BasicType t) {
 718   return (t == T_OBJECT || t == T_ARRAY || t == T_INLINE_TYPE);
 719 }
 720 
 721 inline bool is_integral_type(BasicType t) {
 722   return is_subword_type(t) || t == T_INT || t == T_LONG;
 723 }
 724 
 725 inline bool is_floating_point_type(BasicType t) {
 726   return (t == T_FLOAT || t == T_DOUBLE);
 727 }
 728 
 729 extern char type2char_tab[T_CONFLICT+1];     // Map a BasicType to a jchar
 730 inline char type2char(BasicType t) { return (uint)t < T_CONFLICT+1 ? type2char_tab[t] : 0; }
 731 extern int type2size[T_CONFLICT+1];         // Map BasicType to result stack elements
 732 extern const char* type2name_tab[T_CONFLICT+1];     // Map a BasicType to a jchar
 733 inline const char* type2name(BasicType t) { return (uint)t < T_CONFLICT+1 ? type2name_tab[t] : NULL; }
 734 extern BasicType name2type(const char* name);
 735 
 736 inline jlong max_signed_integer(BasicType bt) {
 737   if (bt == T_INT) {
 738     return max_jint;

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

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

1207 
1208 //----------------------------------------------------------------------------------------------------
1209 // String type aliases used by command line flag declarations and
1210 // processing utilities.
1211 
1212 typedef const char* ccstr;
1213 typedef const char* ccstrlist;   // represents string arguments which accumulate
1214 
1215 //----------------------------------------------------------------------------------------------------
1216 // Default hash/equals functions used by ResourceHashtable
1217 
1218 template<typename K> unsigned primitive_hash(const K& k) {
1219   unsigned hash = (unsigned)((uintptr_t)k);
1220   return hash ^ (hash >> 3); // just in case we're dealing with aligned ptrs
1221 }
1222 
1223 template<typename K> bool primitive_equals(const K& k0, const K& k1) {
1224   return k0 == k1;
1225 }
1226 
1227 // TEMP!!!!
1228 // This should be removed after LW2 arrays are implemented (JDK-8220790).
1229 // It's an alias to (EnableValhalla && (FlatArrayElementMaxSize != 0)),
1230 // which is actually not 100% correct, but works for the current set of C1/C2
1231 // implementation and test cases.
1232 #define UseFlatArray (EnableValhalla && (FlatArrayElementMaxSize != 0))
1233 
1234 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_HPP
< prev index next >