48 49 private static synchronized void initialize(TypeDataBase db) { 50 ctor = new VirtualConstructor(db); 51 52 ctor.addMapping("DefNewGeneration", DefNewGeneration.class); 53 ctor.addMapping("ParNewGeneration", ParNewGeneration.class); 54 ctor.addMapping("TenuredGeneration", TenuredGeneration.class); 55 ctor.addMapping("ConcurrentMarkSweepGeneration", ConcurrentMarkSweepGeneration.class); 56 } 57 58 public static Generation newObject(Address addr) { 59 try { 60 return (Generation) ctor.instantiateWrapperFor(addr); 61 } catch (WrongTypeException e) { 62 return new Generation(addr) { 63 public String name() { 64 return "unknown generation type"; 65 } 66 public void spaceIterate(SpaceClosure blk, boolean usedOnly) { 67 } 68 public void printOn(java.io.PrintStream tty) { 69 tty.println("unknown subtype of Generation @ " + getAddress() + " (" + 70 virtualSpace().low() + "," + virtualSpace().high() + ")"); 71 } 72 public long used() { 73 return 0; 74 } 75 public long free() { 76 return 0; 77 } 78 public long capacity() { 79 return 0; 80 } 81 public long contiguousAvailable() { 82 return 0; 83 } 84 85 }; 86 } 87 } | 48 49 private static synchronized void initialize(TypeDataBase db) { 50 ctor = new VirtualConstructor(db); 51 52 ctor.addMapping("DefNewGeneration", DefNewGeneration.class); 53 ctor.addMapping("ParNewGeneration", ParNewGeneration.class); 54 ctor.addMapping("TenuredGeneration", TenuredGeneration.class); 55 ctor.addMapping("ConcurrentMarkSweepGeneration", ConcurrentMarkSweepGeneration.class); 56 } 57 58 public static Generation newObject(Address addr) { 59 try { 60 return (Generation) ctor.instantiateWrapperFor(addr); 61 } catch (WrongTypeException e) { 62 return new Generation(addr) { 63 public String name() { 64 return "unknown generation type"; 65 } 66 public void spaceIterate(SpaceClosure blk, boolean usedOnly) { 67 } 68 public void liveRegionsIterate(LiveRegionsClosure closure) { 69 } 70 public void printOn(java.io.PrintStream tty) { 71 tty.println("unknown subtype of Generation @ " + getAddress() + " (" + 72 virtualSpace().low() + "," + virtualSpace().high() + ")"); 73 } 74 public long used() { 75 return 0; 76 } 77 public long free() { 78 return 0; 79 } 80 public long capacity() { 81 return 0; 82 } 83 public long contiguousAvailable() { 84 return 0; 85 } 86 87 }; 88 } 89 } |