< prev index next >

src/hotspot/share/utilities/globalDefinitions.hpp

Print this page

        

@@ -492,10 +492,19 @@
 
 #define Unused_Variable(var) var
 
 
 //----------------------------------------------------------------------------------------------------
+// Prototyping
+// "Code Missing Here" macro, un-define when integrating back from prototyping stage and break
+// compilation on purpose (i.e. "forget me not")
+#define PROTOTYPE
+#ifdef PROTOTYPE
+#define CMH(m)
+#endif
+
+//----------------------------------------------------------------------------------------------------
 // Miscellaneous
 
 // 6302670 Eliminate Hotspot __fabsf dependency
 // All fabs() callers should call this function instead, which will implicitly
 // convert the operand to double, avoiding a dependency on __fabsf which

@@ -568,16 +577,17 @@
   T_SHORT       =  9,
   T_INT         = 10,
   T_LONG        = 11,
   T_OBJECT      = 12,
   T_ARRAY       = 13,
-  T_VOID        = 14,
-  T_ADDRESS     = 15,
-  T_NARROWOOP   = 16,
-  T_METADATA    = 17,
-  T_NARROWKLASS = 18,
-  T_CONFLICT    = 19, // for stack value type with conflicting contents
+  T_VALUETYPE   = 14,
+  T_VOID        = 15,
+  T_ADDRESS     = 16,
+  T_NARROWOOP   = 17,
+  T_METADATA    = 18,
+  T_NARROWKLASS = 19,
+  T_CONFLICT    = 20, // for stack value type with conflicting contents
   T_ILLEGAL     = 99
 };
 
 inline bool is_java_primitive(BasicType t) {
   return T_BOOLEAN <= t && t <= T_LONG;

@@ -591,11 +601,11 @@
 inline bool is_signed_subword_type(BasicType t) {
   return (t == T_BYTE || t == T_SHORT);
 }
 
 inline bool is_reference_type(BasicType t) {
-  return (t == T_OBJECT || t == T_ARRAY);
+  return (t == T_OBJECT || t == T_ARRAY || t == T_VALUETYPE);
 }
 
 // Convert a char from a classfile signature to a BasicType
 inline BasicType char2type(char c) {
   switch( c ) {

@@ -608,10 +618,11 @@
   case 'S': return T_SHORT;
   case 'Z': return T_BOOLEAN;
   case 'V': return T_VOID;
   case 'L': return T_OBJECT;
   case '[': return T_ARRAY;
+  case 'Q': return T_VALUETYPE;
   }
   return T_ILLEGAL;
 }
 
 extern char type2char_tab[T_CONFLICT+1];     // Map a BasicType to a jchar

@@ -638,11 +649,12 @@
   T_LONG_size        = 2,
   T_OBJECT_size      = 1,
   T_ARRAY_size       = 1,
   T_NARROWOOP_size   = 1,
   T_NARROWKLASS_size = 1,
-  T_VOID_size        = 0
+  T_VOID_size        = 0,
+  T_VALUETYPE_size   = 1
 };
 
 
 // maps a BasicType to its instance field storage type:
 // all sub-word integral types are widened to T_INT

@@ -661,13 +673,15 @@
   T_INT_aelem_bytes         = 4,
   T_LONG_aelem_bytes        = 8,
 #ifdef _LP64
   T_OBJECT_aelem_bytes      = 8,
   T_ARRAY_aelem_bytes       = 8,
+  T_VALUETYPE_aelem_bytes   = 8,
 #else
   T_OBJECT_aelem_bytes      = 4,
   T_ARRAY_aelem_bytes       = 4,
+  T_VALUETYPE_aelem_bytes   = 4,
 #endif
   T_NARROWOOP_aelem_bytes   = 4,
   T_NARROWKLASS_aelem_bytes = 4,
   T_VOID_aelem_bytes        = 0
 };

@@ -759,11 +773,11 @@
   itos = 4,             // int tos cached
   ltos = 5,             // long tos cached
   ftos = 6,             // float tos cached
   dtos = 7,             // double tos cached
   atos = 8,             // object cached
-  vtos = 9,             // tos not cached
+  vtos = 9,             // tos not cached,
   number_of_states,
   ilgl                  // illegal state: should not occur
 };
 
 

@@ -776,11 +790,12 @@
     case T_INT    : return itos;
     case T_LONG   : return ltos;
     case T_FLOAT  : return ftos;
     case T_DOUBLE : return dtos;
     case T_VOID   : return vtos;
-    case T_ARRAY  : // fall through
+    case T_VALUETYPE: // fall through
+    case T_ARRAY  :   // fall through
     case T_OBJECT : return atos;
     default       : return ilgl;
   }
 }
 

@@ -991,10 +1006,20 @@
 inline int exact_log2(intptr_t x) {
   assert(is_power_of_2(x), "x must be a power of 2: " INTPTR_FORMAT, x);
   return log2_intptr(x);
 }
 
+// the argument doesn't need to be a power of two
+inline int upper_log2(intptr_t x) {
+  int shift = log2_intptr(x);
+  intptr_t y = 1ULL << shift;
+  if (y < x) {
+    shift++;
+  }
+  return shift;
+}
+
 //* the argument must be exactly a power of 2
 inline int exact_log2_long(jlong x) {
   assert(is_power_of_2_long(x), "x must be a power of 2: " JLONG_FORMAT, x);
   return log2_long(x);
 }

@@ -1132,7 +1157,13 @@
 
 template<typename K> bool primitive_equals(const K& k0, const K& k1) {
   return k0 == k1;
 }
 
+// TEMP!!!!
+// This should be removed after LW2 arrays are implemented (JDK-8220790).
+// It's an alias to (EnableValhalla && (ValueArrayElemMaxFlatSize != 0)),
+// which is actually not 100% correct, but works for the current set of C1/C2
+// implementation and test cases.
+#define ValueArrayFlatten (EnableValhalla && (ValueArrayElemMaxFlatSize != 0))
 
 #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_HPP
< prev index next >