1.1 --- a/src/share/vm/utilities/globalDefinitions.cpp Fri Apr 11 09:56:35 2008 -0400 1.2 +++ b/src/share/vm/utilities/globalDefinitions.cpp Sun Apr 13 17:43:42 2008 -0400 1.3 @@ -24,18 +24,23 @@ 1.4 1.5 # include "incls/_precompiled.incl" 1.6 # include "incls/_globalDefinitions.cpp.incl" 1.7 +// Basic error support 1.8 1.9 - 1.10 -// Basic error support 1.11 +// Info for oops within a java object. Defaults are zero so 1.12 +// things will break badly if incorrectly initialized. 1.13 +int heapOopSize = 0; 1.14 +int LogBytesPerHeapOop = 0; 1.15 +int LogBitsPerHeapOop = 0; 1.16 +int BytesPerHeapOop = 0; 1.17 +int BitsPerHeapOop = 0; 1.18 1.19 void basic_fatal(const char* msg) { 1.20 fatal(msg); 1.21 } 1.22 1.23 - 1.24 // Something to help porters sleep at night 1.25 1.26 -void check_basic_types() { 1.27 +void basic_types_init() { 1.28 #ifdef ASSERT 1.29 #ifdef _LP64 1.30 assert(min_intx == (intx)CONST64(0x8000000000000000), "correct constant"); 1.31 @@ -92,6 +97,7 @@ 1.32 case T_LONG: 1.33 case T_OBJECT: 1.34 case T_ADDRESS: // random raw pointer 1.35 + case T_NARROWOOP: // compressed pointer 1.36 case T_CONFLICT: // might as well support a bottom type 1.37 case T_VOID: // padding or other unaddressed word 1.38 // layout type must map to itself 1.39 @@ -134,11 +140,30 @@ 1.40 os::java_to_os_priority[9] = JavaPriority9_To_OSPriority; 1.41 if(JavaPriority10_To_OSPriority != -1 ) 1.42 os::java_to_os_priority[10] = JavaPriority10_To_OSPriority; 1.43 + 1.44 + // Set the size of basic types here (after argument parsing but before 1.45 + // stub generation). 1.46 + if (UseCompressedOops) { 1.47 + // Size info for oops within java objects is fixed 1.48 + heapOopSize = jintSize; 1.49 + LogBytesPerHeapOop = LogBytesPerInt; 1.50 + LogBitsPerHeapOop = LogBitsPerInt; 1.51 + BytesPerHeapOop = BytesPerInt; 1.52 + BitsPerHeapOop = BitsPerInt; 1.53 + } else { 1.54 + heapOopSize = oopSize; 1.55 + LogBytesPerHeapOop = LogBytesPerWord; 1.56 + LogBitsPerHeapOop = LogBitsPerWord; 1.57 + BytesPerHeapOop = BytesPerWord; 1.58 + BitsPerHeapOop = BitsPerWord; 1.59 + } 1.60 + _type2aelembytes[T_OBJECT] = heapOopSize; 1.61 + _type2aelembytes[T_ARRAY] = heapOopSize; 1.62 } 1.63 1.64 1.65 // Map BasicType to signature character 1.66 -char type2char_tab[T_CONFLICT+1]={ 0, 0, 0, 0, 'Z', 'C', 'F', 'D', 'B', 'S', 'I', 'J', 'L', '[', 'V', 0, 0}; 1.67 +char type2char_tab[T_CONFLICT+1]={ 0, 0, 0, 0, 'Z', 'C', 'F', 'D', 'B', 'S', 'I', 'J', 'L', '[', 'V', 0, 0, 0}; 1.68 1.69 // Map BasicType to Java type name 1.70 const char* type2name_tab[T_CONFLICT+1] = { 1.71 @@ -155,6 +180,7 @@ 1.72 "array", 1.73 "void", 1.74 "*address*", 1.75 + "*narrowoop*", 1.76 "*conflict*" 1.77 }; 1.78 1.79 @@ -170,7 +196,7 @@ 1.80 1.81 1.82 // Map BasicType to size in words 1.83 -int type2size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, -1}; 1.84 +int type2size[T_CONFLICT+1]={ -1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 0, 1, 1, -1}; 1.85 1.86 BasicType type2field[T_CONFLICT+1] = { 1.87 (BasicType)0, // 0, 1.88 @@ -189,7 +215,8 @@ 1.89 T_OBJECT, // T_ARRAY = 13, 1.90 T_VOID, // T_VOID = 14, 1.91 T_ADDRESS, // T_ADDRESS = 15, 1.92 - T_CONFLICT // T_CONFLICT = 16, 1.93 + T_NARROWOOP, // T_NARROWOOP= 16, 1.94 + T_CONFLICT // T_CONFLICT = 17, 1.95 }; 1.96 1.97 1.98 @@ -210,7 +237,8 @@ 1.99 T_OBJECT, // T_ARRAY = 13, 1.100 T_VOID, // T_VOID = 14, 1.101 T_ADDRESS, // T_ADDRESS = 15, 1.102 - T_CONFLICT // T_CONFLICT = 16, 1.103 + T_NARROWOOP, // T_NARROWOOP = 16, 1.104 + T_CONFLICT // T_CONFLICT = 17, 1.105 }; 1.106 1.107 1.108 @@ -231,7 +259,8 @@ 1.109 T_ARRAY_aelem_bytes, // T_ARRAY = 13, 1.110 0, // T_VOID = 14, 1.111 T_OBJECT_aelem_bytes, // T_ADDRESS = 15, 1.112 - 0 // T_CONFLICT = 16, 1.113 + T_NARROWOOP_aelem_bytes,// T_NARROWOOP= 16, 1.114 + 0 // T_CONFLICT = 17, 1.115 }; 1.116 1.117 #ifdef ASSERT 1.118 @@ -245,7 +274,7 @@ 1.119 1.120 // The following code is mostly taken from JVM typedefs_md.h and system_md.c 1.121 1.122 -static const jlong high_bit = (jlong)1 << (jlong)63; 1.123 +static const jlong high_bit = (jlong)1 << (jlong)63; 1.124 static const jlong other_bits = ~high_bit; 1.125 1.126 jlong float2long(jfloat f) {