1 /*
2 * Copyright (c) 2020, 2024, Red Hat, Inc. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 8253525
27 * @summary Test for fInst.getObjectSize with 32-bit compressed oops
28 * @library /test/lib
29 *
30 * @build jdk.test.whitebox.WhiteBox
31 * @run build GetObjectSizeIntrinsicsTest
32 * @run shell MakeJAR.sh basicAgent
33 *
34 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
35 *
36 * @run main/othervm -Xmx128m
37 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
38 * -Xint
39 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
40 *
41 * @run main/othervm -Xmx128m
42 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
43 * -Xbatch -XX:TieredStopAtLevel=1
44 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
45 *
46 * @run main/othervm -Xmx128m
47 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
48 * -Xbatch -XX:-TieredCompilation
49 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
50 */
51
52 /*
53 * @test
54 * @summary Test for fInst.getObjectSize with zero-based compressed oops
55 * @library /test/lib
56 * @requires vm.bits == 64
57 *
58 * @build jdk.test.whitebox.WhiteBox
59 * @run build GetObjectSizeIntrinsicsTest
60 * @run shell MakeJAR.sh basicAgent
61 *
62 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
63 *
64 * @run main/othervm -Xmx4g
65 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
66 * -Xint
67 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
68 *
69 * @run main/othervm -Xmx4g
70 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
71 * -Xbatch -XX:TieredStopAtLevel=1
72 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
73 *
74 * @run main/othervm -Xmx4g
75 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
76 * -Xbatch -XX:-TieredCompilation
77 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
78 */
79
80 /*
81 * @test
82 * @summary Test for fInst.getObjectSize without compressed oops
83 * @library /test/lib
84 * @requires vm.bits == 64
85 *
86 * @build jdk.test.whitebox.WhiteBox
87 * @run build GetObjectSizeIntrinsicsTest
88 * @run shell MakeJAR.sh basicAgent
89 *
90 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
91 *
92 * @run main/othervm -Xmx128m -XX:-UseCompressedOops
93 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
94 * -Xint
95 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
96 *
97 * @run main/othervm -Xmx128m -XX:-UseCompressedOops
98 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
99 * -Xbatch -XX:TieredStopAtLevel=1
100 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
101 *
102 * @run main/othervm -Xmx128m -XX:-UseCompressedOops
103 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
104 * -Xbatch -XX:-TieredCompilation
105 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
106 */
107
108 /*
109 * @test
110 * @summary Test for fInst.getObjectSize with 32-bit compressed oops
111 * @library /test/lib
112 * @requires vm.debug
113 *
114 * @build jdk.test.whitebox.WhiteBox
115 * @run build GetObjectSizeIntrinsicsTest
116 * @run shell MakeJAR.sh basicAgent
117 *
118 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
119 *
120 * @run main/othervm -Xmx128m
121 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
122 * -XX:FastAllocateSizeLimit=0
123 * -Xint
124 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
125 *
126 * @run main/othervm -Xmx128m
127 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
128 * -XX:FastAllocateSizeLimit=0
129 * -Xbatch -XX:TieredStopAtLevel=1
130 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
131 *
132 * @run main/othervm -Xmx128m
133 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
134 * -XX:FastAllocateSizeLimit=0
135 * -Xbatch -XX:-TieredCompilation
136 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
137 */
138
139 /*
140 * @test
141 * @summary Test for fInst.getObjectSize with zero-based compressed oops
142 * @library /test/lib
143 * @requires vm.bits == 64
144 * @requires vm.debug
145 *
146 * @build jdk.test.whitebox.WhiteBox
147 * @run build GetObjectSizeIntrinsicsTest
148 * @run shell MakeJAR.sh basicAgent
149 *
150 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
151 *
152 * @run main/othervm -Xmx4g
153 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
154 * -XX:FastAllocateSizeLimit=0
155 * -Xint
156 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
157 *
158 * @run main/othervm -Xmx4g
159 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
160 * -XX:FastAllocateSizeLimit=0
161 * -Xbatch -XX:TieredStopAtLevel=1
162 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
163 *
164 * @run main/othervm -Xmx4g
165 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
166 * -XX:FastAllocateSizeLimit=0
167 * -Xbatch -XX:-TieredCompilation
168 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
169 */
170
171 /*
172 * @test
173 * @summary Test for fInst.getObjectSize without compressed oops
174 * @library /test/lib
175 * @requires vm.bits == 64
176 * @requires vm.debug
177 *
178 * @build jdk.test.whitebox.WhiteBox
179 * @run build GetObjectSizeIntrinsicsTest
180 * @run shell MakeJAR.sh basicAgent
181 *
182 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
183 *
184 * @run main/othervm -Xmx128m -XX:-UseCompressedOops
185 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
186 * -XX:FastAllocateSizeLimit=0
187 * -Xint
188 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
189 *
190 * @run main/othervm -Xmx128m -XX:-UseCompressedOops
191 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
192 * -XX:FastAllocateSizeLimit=0
193 * -Xbatch -XX:TieredStopAtLevel=1
194 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
195 *
196 * @run main/othervm -Xmx128m -XX:-UseCompressedOops
197 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
198 * -XX:FastAllocateSizeLimit=0
199 * -Xbatch -XX:-TieredCompilation
200 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
201 */
202
203 /*
204 * @test
205 * @summary Test for fInst.getObjectSize with 32-bit compressed oops
206 * @library /test/lib
207 * @requires vm.bits == 64
208 * @requires vm.debug
209 *
210 * @build jdk.test.whitebox.WhiteBox
211 * @run build GetObjectSizeIntrinsicsTest
212 * @run shell MakeJAR.sh basicAgent
213 *
214 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
215 *
216 * @run main/othervm -Xmx128m
217 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
218 * -XX:ObjectAlignmentInBytes=32
219 * -Xint
220 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
221 *
222 * @run main/othervm -Xmx128m
223 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
224 * -XX:ObjectAlignmentInBytes=32
225 * -Xbatch -XX:TieredStopAtLevel=1
226 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
227 *
228 * @run main/othervm -Xmx128m
229 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
230 * -XX:ObjectAlignmentInBytes=32
231 * -Xbatch -XX:-TieredCompilation
232 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
233 */
234
235 /*
236 * @test
237 * @summary Test for fInst.getObjectSize with zero-based compressed oops
238 * @library /test/lib
239 * @requires vm.bits == 64
240 * @requires vm.debug
241 *
242 * @build jdk.test.whitebox.WhiteBox
243 * @run build GetObjectSizeIntrinsicsTest
244 * @run shell MakeJAR.sh basicAgent
245 *
246 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
247 *
248 * @run main/othervm -Xmx4g
249 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
250 * -XX:ObjectAlignmentInBytes=32
251 * -Xint
252 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
253 *
254 * @run main/othervm -Xmx4g
255 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
256 * -XX:ObjectAlignmentInBytes=32
257 * -Xbatch -XX:TieredStopAtLevel=1
258 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
259 *
260 * @run main/othervm -Xmx4g
261 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
262 * -XX:ObjectAlignmentInBytes=32
263 * -Xbatch -XX:-TieredCompilation
264 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest
265 */
266
267 /*
268 * @test
269 * @summary Test for fInst.getObjectSize with large arrays
270 * @library /test/lib
271 * @requires vm.bits == 64
272 * @requires vm.debug
273 * @requires os.maxMemory >= 10G
274 *
275 * @build jdk.test.whitebox.WhiteBox
276 * @run build GetObjectSizeIntrinsicsTest
277 * @run shell MakeJAR.sh basicAgent
278 *
279 * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
280 *
281 * @run main/othervm/timeout=300 -Xmx8g
282 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
283 * -Xint
284 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest large
285 *
286 * @run main/othervm/timeout=240 -Xmx8g
287 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
288 * -Xbatch -XX:TieredStopAtLevel=1
289 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest large
290 *
291 * @run main/othervm/timeout=180 -Xmx8g
292 * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:.
293 * -Xbatch -XX:-TieredCompilation
294 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest large
295 */
296
297 import java.util.*;
298
299 import jdk.test.lib.Platform;
300 import jdk.test.whitebox.WhiteBox;
301
302 public class GetObjectSizeIntrinsicsTest extends ASimpleInstrumentationTestCase {
303
304 private static final boolean COMPACT_HEADERS = Platform.is64bit() && WhiteBox.getWhiteBox().getBooleanVMFlag("UseCompactObjectHeaders");
305 static final Boolean COMPRESSED_OOPS = WhiteBox.getWhiteBox().getBooleanVMFlag("UseCompressedOops");
306 static final long REF_SIZE = (COMPRESSED_OOPS == null || COMPRESSED_OOPS == true) ? 4 : 8;
307
308 static final Long align = WhiteBox.getWhiteBox().getIntVMFlag("ObjectAlignmentInBytes");
309 static final int OBJ_ALIGN = (align == null ? 8 : align.intValue());
310
311 static final int SMALL_ARRAY_SIZE = 1024;
312
313 // These should overflow 4G size boundary
314 static final int LARGE_INT_ARRAY_SIZE = 1024*1024*1024 + 1024;
315 static final int LARGE_OBJ_ARRAY_SIZE = (4096/(int)REF_SIZE)*1024*1024 + 1024;
316
317 // 64-bit: 8mw-4ccp-4len
318 // 32-bit: 4mw-4ccp-4len-4gap
319 static final int ARRAY_HEADER_SIZE = 16;
320 static final int ARRAY_HEADER_SIZE = COMPACT_HEADERS ? 8 : 16;
321
322 final String mode;
323
324 public GetObjectSizeIntrinsicsTest(String name, String mode) {
325 super(name);
326 this.mode = mode;
327 }
328
329 public static void main(String[] args)throws Throwable {
330 new GetObjectSizeIntrinsicsTest(args[0], (args.length >= 2 ? args[1] : "")).runTest();
331 }
332
333 public static final int ITERS = 200_000;
334
335 public static void assertEquals(long expected, long actual) {
336 if (expected != actual) {
337 throw new IllegalStateException(
338 "Error: expected: " + expected + " (" + Long.toHexString(expected) +
339 "), actual: " + actual + " (" + Long.toHexString(actual) + ")");
340 }
341 }
342
343 public static void assertNotEquals(long notExpected, long actual) {
344 if (notExpected == actual) {
345 throw new IllegalStateException(
346 "Error: not expected: " + notExpected + " (" + Long.toHexString(notExpected) +
347 "), actual: " + actual + " (" + Long.toHexString(actual) + ")");
348 }
349 }
350
351 public static void assertFail() {
352 throw new IllegalStateException("Should not be here");
353 }
354
355 protected final void doRunTest() throws Throwable {
356 testSize_newObject();
357 testSize_localObject();
358 testSize_fieldObject();
359
360 testSize_newSmallIntArray();
361 testSize_localSmallIntArray();
362 testSize_fieldSmallIntArray();
363
364 testSize_newSmallObjArray();
365 testSize_localSmallObjArray();
366 testSize_fieldSmallObjArray();
367
368 if (mode.equals("large")) {
369 testSize_localLargeIntArray();
370 testSize_localLargeObjArray();
371 }
372
373 testNulls();
374 }
375
376 private static long roundUp(long v, long a) {
377 return (v + a - 1) / a * a;
378 }
379
380 private static long expectedSmallObjSize() {
381 long size;
382 if (!Platform.is64bit() || COMPACT_HEADERS) {
383 size = 8;
384 } else {
385 size = 16;
386 }
387 return roundUp(size, OBJ_ALIGN);
388 }
389
390 private void testSize_newObject() {
391 long expected = expectedSmallObjSize();
392 for (int c = 0; c < ITERS; c++) {
393 assertEquals(expected, fInst.getObjectSize(new Object()));
394 }
395 }
396
397 private void testSize_localObject() {
398 long expected = expectedSmallObjSize();
399 Object o = new Object();
400 for (int c = 0; c < ITERS; c++) {
401 assertEquals(expected, fInst.getObjectSize(o));
402 }
403 }
404
405 static Object staticO = new Object();
406
407 private void testSize_fieldObject() {
408 long expected = expectedSmallObjSize();
409 for (int c = 0; c < ITERS; c++) {
410 assertEquals(expected, fInst.getObjectSize(staticO));
411 }
412 }
413
414 private void testSize_newSmallIntArray() {
415 long expected = roundUp(4L*SMALL_ARRAY_SIZE + ARRAY_HEADER_SIZE, OBJ_ALIGN);
416 for (int c = 0; c < ITERS; c++) {
417 assertEquals(expected, fInst.getObjectSize(new int[SMALL_ARRAY_SIZE]));
418 }
419 }
420
421 private void testSize_localSmallIntArray() {
422 int[] arr = new int[SMALL_ARRAY_SIZE];
423 long expected = roundUp(4L*SMALL_ARRAY_SIZE + ARRAY_HEADER_SIZE, OBJ_ALIGN);
424 for (int c = 0; c < ITERS; c++) {
425 assertEquals(expected, fInst.getObjectSize(arr));
426 }
427 }
428
429 static int[] smallArr = new int[SMALL_ARRAY_SIZE];
430
431 private void testSize_fieldSmallIntArray() {
432 long expected = roundUp(4L*SMALL_ARRAY_SIZE + ARRAY_HEADER_SIZE, OBJ_ALIGN);
433 for (int c = 0; c < ITERS; c++) {
434 assertEquals(expected, fInst.getObjectSize(smallArr));
435 }
436 }
437
438 private void testSize_newSmallObjArray() {
439 long expected = roundUp(REF_SIZE*SMALL_ARRAY_SIZE + ARRAY_HEADER_SIZE, OBJ_ALIGN);
440 for (int c = 0; c < ITERS; c++) {
441 assertEquals(expected, fInst.getObjectSize(new Object[SMALL_ARRAY_SIZE]));
442 }
443 }
444
445 private void testSize_localSmallObjArray() {
446 Object[] arr = new Object[SMALL_ARRAY_SIZE];
447 long expected = roundUp(REF_SIZE*SMALL_ARRAY_SIZE + ARRAY_HEADER_SIZE, OBJ_ALIGN);
448 for (int c = 0; c < ITERS; c++) {
449 assertEquals(expected, fInst.getObjectSize(arr));
450 }
451 }
452
453 static Object[] smallObjArr = new Object[SMALL_ARRAY_SIZE];
454
455 private void testSize_fieldSmallObjArray() {
456 long expected = roundUp(REF_SIZE*SMALL_ARRAY_SIZE + ARRAY_HEADER_SIZE, OBJ_ALIGN);
457 for (int c = 0; c < ITERS; c++) {
458 assertEquals(expected, fInst.getObjectSize(smallObjArr));
459 }
460 }
461
462 private void testSize_localLargeIntArray() {
463 int[] arr = new int[LARGE_INT_ARRAY_SIZE];
464 long expected = roundUp(4L*LARGE_INT_ARRAY_SIZE + ARRAY_HEADER_SIZE, OBJ_ALIGN);
465 for (int c = 0; c < ITERS; c++) {
466 assertEquals(expected, fInst.getObjectSize(arr));
467 }
468 }
469
470 private void testSize_localLargeObjArray() {
471 Object[] arr = new Object[LARGE_OBJ_ARRAY_SIZE];
472 long expected = roundUp(REF_SIZE*LARGE_OBJ_ARRAY_SIZE + ARRAY_HEADER_SIZE, OBJ_ALIGN);
473 for (int c = 0; c < ITERS; c++) {
474 assertEquals(expected, fInst.getObjectSize(arr));
475 }
476 }
477
478 private void testNulls() {
479 for (int c = 0; c < ITERS; c++) {
480 try {
481 fInst.getObjectSize(null);
482 assertFail();
483 } catch (NullPointerException e) {
484 // expected
485 }
486 }
487 }
488
489 }