< prev index next >

test/hotspot/gtest/oops/test_arrayOop.cpp

Print this page

 70 TEST_VM(arrayOopDesc, int) {
 71   ASSERT_PRED1(check_max_length_overflow, T_INT);
 72 }
 73 
 74 TEST_VM(arrayOopDesc, long) {
 75   ASSERT_PRED1(check_max_length_overflow, T_LONG);
 76 }
 77 
 78 TEST_VM(arrayOopDesc, object) {
 79   ASSERT_PRED1(check_max_length_overflow, T_OBJECT);
 80 }
 81 
 82 TEST_VM(arrayOopDesc, array) {
 83   ASSERT_PRED1(check_max_length_overflow, T_ARRAY);
 84 }
 85 
 86 TEST_VM(arrayOopDesc, narrowOop) {
 87   ASSERT_PRED1(check_max_length_overflow, T_NARROWOOP);
 88 }
 89 // T_VOID and T_ADDRESS are not supported by max_array_length()
























































 70 TEST_VM(arrayOopDesc, int) {
 71   ASSERT_PRED1(check_max_length_overflow, T_INT);
 72 }
 73 
 74 TEST_VM(arrayOopDesc, long) {
 75   ASSERT_PRED1(check_max_length_overflow, T_LONG);
 76 }
 77 
 78 TEST_VM(arrayOopDesc, object) {
 79   ASSERT_PRED1(check_max_length_overflow, T_OBJECT);
 80 }
 81 
 82 TEST_VM(arrayOopDesc, array) {
 83   ASSERT_PRED1(check_max_length_overflow, T_ARRAY);
 84 }
 85 
 86 TEST_VM(arrayOopDesc, narrowOop) {
 87   ASSERT_PRED1(check_max_length_overflow, T_NARROWOOP);
 88 }
 89 // T_VOID and T_ADDRESS are not supported by max_array_length()
 90 
 91 TEST_VM(arrayOopDesc, base_offset) {
 92 #ifdef _LP64
 93   if (UseCompactObjectHeaders) {
 94     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_BOOLEAN), 12);
 95     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_BYTE),    12);
 96     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_SHORT),   12);
 97     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_CHAR),    12);
 98     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_INT),     12);
 99     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_FLOAT),   12);
100     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_LONG),    16);
101     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_DOUBLE),  16);
102     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_OBJECT),  12);
103     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_ARRAY),   12);
104   } else if (UseCompressedClassPointers) {
105     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_BOOLEAN), 16);
106     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_BYTE),    16);
107     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_SHORT),   16);
108     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_CHAR),    16);
109     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_INT),     16);
110     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_FLOAT),   16);
111     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_LONG),    16);
112     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_DOUBLE),  16);
113     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_OBJECT),  16);
114     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_ARRAY),   16);
115   } else {
116     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_BOOLEAN), 20);
117     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_BYTE),    20);
118     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_SHORT),   20);
119     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_CHAR),    20);
120     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_INT),     20);
121     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_FLOAT),   20);
122     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_LONG),    24);
123     EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_DOUBLE),  24);
124     if (UseCompressedOops) {
125       EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_OBJECT), 20);
126       EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_ARRAY),  20);
127     } else {
128       EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_OBJECT), 24);
129       EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_ARRAY),  24);
130     }
131   }
132 #else
133   EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_BOOLEAN), 12);
134   EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_BYTE),    12);
135   EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_SHORT),   12);
136   EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_CHAR),    12);
137   EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_INT),     12);
138   EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_FLOAT),   12);
139   EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_LONG),    16);
140   EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_DOUBLE),  16);
141   EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_OBJECT),  12);
142   EXPECT_EQ(arrayOopDesc::base_offset_in_bytes(T_ARRAY),   12);
143 #endif
144 }
< prev index next >