< prev index next >

src/hotspot/share/utilities/globalDefinitions.hpp

Print this page




 577 
 578 
 579 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
 580 enum BasicType {
 581   T_BOOLEAN     =  4,
 582   T_CHAR        =  5,
 583   T_FLOAT       =  6,
 584   T_DOUBLE      =  7,
 585   T_BYTE        =  8,
 586   T_SHORT       =  9,
 587   T_INT         = 10,
 588   T_LONG        = 11,
 589   T_OBJECT      = 12,
 590   T_ARRAY       = 13,
 591   T_VALUETYPE   = 14,
 592   T_VOID        = 15,
 593   T_ADDRESS     = 16,
 594   T_NARROWOOP   = 17,
 595   T_METADATA    = 18,
 596   T_NARROWKLASS = 19,
 597   T_VALUETYPEPTR= 20, // the compiler needs a way to identify buffered values
 598   T_CONFLICT    = 21, // for stack value type with conflicting contents
 599   T_ILLEGAL     = 99
 600 };
 601 
 602 inline bool is_java_primitive(BasicType t) {
 603   return T_BOOLEAN <= t && t <= T_LONG;
 604 }
 605 
 606 inline bool is_subword_type(BasicType t) {
 607   // these guys are processed exactly like T_INT in calling sequences:
 608   return (t == T_BOOLEAN || t == T_CHAR || t == T_BYTE || t == T_SHORT);
 609 }
 610 
 611 inline bool is_signed_subword_type(BasicType t) {
 612   return (t == T_BYTE || t == T_SHORT);
 613 }
 614 
 615 inline bool is_reference_type(BasicType t) {
 616   return (t == T_OBJECT || t == T_ARRAY);
 617 }
 618 


 676 enum ArrayElementSize {
 677   T_BOOLEAN_aelem_bytes     = 1,
 678   T_CHAR_aelem_bytes        = 2,
 679   T_FLOAT_aelem_bytes       = 4,
 680   T_DOUBLE_aelem_bytes      = 8,
 681   T_BYTE_aelem_bytes        = 1,
 682   T_SHORT_aelem_bytes       = 2,
 683   T_INT_aelem_bytes         = 4,
 684   T_LONG_aelem_bytes        = 8,
 685 #ifdef _LP64
 686   T_OBJECT_aelem_bytes      = 8,
 687   T_ARRAY_aelem_bytes       = 8,
 688   T_VALUETYPE_aelem_bytes   = 8,
 689 #else
 690   T_OBJECT_aelem_bytes      = 4,
 691   T_ARRAY_aelem_bytes       = 4,
 692   T_VALUETYPE_aelem_bytes   = 4,
 693 #endif
 694   T_NARROWOOP_aelem_bytes   = 4,
 695   T_NARROWKLASS_aelem_bytes = 4,
 696   T_VOID_aelem_bytes        = 0,
 697 #ifdef _LP64
 698   T_VALUETYPEPTR_aelem_bytes= 8
 699 #else
 700   T_VALUETYPEPTR_aelem_bytes= 4
 701 #endif
 702 };
 703 
 704 extern int _type2aelembytes[T_CONFLICT+1]; // maps a BasicType to nof bytes used by its array element
 705 #ifdef ASSERT
 706 extern int type2aelembytes(BasicType t, bool allow_address = false); // asserts
 707 #else
 708 inline int type2aelembytes(BasicType t, bool allow_address = false) { return _type2aelembytes[t]; }
 709 #endif
 710 
 711 
 712 // JavaValue serves as a container for arbitrary Java values.
 713 
 714 class JavaValue {
 715 
 716  public:
 717   typedef union JavaCallValue {
 718     jfloat   f;
 719     jdouble  d;
 720     jint     i;
 721     jlong    l;




 577 
 578 
 579 // NOTE: replicated in SA in vm/agent/sun/jvm/hotspot/runtime/BasicType.java
 580 enum BasicType {
 581   T_BOOLEAN     =  4,
 582   T_CHAR        =  5,
 583   T_FLOAT       =  6,
 584   T_DOUBLE      =  7,
 585   T_BYTE        =  8,
 586   T_SHORT       =  9,
 587   T_INT         = 10,
 588   T_LONG        = 11,
 589   T_OBJECT      = 12,
 590   T_ARRAY       = 13,
 591   T_VALUETYPE   = 14,
 592   T_VOID        = 15,
 593   T_ADDRESS     = 16,
 594   T_NARROWOOP   = 17,
 595   T_METADATA    = 18,
 596   T_NARROWKLASS = 19,
 597   T_CONFLICT    = 20, // for stack value type with conflicting contents

 598   T_ILLEGAL     = 99
 599 };
 600 
 601 inline bool is_java_primitive(BasicType t) {
 602   return T_BOOLEAN <= t && t <= T_LONG;
 603 }
 604 
 605 inline bool is_subword_type(BasicType t) {
 606   // these guys are processed exactly like T_INT in calling sequences:
 607   return (t == T_BOOLEAN || t == T_CHAR || t == T_BYTE || t == T_SHORT);
 608 }
 609 
 610 inline bool is_signed_subword_type(BasicType t) {
 611   return (t == T_BYTE || t == T_SHORT);
 612 }
 613 
 614 inline bool is_reference_type(BasicType t) {
 615   return (t == T_OBJECT || t == T_ARRAY);
 616 }
 617 


 675 enum ArrayElementSize {
 676   T_BOOLEAN_aelem_bytes     = 1,
 677   T_CHAR_aelem_bytes        = 2,
 678   T_FLOAT_aelem_bytes       = 4,
 679   T_DOUBLE_aelem_bytes      = 8,
 680   T_BYTE_aelem_bytes        = 1,
 681   T_SHORT_aelem_bytes       = 2,
 682   T_INT_aelem_bytes         = 4,
 683   T_LONG_aelem_bytes        = 8,
 684 #ifdef _LP64
 685   T_OBJECT_aelem_bytes      = 8,
 686   T_ARRAY_aelem_bytes       = 8,
 687   T_VALUETYPE_aelem_bytes   = 8,
 688 #else
 689   T_OBJECT_aelem_bytes      = 4,
 690   T_ARRAY_aelem_bytes       = 4,
 691   T_VALUETYPE_aelem_bytes   = 4,
 692 #endif
 693   T_NARROWOOP_aelem_bytes   = 4,
 694   T_NARROWKLASS_aelem_bytes = 4,
 695   T_VOID_aelem_bytes        = 0





 696 };
 697 
 698 extern int _type2aelembytes[T_CONFLICT+1]; // maps a BasicType to nof bytes used by its array element
 699 #ifdef ASSERT
 700 extern int type2aelembytes(BasicType t, bool allow_address = false); // asserts
 701 #else
 702 inline int type2aelembytes(BasicType t, bool allow_address = false) { return _type2aelembytes[t]; }
 703 #endif
 704 
 705 
 706 // JavaValue serves as a container for arbitrary Java values.
 707 
 708 class JavaValue {
 709 
 710  public:
 711   typedef union JavaCallValue {
 712     jfloat   f;
 713     jdouble  d;
 714     jint     i;
 715     jlong    l;


< prev index next >