318 for (int i = 0; i < liveRegions.size(); i += 2) {
319 Address bottom = (Address) liveRegions.get(i);
320 Address top = (Address) liveRegions.get(i+1);
321
322 try {
323 // Traverses the space from bottom to top
324 OopHandle handle = bottom.addOffsetToAsOopHandle(0);
325
326 while (handle.lessThan(top)) {
327 Oop obj = null;
328
329 try {
330 obj = newOop(handle);
331 } catch (UnknownOopException exp) {
332 if (DEBUG) {
333 throw new RuntimeException(" UnknownOopException " + exp);
334 }
335 }
336 if (obj == null) {
337 //Find the object size using Printezis bits and skip over
338 System.err.println("Finding object size using Printezis bits and skipping over...");
339 long size = 0;
340
341 if ( (cmsSpaceOld != null) && cmsSpaceOld.contains(handle) ){
342 size = cmsSpaceOld.collector().blockSizeUsingPrintezisBits(handle);
343 }
344
345 if (size <= 0) {
346 //Either Printezis bits not set or handle is not in cms space.
347 throw new UnknownOopException();
348 }
349
350 handle = handle.addOffsetToAsOopHandle(CompactibleFreeListSpace.adjustObjectSizeInBytes(size));
351 continue;
352 }
353 if (of == null || of.canInclude(obj)) {
354 if (visitor.doObj(obj)) {
355 // doObj() returns true to abort this loop.
356 break;
357 }
358 }
|
318 for (int i = 0; i < liveRegions.size(); i += 2) {
319 Address bottom = (Address) liveRegions.get(i);
320 Address top = (Address) liveRegions.get(i+1);
321
322 try {
323 // Traverses the space from bottom to top
324 OopHandle handle = bottom.addOffsetToAsOopHandle(0);
325
326 while (handle.lessThan(top)) {
327 Oop obj = null;
328
329 try {
330 obj = newOop(handle);
331 } catch (UnknownOopException exp) {
332 if (DEBUG) {
333 throw new RuntimeException(" UnknownOopException " + exp);
334 }
335 }
336 if (obj == null) {
337 //Find the object size using Printezis bits and skip over
338 long size = 0;
339
340 if ( (cmsSpaceOld != null) && cmsSpaceOld.contains(handle) ){
341 size = cmsSpaceOld.collector().blockSizeUsingPrintezisBits(handle);
342 }
343
344 if (size <= 0) {
345 //Either Printezis bits not set or handle is not in cms space.
346 throw new UnknownOopException();
347 }
348
349 handle = handle.addOffsetToAsOopHandle(CompactibleFreeListSpace.adjustObjectSizeInBytes(size));
350 continue;
351 }
352 if (of == null || of.canInclude(obj)) {
353 if (visitor.doObj(obj)) {
354 // doObj() returns true to abort this loop.
355 break;
356 }
357 }
|