comparison agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java @ 904:ef671fb22f73

6868051: (SA) FreeChunk support for compressed oops is broken Reviewed-by: kvn, dcubed
author never
date Thu, 06 Aug 2009 12:24:41 -0700
parents d1605aabd0a1
children 89e0543e1737
comparison
equal deleted inserted replaced
903:15bbd3f505c0 904:ef671fb22f73
174 Address limit = end(); 174 Address limit = end();
175 final long addressSize = vm.getAddressSize(); 175 final long addressSize = vm.getAddressSize();
176 176
177 for (; cur.lessThan(limit);) { 177 for (; cur.lessThan(limit);) {
178 Address klassOop = cur.getAddressAt(addressSize); 178 Address klassOop = cur.getAddressAt(addressSize);
179 // FIXME: need to do a better job here.
180 // can I use bitMap here?
181 if (klassOop == null) {
182 //Find the object size using Printezis bits and skip over
183 System.err.println("Finding object size using Printezis bits and skipping over...");
184 long size = collector().blockSizeUsingPrintezisBits(cur);
185 if (size == -1) {
186 System.err.println("Printezis bits not set...");
187 break;
188 }
189 cur = cur.addOffsetTo(adjustObjectSizeInBytes(size));
190 }
191
192 if (FreeChunk.indicatesFreeChunk(cur)) { 179 if (FreeChunk.indicatesFreeChunk(cur)) {
193 if (! cur.equals(regionStart)) { 180 if (! cur.equals(regionStart)) {
194 res.add(new MemRegion(regionStart, cur)); 181 res.add(new MemRegion(regionStart, cur));
195 } 182 }
196 FreeChunk fc = (FreeChunk) VMObjectFactory.newObject(FreeChunk.class, cur); 183 FreeChunk fc = (FreeChunk) VMObjectFactory.newObject(FreeChunk.class, cur);
198 if (Assert.ASSERTS_ENABLED) { 185 if (Assert.ASSERTS_ENABLED) {
199 Assert.that(chunkSize > 0, "invalid FreeChunk size"); 186 Assert.that(chunkSize > 0, "invalid FreeChunk size");
200 } 187 }
201 // note that fc.size() gives chunk size in heap words 188 // note that fc.size() gives chunk size in heap words
202 cur = cur.addOffsetTo(chunkSize * addressSize); 189 cur = cur.addOffsetTo(chunkSize * addressSize);
203 System.err.println("Free chunk in CMS heap, size="+chunkSize * addressSize);
204 regionStart = cur; 190 regionStart = cur;
205 } else if (klassOop != null) { 191 } else if (klassOop != null) {
206 Oop obj = heap.newOop(cur.addOffsetToAsOopHandle(0)); 192 Oop obj = heap.newOop(cur.addOffsetToAsOopHandle(0));
207 long objectSize = obj.getObjectSize(); 193 long objectSize = obj.getObjectSize();
208 cur = cur.addOffsetTo(adjustObjectSizeInBytes(objectSize)); 194 cur = cur.addOffsetTo(adjustObjectSizeInBytes(objectSize));
195 } else {
196 // FIXME: need to do a better job here.
197 // can I use bitMap here?
198 //Find the object size using Printezis bits and skip over
199 long size = collector().blockSizeUsingPrintezisBits(cur);
200 if (size == -1) {
201 System.err.println("Printezis bits not set...");
202 break;
203 }
204 cur = cur.addOffsetTo(adjustObjectSizeInBytes(size));
209 } 205 }
210 } 206 }
211 return res; 207 return res;
212 } 208 }
213 209