68 assert(max_intx == 0x7FFFFFFF, "correct constant"); 69 assert(max_uintx == 0xFFFFFFFF, "correct constant"); 70 assert( 4 == sizeof( intx), "wrong size for basic type"); 71 assert( 4 == sizeof( jobject), "wrong size for basic type"); 72 #endif 73 assert( (~max_juint) == 0, "max_juint has all its bits"); 74 assert( (~max_uintx) == 0, "max_uintx has all its bits"); 75 assert( (~max_julong) == 0, "max_julong has all its bits"); 76 assert( 1 == sizeof( jbyte), "wrong size for basic type"); 77 assert( 2 == sizeof( jchar), "wrong size for basic type"); 78 assert( 2 == sizeof( jshort), "wrong size for basic type"); 79 assert( 4 == sizeof( juint), "wrong size for basic type"); 80 assert( 4 == sizeof( jint), "wrong size for basic type"); 81 assert( 1 == sizeof( jboolean), "wrong size for basic type"); 82 assert( 8 == sizeof( jlong), "wrong size for basic type"); 83 assert( 4 == sizeof( jfloat), "wrong size for basic type"); 84 assert( 8 == sizeof( jdouble), "wrong size for basic type"); 85 assert( 1 == sizeof( u1), "wrong size for basic type"); 86 assert( 2 == sizeof( u2), "wrong size for basic type"); 87 assert( 4 == sizeof( u4), "wrong size for basic type"); 88 89 int num_type_chars = 0; 90 for (int i = 0; i < 99; i++) { 91 if (type2char((BasicType)i) != 0) { 92 assert(char2type(type2char((BasicType)i)) == i, "proper inverses"); 93 num_type_chars++; 94 } 95 } 96 assert(num_type_chars == 11, "must have tested the right number of mappings"); 97 assert(char2type(0) == T_ILLEGAL, "correct illegality"); 98 99 { 100 for (int i = T_BOOLEAN; i <= T_CONFLICT; i++) { 101 BasicType vt = (BasicType)i; 102 BasicType ft = type2field[vt]; 103 switch (vt) { 104 // the following types might plausibly show up in memory layouts: 105 case T_BOOLEAN: 106 case T_BYTE: 107 case T_CHAR: | 68 assert(max_intx == 0x7FFFFFFF, "correct constant"); 69 assert(max_uintx == 0xFFFFFFFF, "correct constant"); 70 assert( 4 == sizeof( intx), "wrong size for basic type"); 71 assert( 4 == sizeof( jobject), "wrong size for basic type"); 72 #endif 73 assert( (~max_juint) == 0, "max_juint has all its bits"); 74 assert( (~max_uintx) == 0, "max_uintx has all its bits"); 75 assert( (~max_julong) == 0, "max_julong has all its bits"); 76 assert( 1 == sizeof( jbyte), "wrong size for basic type"); 77 assert( 2 == sizeof( jchar), "wrong size for basic type"); 78 assert( 2 == sizeof( jshort), "wrong size for basic type"); 79 assert( 4 == sizeof( juint), "wrong size for basic type"); 80 assert( 4 == sizeof( jint), "wrong size for basic type"); 81 assert( 1 == sizeof( jboolean), "wrong size for basic type"); 82 assert( 8 == sizeof( jlong), "wrong size for basic type"); 83 assert( 4 == sizeof( jfloat), "wrong size for basic type"); 84 assert( 8 == sizeof( jdouble), "wrong size for basic type"); 85 assert( 1 == sizeof( u1), "wrong size for basic type"); 86 assert( 2 == sizeof( u2), "wrong size for basic type"); 87 assert( 4 == sizeof( u4), "wrong size for basic type"); 88 assert(wordSize == BytesPerWord, "should be the same since they're used interchangeably"); 89 assert(wordSize == HeapWordSize, "should be the same since they're also used interchangeably"); 90 91 int num_type_chars = 0; 92 for (int i = 0; i < 99; i++) { 93 if (type2char((BasicType)i) != 0) { 94 assert(char2type(type2char((BasicType)i)) == i, "proper inverses"); 95 num_type_chars++; 96 } 97 } 98 assert(num_type_chars == 11, "must have tested the right number of mappings"); 99 assert(char2type(0) == T_ILLEGAL, "correct illegality"); 100 101 { 102 for (int i = T_BOOLEAN; i <= T_CONFLICT; i++) { 103 BasicType vt = (BasicType)i; 104 BasicType ft = type2field[vt]; 105 switch (vt) { 106 // the following types might plausibly show up in memory layouts: 107 case T_BOOLEAN: 108 case T_BYTE: 109 case T_CHAR: |