sa-jdi

e.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.ContiguousSpace.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class ContiguousSpace
  extends CompactibleSpace
{
  private static AddressField topField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        ContiguousSpace.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("ContiguousSpace");
    
    topField = type.getAddressField("_top");
  }
  
  public ContiguousSpace(Address addr)
  {
    super(addr);
  }
  
  public Address top()
  {
    return topField.getValue(addr);
  }
  
  public long capacity()
  {
    return end().minus(bottom());
  }
  
  public long used()
  {
    return top().minus(bottom());
  }
  
  public long free()
  {
    return end().minus(top());
  }
  
  public MemRegion usedRegion()
  {
    return new MemRegion(bottom(), top());
  }
  
  public List getLiveRegions()
  {
    List res = new ArrayList();
    res.add(new MemRegion(bottom(), top()));
    return res;
  }
  
  public boolean contains(Address p)
  {
    return (bottom().lessThanOrEqual(p)) && (top().greaterThan(p));
  }
  
  public void printOn(PrintStream tty)
  {
    tty.print(" [" + bottom() + "," + top() + "," + end() + ")");
    
    super.printOn(tty);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.ContiguousSpace
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class DefNewGeneration$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    DefNewGeneration.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.DefNewGeneration.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.io.PrintStream;
import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObjectFactory;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class DefNewGeneration
  extends Generation
{
  protected static AddressField edenSpaceField;
  protected static AddressField fromSpaceField;
  protected static AddressField toSpaceField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        DefNewGeneration.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("DefNewGeneration");
    
    edenSpaceField = type.getAddressField("_eden_space");
    fromSpaceField = type.getAddressField("_from_space");
    toSpaceField = type.getAddressField("_to_space");
  }
  
  public DefNewGeneration(Address addr)
  {
    super(addr);
  }
  
  public Generation.Name kind()
  {
    return Generation.Name.DEF_NEW;
  }
  
  public EdenSpace eden()
  {
    return (EdenSpace)VMObjectFactory.newObject(EdenSpace.class, edenSpaceField.getValue(addr));
  }
  
  public ContiguousSpace from()
  {
    return (ContiguousSpace)VMObjectFactory.newObject(ContiguousSpace.class, fromSpaceField.getValue(addr));
  }
  
  public ContiguousSpace to()
  {
    return (ContiguousSpace)VMObjectFactory.newObject(ContiguousSpace.class, toSpaceField.getValue(addr));
  }
  
  public long capacity()
  {
    return eden().capacity() + from().capacity();
  }
  
  public long used()
  {
    return eden().used() + from().used();
  }
  
  public long free()
  {
    return eden().free() + from().free();
  }
  
  public long contiguousAvailable()
  {
    return eden().free();
  }
  
  public String name()
  {
    return "default new generation";
  }
  
  public void spaceIterate(SpaceClosure blk, boolean usedOnly)
  {
    blk.doSpace(eden());
    blk.doSpace(from());
    if (!usedOnly) {
      blk.doSpace(to());
    }
  }
  
  public void printOn(PrintStream tty)
  {
    tty.print("  eden");
    eden().printOn(tty);
    tty.print("\n  from");
    from().printOn(tty);
    tty.print("\n  to  ");
    to().printOn(tty);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.DefNewGeneration
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class Dictionary$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    Dictionary.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.Dictionary.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.oops.InstanceKlass;
import sun.jvm.hotspot.oops.Klass;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.Symbol;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.utilities.TwoOopHashtable;

public class Dictionary
  extends TwoOopHashtable
{
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        Dictionary.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("Dictionary");
  }
  
  public Dictionary(Address addr)
  {
    super(addr);
  }
  
  protected Class getHashtableEntryClass()
  {
    return DictionaryEntry.class;
  }
  
  public void classesDo(SystemDictionary.ClassVisitor v)
  {
    ObjectHeap heap = VM.getVM().getObjectHeap();
    int tblSize = tableSize();
    for (int index = 0; index < tblSize; index++) {
      for (DictionaryEntry probe = (DictionaryEntry)bucket(index); probe != null; probe = (DictionaryEntry)probe.next())
      {
        Oop k = probe.klass();
        if ((k.isKlass()) && (heap.equal(probe.loader(), ((InstanceKlass)k).getClassLoader()))) {
          v.visit((Klass)k);
        }
      }
    }
  }
  
  public void classesDo(SystemDictionary.ClassAndLoaderVisitor v)
  {
    int tblSize = tableSize();
    for (int index = 0; index < tblSize; index++) {
      for (DictionaryEntry probe = (DictionaryEntry)bucket(index); probe != null; probe = (DictionaryEntry)probe.next())
      {
        Oop k = probe.klass();
        if (k.isKlass()) {
          v.visit((Klass)k, probe.loader());
        }
      }
    }
  }
  
  public Klass find(int index, long hash, Symbol className, Oop classLoader, Oop protectionDomain)
  {
    DictionaryEntry entry = getEntry(index, hash, className, classLoader);
    if ((entry != null) && (entry.isValidProtectionDomain(protectionDomain))) {
      return entry.klass();
    }
    return null;
  }
  
  private DictionaryEntry getEntry(int index, long hash, Symbol className, Oop classLoader)
  {
    for (DictionaryEntry entry = (DictionaryEntry)bucket(index); entry != null; entry = (DictionaryEntry)entry.next()) {
      if ((entry.hash() == hash) && (entry.equals(className, classLoader))) {
        return entry;
      }
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.Dictionary
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class DictionaryEntry$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    DictionaryEntry.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.DictionaryEntry.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.oops.InstanceKlass;
import sun.jvm.hotspot.oops.Klass;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.Symbol;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObjectFactory;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.OopField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.utilities.HashtableEntry;

public class DictionaryEntry
  extends HashtableEntry
{
  private static AddressField pdSetField;
  private static OopField loaderField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        DictionaryEntry.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("DictionaryEntry");
    pdSetField = type.getAddressField("_pd_set");
    loaderField = type.getOopField("_loader");
  }
  
  public ProtectionDomainEntry pdSet()
  {
    Address tmp = pdSetField.getValue(addr);
    return (ProtectionDomainEntry)VMObjectFactory.newObject(ProtectionDomainEntry.class, tmp);
  }
  
  public Oop loader()
  {
    return VM.getVM().getObjectHeap().newOop(loaderField.getValue(addr));
  }
  
  public Klass klass()
  {
    return (Klass)literal();
  }
  
  public DictionaryEntry(Address addr)
  {
    super(addr);
  }
  
  public boolean equals(Symbol className, Oop classLoader)
  {
    InstanceKlass ik = (InstanceKlass)klass();
    Oop loader = loader();
    if (!ik.getName().equals(className)) {
      return false;
    }
    return loader == null ? false : classLoader == null ? true : loader.equals(classLoader);
  }
  
  public boolean isValidProtectionDomain(Oop protectionDomain)
  {
    if (protectionDomain == null) {
      return true;
    }
    return containsProtectionDomain(protectionDomain);
  }
  
  public boolean containsProtectionDomain(Oop protectionDomain)
  {
    InstanceKlass ik = (InstanceKlass)klass();
    if (protectionDomain.equals(ik.getProtectionDomain())) {
      return true;
    }
    for (ProtectionDomainEntry current = pdSet(); current != null; current = current.next()) {
      if (protectionDomain.equals(current.protectionDomain())) {
        return true;
      }
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.DictionaryEntry
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import sun.jvm.hotspot.debugger.Address;

public class EdenSpace
  extends ContiguousSpace
{
  public EdenSpace(Address addr)
  {
    super(addr);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.EdenSpace
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class FreeChunk$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    FreeChunk.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.FreeChunk.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.Debugger;
import sun.jvm.hotspot.oops.Mark;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.runtime.VMObjectFactory;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class FreeChunk
  extends VMObject
{
  private static AddressField nextField;
  private static AddressField prevField;
  private static AddressField sizeField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        FreeChunk.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("FreeChunk");
    nextField = type.getAddressField("_next");
    prevField = type.getAddressField("_prev");
    sizeField = type.getAddressField("_size");
  }
  
  public FreeChunk next()
  {
    return (FreeChunk)VMObjectFactory.newObject(FreeChunk.class, nextField.getValue(addr));
  }
  
  public FreeChunk prev()
  {
    Address prev = prevField.getValue(addr).andWithMask(-4L);
    return (FreeChunk)VMObjectFactory.newObject(FreeChunk.class, prev);
  }
  
  public long size()
  {
    if (VM.getVM().isCompressedOopsEnabled())
    {
      Mark mark = new Mark(addr.addOffsetTo(sizeField.getOffset()));
      return mark.getSize();
    }
    Address size = sizeField.getValue(addr);
    Debugger dbg = VM.getVM().getDebugger();
    return dbg.getAddressValue(size);
  }
  
  public FreeChunk(Address addr)
  {
    super(addr);
  }
  
  public static boolean indicatesFreeChunk(Address cur)
  {
    FreeChunk f = new FreeChunk(cur);
    return f.isFree();
  }
  
  public boolean isFree()
  {
    if (VM.getVM().isCompressedOopsEnabled())
    {
      Mark mark = new Mark(addr.addOffsetTo(sizeField.getOffset()));
      return mark.isCmsFreeChunk();
    }
    Address prev = prevField.getValue(addr);
    Debugger dbg = VM.getVM().getDebugger();
    long word = dbg.getAddressValue(prev);
    return (word & 1L) == 1L;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.FreeChunk
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class FreeList$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    FreeList.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.FreeList.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class FreeList
  extends VMObject
{
  private static CIntegerField sizeField;
  private static CIntegerField countField;
  private static long headerSize;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        FreeList.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("FreeList");
    sizeField = type.getCIntegerField("_size");
    countField = type.getCIntegerField("_count");
    headerSize = type.getSize();
  }
  
  public FreeList(Address address)
  {
    super(address);
  }
  
  public long size()
  {
    return sizeField.getValue(addr);
  }
  
  public long count()
  {
    return countField.getValue(addr);
  }
  
  public static long sizeOf()
  {
    return headerSize;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.FreeList
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class GenCollectedHeap$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    GenCollectedHeap.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.GenCollectedHeap.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.io.PrintStream;
import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.gc_interface.CollectedHeapName;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObjectFactory;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Field;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.utilities.Assert;

public class GenCollectedHeap
  extends SharedHeap
{
  private static CIntegerField nGensField;
  private static long gensOffset;
  private static AddressField genSpecsField;
  private static GenerationFactory genFactory;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        GenCollectedHeap.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("GenCollectedHeap");
    
    nGensField = type.getCIntegerField("_n_gens");
    gensOffset = type.getField("_gens").getOffset();
    genSpecsField = type.getAddressField("_gen_specs");
    
    genFactory = new GenerationFactory();
  }
  
  public GenCollectedHeap(Address addr)
  {
    super(addr);
  }
  
  public int nGens()
  {
    return (int)nGensField.getValue(addr);
  }
  
  public Generation getGen(int i)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that((i >= 0) && (i < nGens()), "Index " + i + " out of range (should be between 0 and " + nGens() + ")");
    }
    if ((i < 0) || (i >= nGens())) {
      return null;
    }
    Address genAddr = addr.getAddressAt(gensOffset + i * VM.getVM().getAddressSize());
    
    return GenerationFactory.newObject(addr.getAddressAt(gensOffset + i * VM.getVM().getAddressSize()));
  }
  
  public boolean isIn(Address a)
  {
    for (int i = 0; i < nGens(); i++)
    {
      Generation gen = getGen(i);
      if (gen.isIn(a)) {
        return true;
      }
    }
    return permGen().isIn(a);
  }
  
  public long capacity()
  {
    long capacity = 0L;
    for (int i = 0; i < nGens(); i++) {
      capacity += getGen(i).capacity();
    }
    return capacity;
  }
  
  public long used()
  {
    long used = 0L;
    for (int i = 0; i < nGens(); i++) {
      used += getGen(i).used();
    }
    return used;
  }
  
  GenerationSpec spec(int level)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that((level >= 0) && (level < nGens()), "Index " + level + " out of range (should be between 0 and " + nGens() + ")");
    }
    if ((level < 0) || (level >= nGens())) {
      return null;
    }
    Address ptrList = genSpecsField.getValue(addr);
    if (ptrList == null) {
      return null;
    }
    return (GenerationSpec)VMObjectFactory.newObject(GenerationSpec.class, ptrList.getAddressAt(level * VM.getVM().getAddressSize()));
  }
  
  public CollectedHeapName kind()
  {
    return CollectedHeapName.GEN_COLLECTED_HEAP;
  }
  
  public void printOn(PrintStream tty)
  {
    for (int i = 0; i < nGens(); i++)
    {
      tty.print("Gen " + i + ": ");
      getGen(i).printOn(tty);
      tty.println("Invocations: " + getGen(i).invocations());
      tty.println();
    }
    permGen().printOn(tty);
    tty.println("Invocations: " + permGen().invocations());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.GenCollectedHeap
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class Generation$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    Generation.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.Generation.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

public class Generation$Name
{
  public static final Name DEF_NEW = new Name("DefNew");
  public static final Name PAR_NEW = new Name("ParNew");
  public static final Name MARK_SWEEP_COMPACT = new Name("MarkSweepCompact");
  public static final Name CONCURRENT_MARK_SWEEP = new Name("ConcurrentMarkSweep");
  public static final Name OTHER = new Name("Other");
  private String value;
  
  private Generation$Name(String value)
  {
    this.value = value;
  }
  
  public String toString()
  {
    return value;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.Generation.Name
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.types.CIntegerField;

public class Generation$StatRecord
  extends VMObject
{
  public Generation$StatRecord(Address addr)
  {
    super(addr);
  }
  
  public int getInvocations()
  {
    return (int)Generation.access$100().getValue(addr);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.Generation.StatRecord
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.io.PrintStream;
import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.runtime.VMObjectFactory;
import sun.jvm.hotspot.runtime.VirtualSpace;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Field;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public abstract class Generation
  extends VMObject
{
  private static long reservedFieldOffset;
  private static long virtualSpaceFieldOffset;
  private static CIntegerField levelField;
  protected static final int K = 1024;
  private static Field statRecordField;
  private static CIntegerField invocationField;
  private static int NAME_DEF_NEW;
  private static int NAME_PAR_NEW;
  private static int NAME_MARK_SWEEP_COMPACT;
  private static int NAME_CONCURRENT_MARK_SWEEP;
  private static int NAME_OTHER;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        Generation.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("Generation");
    
    reservedFieldOffset = type.getField("_reserved").getOffset();
    virtualSpaceFieldOffset = type.getField("_virtual_space").getOffset();
    levelField = type.getCIntegerField("_level");
    
    statRecordField = type.getField("_stat_record");
    type = db.lookupType("Generation::StatRecord");
    invocationField = type.getCIntegerField("invocations");
    
    NAME_DEF_NEW = db.lookupIntConstant("Generation::DefNew").intValue();
    NAME_PAR_NEW = db.lookupIntConstant("Generation::ParNew").intValue();
    NAME_MARK_SWEEP_COMPACT = db.lookupIntConstant("Generation::MarkSweepCompact").intValue();
    NAME_CONCURRENT_MARK_SWEEP = db.lookupIntConstant("Generation::ConcurrentMarkSweep").intValue();
    NAME_OTHER = db.lookupIntConstant("Generation::Other").intValue();
  }
  
  public Generation(Address addr)
  {
    super(addr);
  }
  
  public static class Name
  {
    public static final Name DEF_NEW = new Name("DefNew");
    public static final Name PAR_NEW = new Name("ParNew");
    public static final Name MARK_SWEEP_COMPACT = new Name("MarkSweepCompact");
    public static final Name CONCURRENT_MARK_SWEEP = new Name("ConcurrentMarkSweep");
    public static final Name OTHER = new Name("Other");
    private String value;
    
    private Name(String value)
    {
      this.value = value;
    }
    
    public String toString()
    {
      return value;
    }
  }
  
  public Name kind()
  {
    return Name.OTHER;
  }
  
  static Name nameForEnum(int value)
  {
    if (value == NAME_DEF_NEW) {
      return Name.DEF_NEW;
    }
    if (value == NAME_PAR_NEW) {
      return Name.PAR_NEW;
    }
    if (value == NAME_MARK_SWEEP_COMPACT) {
      return Name.MARK_SWEEP_COMPACT;
    }
    if (value == NAME_CONCURRENT_MARK_SWEEP) {
      return Name.CONCURRENT_MARK_SWEEP;
    }
    if (value == NAME_OTHER) {
      return Name.OTHER;
    }
    throw new RuntimeException("should not reach here");
  }
  
  public GenerationSpec spec()
  {
    return ((GenCollectedHeap)VM.getVM().getUniverse().heap()).spec(level());
  }
  
  public int level()
  {
    return (int)levelField.getValue(addr);
  }
  
  public int invocations()
  {
    return getStatRecord().getInvocations();
  }
  
  public MemRegion reserved()
  {
    return new MemRegion(addr.addOffsetTo(reservedFieldOffset));
  }
  
  public MemRegion usedRegion()
  {
    return reserved();
  }
  
  public boolean isIn(Address p)
  {
    GenerationIsInClosure blk = new GenerationIsInClosure(p);
    spaceIterate(blk);
    return blk.space() != null;
  }
  
  public boolean isInReserved(Address p)
  {
    return reserved().contains(p);
  }
  
  protected VirtualSpace virtualSpace()
  {
    return (VirtualSpace)VMObjectFactory.newObject(VirtualSpace.class, addr.addOffsetTo(virtualSpaceFieldOffset));
  }
  
  public void spaceIterate(SpaceClosure blk)
  {
    spaceIterate(blk, false);
  }
  
  public void print()
  {
    printOn(System.out);
  }
  
  public static class StatRecord
    extends VMObject
  {
    public StatRecord(Address addr)
    {
      super();
    }
    
    public int getInvocations()
    {
      return (int)Generation.invocationField.getValue(addr);
    }
  }
  
  private StatRecord getStatRecord()
  {
    return (StatRecord)VMObjectFactory.newObject(StatRecord.class, addr.addOffsetTo(statRecordField.getOffset()));
  }
  
  public abstract long capacity();
  
  public abstract long used();
  
  public abstract long free();
  
  public abstract long contiguousAvailable();
  
  public abstract String name();
  
  public abstract void spaceIterate(SpaceClosure paramSpaceClosure, boolean paramBoolean);
  
  public abstract void printOn(PrintStream paramPrintStream);
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.Generation
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class GenerationFactory$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    GenerationFactory.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.GenerationFactory.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.io.PrintStream;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VirtualSpace;

final class GenerationFactory$2
  extends Generation
{
  GenerationFactory$2(Address x0)
  {
    super(x0);
  }
  
  public String name()
  {
    return "unknown generation type";
  }
  
  public void spaceIterate(SpaceClosure blk, boolean usedOnly) {}
  
  public void printOn(PrintStream tty)
  {
    tty.println("unknown subtype of Generation @ " + getAddress() + " (" + virtualSpace().low() + "," + virtualSpace().high() + ")");
  }
  
  public long used()
  {
    return 0L;
  }
  
  public long free()
  {
    return 0L;
  }
  
  public long capacity()
  {
    return 0L;
  }
  
  public long contiguousAvailable()
  {
    return 0L;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.GenerationFactory.2
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.io.PrintStream;
import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VirtualConstructor;
import sun.jvm.hotspot.runtime.VirtualSpace;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.types.WrongTypeException;

public class GenerationFactory
{
  private static VirtualConstructor ctor;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        GenerationFactory.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    ctor = new VirtualConstructor(db);
    
    ctor.addMapping("CompactingPermGenGen", CompactingPermGenGen.class);
    ctor.addMapping("CMSPermGenGen", CMSPermGenGen.class);
    ctor.addMapping("DefNewGeneration", DefNewGeneration.class);
    ctor.addMapping("ParNewGeneration", ParNewGeneration.class);
    ctor.addMapping("TenuredGeneration", TenuredGeneration.class);
    ctor.addMapping("ConcurrentMarkSweepGeneration", ConcurrentMarkSweepGeneration.class);
  }
  
  public static Generation newObject(Address addr)
  {
    try
    {
      return (Generation)ctor.instantiateWrapperFor(addr);
    }
    catch (WrongTypeException e) {}
    new Generation(addr)
    {
      public String name()
      {
        return "unknown generation type";
      }
      
      public void spaceIterate(SpaceClosure blk, boolean usedOnly) {}
      
      public void printOn(PrintStream tty)
      {
        tty.println("unknown subtype of Generation @ " + getAddress() + " (" + virtualSpace().low() + "," + virtualSpace().high() + ")");
      }
      
      public long used()
      {
        return 0L;
      }
      
      public long free()
      {
        return 0L;
      }
      
      public long capacity()
      {
        return 0L;
      }
      
      public long contiguousAvailable()
      {
        return 0L;
      }
    };
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.GenerationFactory
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import sun.jvm.hotspot.debugger.Address;

class GenerationIsInClosure
  implements SpaceClosure
{
  private Address p;
  private Space sp;
  
  GenerationIsInClosure(Address p)
  {
    this.p = p;
  }
  
  public void doSpace(Space s)
  {
    if (s.contains(p)) {
      sp = s;
    }
  }
  
  Space space()
  {
    return sp;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.GenerationIsInClosure
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class GenerationSpec$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    GenerationSpec.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.GenerationSpec.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class GenerationSpec
  extends VMObject
{
  private static CIntegerField nameField;
  private static CIntegerField initSizeField;
  private static CIntegerField maxSizeField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        GenerationSpec.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("GenerationSpec");
    
    nameField = type.getCIntegerField("_name");
    initSizeField = type.getCIntegerField("_init_size");
    maxSizeField = type.getCIntegerField("_max_size");
  }
  
  public GenerationSpec(Address addr)
  {
    super(addr);
  }
  
  public Generation.Name name()
  {
    return Generation.nameForEnum((int)nameField.getValue(addr));
  }
  
  public long initSize()
  {
    return initSizeField.getValue(addr);
  }
  
  public long maxSize()
  {
    return maxSizeField.getValue(addr);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.GenerationSpec
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class HeapBlock$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    HeapBlock.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.HeapBlock.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.types.CIntegerField;

public class HeapBlock$Header
  extends VMObject
{
  public HeapBlock$Header(Address addr)
  {
    super(addr);
  }
  
  public long getLength()
  {
    return HeapBlock.access$100().getValue(addr);
  }
  
  public boolean isFree()
  {
    return HeapBlock.access$200().getValue(addr) == 0L;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.HeapBlock.Header
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.runtime.VMObjectFactory;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Field;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class HeapBlock
  extends VMObject
{
  private static long heapBlockSize;
  private static Field headerField;
  private static CIntegerField headerLengthField;
  private static CIntegerField headerUsedField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        HeapBlock.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("HeapBlock");
    heapBlockSize = type.getSize();
    headerField = type.getField("_header");
    
    type = db.lookupType("HeapBlock::Header");
    headerLengthField = type.getCIntegerField("_length");
    headerUsedField = type.getCIntegerField("_used");
  }
  
  public HeapBlock(Address addr)
  {
    super(addr);
  }
  
  public long getLength()
  {
    return getHeader().getLength();
  }
  
  public boolean isFree()
  {
    return getHeader().isFree();
  }
  
  public Address getAllocatedSpace()
  {
    return addr.addOffsetTo(heapBlockSize);
  }
  
  public static class Header
    extends VMObject
  {
    public Header(Address addr)
    {
      super();
    }
    
    public long getLength()
    {
      return HeapBlock.headerLengthField.getValue(addr);
    }
    
    public boolean isFree()
    {
      return HeapBlock.headerUsedField.getValue(addr) == 0L;
    }
  }
  
  private Header getHeader()
  {
    return (Header)VMObjectFactory.newObject(Header.class, addr.addOffsetTo(headerField.getOffset()));
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.HeapBlock
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class LinearAllocBlock$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    LinearAllocBlock.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.LinearAllocBlock.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class LinearAllocBlock
  extends VMObject
{
  private static CIntegerField word_sizeField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        LinearAllocBlock.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("LinearAllocBlock");
    word_sizeField = type.getCIntegerField("_word_size");
  }
  
  public long word_size()
  {
    return word_sizeField.getValue(addr);
  }
  
  public LinearAllocBlock(Address addr)
  {
    super(addr);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.LinearAllocBlock
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.runtime.VM;

final class LoaderConstraintEntry$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    LoaderConstraintEntry.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.memory.LoaderConstraintEntry.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package sun.jvm.hotspot.memory;

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.Symbol;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.OopField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.utilities.Assert;
import sun.jvm.hotspot.utilities.HashtableEntry;

public class LoaderConstraintEntry
  extends HashtableEntry
{
  private static OopField nameField;
  private static CIntegerField numLoadersField;
  private static CIntegerField maxLoadersField;
  private static AddressField loadersField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        LoaderConstraintEntry.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("LoaderConstraintEntry");
    nameField = type.getOopField("_name");
    numLoadersField = type.getCIntegerField("_num_loaders");
    maxLoadersField = type.getCIntegerField("_max_loaders");
    loadersField = type.getAddressField("_loaders");
  }
  
  public Symbol name()
  {
    return (Symbol)VM.getVM().getObjectHeap().newOop(nameField.getValue(addr));
  }
  
  public int numLoaders()
  {
    return (int)numLoadersField.getValue(addr);
  }
  
  public int maxLoaders()
  {
    return 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd