sa-jdi

olean oopsContains(Address addr)
  {
    return (oopsBegin().lessThanOrEqual(addr)) && (oopsEnd().greaterThan(addr));
  }
  
  public boolean scopesDataContains(Address addr)
  {
    return (scopesDataBegin().lessThanOrEqual(addr)) && (scopesDataEnd().greaterThan(addr));
  }
  
  public boolean scopesPCsContains(Address addr)
  {
    return (scopesPCsBegin().lessThanOrEqual(addr)) && (scopesPCsEnd().greaterThan(addr));
  }
  
  public boolean handlerTableContains(Address addr)
  {
    return (handlerTableBegin().lessThanOrEqual(addr)) && (handlerTableEnd().greaterThan(addr));
  }
  
  public boolean nulChkTableContains(Address addr)
  {
    return (nulChkTableBegin().lessThanOrEqual(addr)) && (nulChkTableEnd().greaterThan(addr));
  }
  
  public Address getEntryPoint()
  {
    return entryPointField.getValue(addr);
  }
  
  public Address getVerifiedEntryPoint()
  {
    return verifiedEntryPointField.getValue(addr);
  }
  
  public OopHandle getOopAt(int index)
  {
    if (index == 0) {
      return null;
    }
    if (Assert.ASSERTS_ENABLED) {
      Assert.that((index > 0) && (index <= oopsSize()), "must be a valid non-zero index");
    }
    return oopsBegin().getOopHandleAt((index - 1) * VM.getVM().getOopSize());
  }
  
  public boolean isZombie()
  {
    return false;
  }
  
  public int getOSREntryBCI()
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(getEntryBCI() != VM.getVM().getInvocationEntryBCI(), "wrong kind of nmethod");
    }
    return getEntryBCI();
  }
  
  public NMethod getOSRLink()
  {
    return (NMethod)VMObjectFactory.newObject(NMethod.class, osrLinkField.getValue(addr));
  }
  
  public NMethod getScavengeRootLink()
  {
    return (NMethod)VMObjectFactory.newObject(NMethod.class, scavengeRootLinkField.getValue(addr));
  }
  
  public int getScavengeRootState()
  {
    return scavengeRootStateField.getValue(addr);
  }
  
  public boolean canBeDeoptimized()
  {
    return isJavaMethod();
  }
  
  public boolean isLockedByVM()
  {
    return lockCountField.getValue(addr) > 0;
  }
  
  public PCDesc getPCDescAt(Address pc)
  {
    for (Address p = scopesPCsBegin(); p.lessThan(scopesPCsEnd()); p = p.addOffsetTo(pcDescSize))
    {
      PCDesc pcDesc = new PCDesc(p);
      if (pcDesc.getRealPC(this).equals(pc)) {
        return pcDesc;
      }
    }
    return null;
  }
  
  public ScopeDesc getScopeDescAt(Address pc)
  {
    PCDesc pd = getPCDescAt(pc);
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(pd != null, "scope must be present");
    }
    return new ScopeDesc(this, pd.getScopeDecodeOffset(), pd.getObjDecodeOffset(), pd.getReexecute());
  }
  
  public PCDesc getPCDescNearDbg(Address pc)
  {
    PCDesc bestGuessPCDesc = null;
    long bestDistance = 0L;
    for (Address p = scopesPCsBegin(); p.lessThan(scopesPCsEnd()); p = p.addOffsetTo(pcDescSize))
    {
      PCDesc pcDesc = new PCDesc(p);
      
      long distance = -pcDesc.getRealPC(this).minus(pc);
      if ((bestGuessPCDesc == null) || ((distance >= 0L) && (distance < bestDistance)))
      {
        bestGuessPCDesc = pcDesc;
        bestDistance = distance;
      }
    }
    return bestGuessPCDesc;
  }
  
  public ScopeDesc getScopeDescNearDbg(Address pc)
  {
    PCDesc pd = getPCDescNearDbg(pc);
    if (pd == null) {
      return null;
    }
    return new ScopeDesc(this, pd.getScopeDecodeOffset(), pd.getObjDecodeOffset(), pd.getReexecute());
  }
  
  public Map getSafepoints()
  {
    Map safepoints = new HashMap();
    Address p = null;
    for (p = scopesPCsBegin(); p.lessThan(scopesPCsEnd()); p = p.addOffsetTo(pcDescSize))
    {
      PCDesc pcDesc = new PCDesc(p);
      Address pc = pcDesc.getRealPC(this);
      safepoints.put(pc, pcDesc);
    }
    return safepoints;
  }
  
  public static int getEntryPointOffset()
  {
    return (int)entryPointField.getOffset();
  }
  
  public static int getVerifiedEntryPointOffset()
  {
    return (int)verifiedEntryPointField.getOffset();
  }
  
  public static int getOSREntryPointOffset()
  {
    return (int)osrEntryPointField.getOffset();
  }
  
  public static int getEntryBCIOffset()
  {
    return (int)entryBCIField.getOffset();
  }
  
  public static int getMethodOffset()
  {
    return (int)methodField.getOffset();
  }
  
  public void print()
  {
    printOn(System.out);
  }
  
  protected void printComponentsOn(PrintStream tty)
  {
    tty.println(" content: [" + contentBegin() + ", " + contentEnd() + "), " + " code: [" + codeBegin() + ", " + codeEnd() + "), " + " data: [" + dataBegin() + ", " + dataEnd() + "), " + " oops: [" + oopsBegin() + ", " + oopsEnd() + "), " + " frame size: " + getFrameSize());
  }
  
  public String toString()
  {
    Method method = getMethod();
    return "NMethod for " + method.getMethodHolder().getName().asString() + "." + method.getName().asString() + method.getSignature().asString() + "==>n" + super.toString();
  }
  
  public String flagsToString()
  {
    return "";
  }
  
  public String getName()
  {
    Method method = getMethod();
    return "NMethod for " + method.getMethodHolder().getName().asString() + "." + method.getName().asString() + method.getSignature().asString();
  }
  
  private int getEntryBCI()
  {
    return (int)entryBCIField.getValue(addr);
  }
  
  private int getExceptionOffset()
  {
    return (int)exceptionOffsetField.getValue(addr);
  }
  
  private int getDeoptOffset()
  {
    return (int)deoptOffsetField.getValue(addr);
  }
  
  private int getStubOffset()
  {
    return (int)stubOffsetField.getValue(addr);
  }
  
  private int getOopsOffset()
  {
    return (int)oopsOffsetField.getValue(addr);
  }
  
  private int getScopesDataOffset()
  {
    return (int)scopesDataOffsetField.getValue(addr);
  }
  
  private int getScopesPCsOffset()
  {
    return (int)scopesPCsOffsetField.getValue(addr);
  }
  
  private int getDependenciesOffset()
  {
    return (int)dependenciesOffsetField.getValue(addr);
  }
  
  private int getHandlerTableOffset()
  {
    return (int)handlerTableOffsetField.getValue(addr);
  }
  
  private int getNulChkTableOffset()
  {
    return (int)nulChkTableOffsetField.getValue(addr);
  }
  
  private int getNMethodEndOffset()
  {
    return (int)nmethodEndOffsetField.getValue(addr);
  }
}

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

import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.utilities.Assert;

public class ObjectValue
  extends ScopeValue
{
  private int id;
  private ScopeValue klass;
  private List fieldsValue;
  
  public ObjectValue(int id)
  {
    this.id = id;
    klass = null;
    fieldsValue = new ArrayList();
  }
  
  public boolean isObject()
  {
    return true;
  }
  
  public int id()
  {
    return id;
  }
  
  public ScopeValue getKlass()
  {
    return klass;
  }
  
  public List getFieldsValue()
  {
    return fieldsValue;
  }
  
  public ScopeValue getFieldAt(int i)
  {
    return (ScopeValue)fieldsValue.get(i);
  }
  
  public int fieldsSize()
  {
    return fieldsValue.size();
  }
  
  public OopHandle getValue()
  {
    return null;
  }
  
  void readObject(DebugInfoReadStream stream)
  {
    klass = readFrom(stream);
    Assert.that(klass.isConstantOop(), "should be constant klass oop");
    int length = stream.readInt();
    for (int i = 0; i < length; i++)
    {
      ScopeValue val = readFrom(stream);
      fieldsValue.add(val);
    }
  }
  
  public void print()
  {
    printOn(System.out);
  }
  
  public void printOn(PrintStream tty)
  {
    tty.print("scalarObj[" + id + "]");
  }
  
  void printFieldsOn(PrintStream tty)
  {
    if (fieldsValue.size() > 0) {
      ((ScopeValue)fieldsValue.get(0)).printOn(tty);
    }
    for (int i = 1; i < fieldsValue.size(); i++)
    {
      tty.print(", ");
      ((ScopeValue)fieldsValue.get(i)).printOn(tty);
    }
  }
}

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

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

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

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

import java.io.PrintStream;
import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.oops.Method;
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 PCDesc
  extends VMObject
{
  private static CIntegerField pcOffsetField;
  private static CIntegerField scopeDecodeOffsetField;
  private static CIntegerField objDecodeOffsetField;
  private static CIntegerField pcFlagsField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        PCDesc.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("PcDesc");
    
    pcOffsetField = type.getCIntegerField("_pc_offset");
    scopeDecodeOffsetField = type.getCIntegerField("_scope_decode_offset");
    objDecodeOffsetField = type.getCIntegerField("_obj_decode_offset");
    pcFlagsField = type.getCIntegerField("_flags");
  }
  
  public PCDesc(Address addr)
  {
    super(addr);
  }
  
  public int getPCOffset()
  {
    return (int)pcOffsetField.getValue(addr);
  }
  
  public int getScopeDecodeOffset()
  {
    return (int)scopeDecodeOffsetField.getValue(addr);
  }
  
  public int getObjDecodeOffset()
  {
    return (int)objDecodeOffsetField.getValue(addr);
  }
  
  public Address getRealPC(NMethod code)
  {
    return code.codeBegin().addOffsetTo(getPCOffset());
  }
  
  public boolean getReexecute()
  {
    int flags = (int)pcFlagsField.getValue(addr);
    return (flags & 0x1) == 1;
  }
  
  public void print(NMethod code)
  {
    printOn(System.out, code);
  }
  
  public void printOn(PrintStream tty, NMethod code)
  {
    tty.println("PCDesc(" + getRealPC(code) + "):");
    for (ScopeDesc sd = code.getScopeDescAt(getRealPC(code)); sd != null; sd = sd.sender())
    {
      tty.print(" ");
      sd.getMethod().printValueOn(tty);
      tty.print("  @" + sd.getBCI());
      tty.print("  reexecute=" + sd.getReexecute());
      tty.println();
    }
  }
}

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

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

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

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

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.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class RuntimeStub
  extends CodeBlob
{
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        RuntimeStub.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("RuntimeStub");
  }
  
  public RuntimeStub(Address addr)
  {
    super(addr);
  }
  
  public boolean isRuntimeStub()
  {
    return true;
  }
  
  public String getName()
  {
    return "RuntimeStub: " + super.getName();
  }
}

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

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

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

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

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.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class SafepointBlob
  extends SingletonBlob
{
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        SafepointBlob.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("SafepointBlob");
  }
  
  public SafepointBlob(Address addr)
  {
    super(addr);
  }
  
  public boolean isSafepointStub()
  {
    return true;
  }
}

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

import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import sun.jvm.hotspot.oops.Method;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.utilities.Assert;

public class ScopeDesc
{
  private NMethod code;
  private Method method;
  private int bci;
  private boolean reexecute;
  private int decodeOffset;
  private int senderDecodeOffset;
  private int localsDecodeOffset;
  private int expressionsDecodeOffset;
  private int monitorsDecodeOffset;
  private List objects;
  
  private ScopeDesc(NMethod code, int decodeOffset, List objects, boolean reexecute)
  {
    this.code = code;
    this.decodeOffset = decodeOffset;
    this.objects = objects;
    this.reexecute = reexecute;
    
    DebugInfoReadStream stream = streamAt(decodeOffset);
    
    senderDecodeOffset = stream.readInt();
    method = ((Method)VM.getVM().getObjectHeap().newOop(stream.readOopHandle()));
    bci = stream.readBCI();
    
    localsDecodeOffset = stream.readInt();
    expressionsDecodeOffset = stream.readInt();
    monitorsDecodeOffset = stream.readInt();
  }
  
  public ScopeDesc(NMethod code, int decodeOffset, int objectDecodeOffset, boolean reexecute)
  {
    this.code = code;
    this.decodeOffset = decodeOffset;
    objects = decodeObjectValues(objectDecodeOffset);
    this.reexecute = reexecute;
    
    DebugInfoReadStream stream = streamAt(decodeOffset);
    
    senderDecodeOffset = stream.readInt();
    method = ((Method)VM.getVM().getObjectHeap().newOop(stream.readOopHandle()));
    bci = stream.readBCI();
    
    localsDecodeOffset = stream.readInt();
    expressionsDecodeOffset = stream.readInt();
    monitorsDecodeOffset = stream.readInt();
  }
  
  public NMethod getNMethod()
  {
    return code;
  }
  
  public Method getMethod()
  {
    return method;
  }
  
  public int getBCI()
  {
    return bci;
  }
  
  public boolean getReexecute()
  {
    return reexecute;
  }
  
  public List getLocals()
  {
    return decodeScopeValues(localsDecodeOffset);
  }
  
  public List getExpressions()
  {
    return decodeScopeValues(expressionsDecodeOffset);
  }
  
  public List getMonitors()
  {
    return decodeMonitorValues(monitorsDecodeOffset);
  }
  
  public List getObjects()
  {
    return objects;
  }
  
  public ScopeDesc sender()
  {
    if (isTop()) {
      return null;
    }
    return new ScopeDesc(code, senderDecodeOffset, objects, false);
  }
  
  public int getDecodeOffset()
  {
    return decodeOffset;
  }
  
  public boolean isTop()
  {
    return senderDecodeOffset == 0;
  }
  
  public boolean equals(Object arg)
  {
    if (arg == null) {
      return false;
    }
    if (!(arg instanceof ScopeDesc)) {
      return false;
    }
    ScopeDesc sd = (ScopeDesc)arg;
    
    return (method.equals(method)) && (bci == bci);
  }
  
  public void printValue()
  {
    printValueOn(System.out);
  }
  
  public void printValueOn(PrintStream tty)
  {
    tty.print("ScopeDesc for ");
    method.printValueOn(tty);
    tty.print(" @bci " + bci);
    tty.println(" reexecute=" + reexecute);
  }
  
  private DebugInfoReadStream streamAt(int decodeOffset)
  {
    return new DebugInfoReadStream(code, decodeOffset, objects);
  }
  
  private List decodeScopeValues(int decodeOffset)
  {
    if (decodeOffset == 0) {
      return null;
    }
    DebugInfoReadStream stream = streamAt(decodeOffset);
    int length = stream.readInt();
    List res = new ArrayList(length);
    for (int i = 0; i < length; i++) {
      res.add(ScopeValue.readFrom(stream));
    }
    return res;
  }
  
  private List decodeMonitorValues(int decodeOffset)
  {
    if (decodeOffset == 0) {
      return null;
    }
    DebugInfoReadStream stream = streamAt(decodeOffset);
    int length = stream.readInt();
    List res = new ArrayList(length);
    for (int i = 0; i < length; i++) {
      res.add(new MonitorValue(stream));
    }
    return res;
  }
  
  private List decodeObjectValues(int decodeOffset)
  {
    if (decodeOffset == 0) {
      return null;
    }
    List res = new ArrayList();
    DebugInfoReadStream stream = new DebugInfoReadStream(code, decodeOffset, res);
    int length = stream.readInt();
    for (int i = 0; i < length; i++) {
      ScopeValue.readFrom(stream);
    }
    Assert.that(res.size() == length, "inconsistent debug information");
    return res;
  }
}

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

import java.io.PrintStream;
import sun.jvm.hotspot.utilities.Assert;

public abstract class ScopeValue
{
  static final int LOCATION_CODE = 0;
  static final int CONSTANT_INT_CODE = 1;
  static final int CONSTANT_OOP_CODE = 2;
  static final int CONSTANT_LONG_CODE = 3;
  static final int CONSTANT_DOUBLE_CODE = 4;
  static final int CONSTANT_OBJECT_CODE = 5;
  static final int CONSTANT_OBJECT_ID_CODE = 6;
  
  public boolean isLocation()
  {
    return false;
  }
  
  public boolean isConstantInt()
  {
    return false;
  }
  
  public boolean isConstantDouble()
  {
    return false;
  }
  
  public boolean isConstantLong()
  {
    return false;
  }
  
  public boolean isConstantOop()
  {
    return false;
  }
  
  public boolean isObject()
  {
    return false;
  }
  
  public static ScopeValue readFrom(DebugInfoReadStream stream)
  {
    switch (stream.readInt())
    {
    case 0: 
      return new LocationValue(stream);
    case 1: 
      return new ConstantIntValue(stream);
    case 2: 
      return new ConstantOopReadValue(stream);
    case 3: 
      return new ConstantLongValue(stream);
    case 4: 
      return new ConstantDoubleValue(stream);
    case 5: 
      return stream.readObjectValue();
    case 6: 
      return stream.getCachedObject();
    }
    Assert.that(false, "should not reach here");
    return null;
  }
  
  public abstract void printOn(PrintStream paramPrintStream);
}

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

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

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

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

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.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class SingletonBlob
  extends CodeBlob
{
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        SingletonBlob.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("SingletonBlob");
  }
  
  public SingletonBlob(Address addr)
  {
    super(addr);
  }
  
  public boolean isSingletonBlob()
  {
    return true;
  }
}

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

import java.io.PrintStream;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.utilities.Assert;

public class Stub
  extends VMObject
{
  public Stub(Address addr)
  {
    super(addr);
  }
  
  public long getSize()
  {
    Assert.that(false, "should not call this");return 0L;
  }
  
  public Address getAddress()
  {
    return addr;
  }
  
  public Address codeBegin()
  {
    Assert.that(false, "should not call this");return null;
  }
  
  public Address codeEnd()
  {
    Assert.that(false, "should not call this");return null;
  }
  
  public void verify()
  {
    Assert.that(false, "should not call this");
  }
  
  public void printOn(PrintStream tty)
  {
    Assert.that(false, "should not call this");
  }
}

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

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

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

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

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.AddressField;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.utilities.Assert;

public class StubQueue
  extends VMObject
{
  private static AddressField stubBufferField;
  private static CIntegerField bufferLimitField;
  private static CIntegerField queueBeginField;
  private static CIntegerField queueEndField;
  private static CIntegerField numberOfStubsField;
  private Class stubType;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        StubQueue.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("StubQueue");
    
    stubBufferField = type.getAddressField("_stub_buffer");
    bufferLimitField = type.getCIntegerField("_buffer_limit");
    queueBeginField = type.getCIntegerField("_queue_begin");
    queueEndField = type.getCIntegerField("_queue_end");
    numberOfStubsField = type.getCIntegerField("_number_of_stubs");
  }
  
  public StubQueue(Address addr, Class stubType)
  {
    super(addr);
    this.stubType = stubType;
  }
  
  public boolean contains(Address pc)
  {
    if (pc == null) {
      return false;
    }
    long offset = pc.minus(getStubBuffer());
    return (0L <= offset) && (offset < getBufferLimit());
  }
  
  public Stub getStubContaining(Address pc)
  {
    if (contains(pc))
    {
      int i = 0;
      for (Stub s = getFirst(); s != null; s = getNext(s)) {
        if (stubContains(s, pc)) {
          return s;
        }
      }
    }
    return null;
  }
  
  public boolean stubContains(Stub s, Address pc)
  {
    return (s.codeBegin().lessThanOrEqual(pc)) && (s.codeEnd().greaterThan(pc));
  }
  
  public int getNumberOfStubs()
  {
    return (int)numberOfStubsField.getValue(addr);
  }
  
  public Stub getFirst()
  {
    return getNumberOfStubs() > 0 ? getStubAt(getQueueBegin()) : null;
  }
  
  public Stub getNext(Stub s)
  {
    long i = getIndexOf(s) + getStubSize(s);
    if (i == getBufferLimit()) {
      i = 0L;
    }
    return i == getQueueEnd() ? null : getStubAt(i);
  }
  
  public Stub getPrev(Stub s)
  {
    if (getIndexOf(s) == getQueueBegin()) {
      return null;
    }
    Stub temp = getFirst();
    Stub prev = null;
    while ((temp != null) && (getIndexOf(temp) != getIndexOf(s)))
    {
      prev = temp;
      temp = getNext(temp);
    }
    return prev;
  }
  
  private long getQueueBegin()
  {
    return queueBeginField.getValue(addr);
  }
  
  private long getQueueEnd()
  {
    return queueEndField.getValue(addr);
  }
  
  private long getBufferLimit()
  {
    return bufferLimitField.getValue(addr);
  }
  
  private Address getStubBuffer()
  {
    return stubBufferField.getValue(addr);
  }
  
  private Stub getStubAt(long offset)
  {
    checkIndex(offset);
    return (Stub)VMObjectFactory.newObject(stubType, getStubBuffer().addOffsetTo(offset));
  }
  
  private long getIndexOf(Stub s)
  {
    long i = s.getAddress().minus(getStubBuffer());
    checkIndex(i);
    return i;
  }
  
  private long getStubSize(Stub s)
  {
    return s.getSize();
  }
  
  private void checkIndex(long i)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that((0L <= i) && (i < getBufferLimit()) && (i % VM.getVM().getAddressSize() == 0L), "illegal index");
    }
  }
}

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

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

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

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

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.Type;
import sun.jvm.hotspot.types.TypeDataBase;

public class UncommonTrapBlob
  extends SingletonBlob
{
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        UncommonTrapBlob.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("UncommonTrapBlob");
  }
  
  public UncommonTrapBlob(Address addr)
  {
    super(addr);
  }
  
  public boolean isUncommonTrapStub()
  {
    return true;
  }
}

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

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

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

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

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.VMReg;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.utilities.Assert;
import sun.jvm.hotspot.utilities.CStringUtilities;

public class VMRegImpl
{
  private static VMReg stack0;
  private static int stack0Val;
  private static Address stack0Addr;
  private static AddressField regNameField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        VMRegImpl.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("VMRegImpl");
    AddressField stack0Field = type.getAddressField("stack0");
    stack0Addr = stack0Field.getValue();
    stack0Val = stack0Addr.hashCode();
    stack0 = new VMReg(stack0Val);
    regNameField = type.getAddressField("regName[0]");
  }
  
  public static VMReg getStack0()
  {
    return stack0;
  }
  
  public static String getRegisterName(int index)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that((index >= 0) && (index < stack0Val), "invalid index : " + index);
    }
    Address regName = regNameField.getStaticFieldAddress();
    long addrSize = VM.getVM().getAddressSize();
    return CStringUtilities.getString(regName.getAddressAt(index * addrSize));
  }
}

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

final class CommandProcessor$1
  extends CommandProcessor.Command
{
  private final CommandProcessor this$0;
  
  CommandProcessor$1(CommandProcessor paramCommandProcessor, String x0, boolean x1)
  {
    super(paramCommandProcessor, x0, x1);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    int tokens = t.countTokens();
    if (tokens != 0)
    {
      usage();
      return;
    }
    CommandProcessor.access$200(this$0);
    CommandProcessor.access$300(this$0).reattach();
    CommandProcessor.access$400(this$0);
  }
}

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

import java.io.PrintStream;
import sun.jvm.hotspot.code.CodeBlob;
import sun.jvm.hotspot.code.CodeCache;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.gc_interface.CollectedHeap;
import sun.jvm.hotspot.memory.Universe;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.ui.tree.CTypeTreeNodeAdapter;
import sun.jvm.hotspot.ui.tree.OopTreeNodeAdapter;
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;

final class CommandProcessor$10
  extends CommandProcessor.Command
{
  private final CommandProcessor this$0;
  
  CommandProcessor$10(CommandProcessor paramCommandProcessor, String x0, String x1, boolean x2)
  {
    super(paramCommandProcessor, x0, x1, x2);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    if (t.countTokens() != 1)
    {
      usage();
    }
    else
    {
      Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
      SimpleTreeNode node = null;
      if (VM.getVM().getUniverse().heap().isInReserved(a))
      {
        OopHandle handle = a.addOffsetToAsOopHandle(0L);
        Oop oop = VM.getVM().getObjectHeap().newOop(handle);
        node = new OopTreeNodeAdapter(oop, null);
        
        CommandProcessor.access$000(this$0).println("instance of " + node.getValue() + " @ " + a + " (size = " + oop.getObjectSize() + ")");
      }
      else if (VM.getVM().getCodeCache().contains(a))
      {
        CodeBlob blob = VM.getVM().getCodeCache().findBlobUnsafe(a);
        a = blob.headerBegin();
      }
      if (node == null)
      {
        Type type = VM.getVM().getTypeDataBase().guessTypeForAddress(a);
        if (type != null)
        {
          CommandProcessor.access$000(this$0).println("Type is " + type.getName() + " (size of " + type.getSize() + ")");
          node = new CTypeTreeNodeAdapter(a, type, null);
        }
      }
      if (node != null) {
        printNode(node);
      }
    }
  }
}

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

import sun.jvm.hotspot.tools.ObjectHistogram;

final class CommandProcessor$11
  extends CommandProcessor.Command
{
  private final CommandProcessor this$0;
  
  CommandProcessor$11(CommandProcessor paramCommandProcessor, String x0, String x1, boolean x2)
  {
    super(paramCommandProcessor, x0, x1, x2);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    ObjectHistogram histo = new ObjectHistogram();
    histo.run(CommandProcessor.access$000(this$0), CommandProcessor.access$800(this$0));
  }
}

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

import sun.jvm.hotspot.tools.StackTrace;

final class CommandProcessor$12
  extends CommandProcessor.Command
{
  private final CommandProcessor this$0;
  
  CommandProcessor$12(CommandProcessor paramCommandProcessor, String x0, String x1, boolean x2)
  {
    super(paramCommandProcessor, x0, x1, x2);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    boolean verbose = false;
    if ((t.countTokens() > 0) && (t.nextToken().equals("-v"))) {
      verbose = true;
    }
    StackTrace jstack = new StackTrace(verbose, true);
    jstack.run(CommandProcessor.access$000(this$0));
  }
}

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

import java.io.PrintStream;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.ui.classbrowser.HTMLGenerator;

final class CommandProcessor$13
  extends CommandProcessor.Command
{
  private final CommandProcessor this$0;
  
  CommandProcessor$13(CommandProcessor paramCommandProcessor, String x0, String x1, boolean x2)
  {
    super(paramCommandProcessor, x0, x1, x2);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    if (t.countTokens() != 1)
    {
      usage();
    }
    else
    {
      Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
      HTMLGenerator gen = new HTMLGenerator(false);
      CommandProcessor.access$000(this$0).println(gen.genHTML(a));
    }
  }
}

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

import java.io.PrintStream;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.JVMDebugger;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.ui.tree.CTypeTreeNodeAdapter;

final class CommandProcessor$14
  extends CommandProcessor.Command
{
  private final CommandProcessor this$0;
  
  CommandProcessor$14(CommandProcessor paramCommandProcessor, String x0, String x1, boolean x2)
  {
    super(paramCommandProcessor, x0, x1, x2);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    if (t.countTokens() != 2)
    {
      usage();
    }
    else
    {
      Type type = CommandProcessor.access$900(this$0).getTypeDataBase().lookupType(t.nextToken());
      Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
      CTypeTreeNodeAdapter node = new CTypeTreeNodeAdapter(a, type, null);
      
      CommandProcessor.access$000(this$0).println("pointer to " + type + " @ " + a + " (size = " + type.getSize() + ")");
      
      printNode(node);
    }
  }
}

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

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

final class CommandProcessor$15
  extends CommandProcessor.Command
{
  private final CommandProcessor this$0;
  
  CommandProcessor$15(CommandProcessor paramCommandProcessor, String x0, String x1, boolean x2)
  {
    super(paramCommandProcessor, x0, x1, x2);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    if (t.countTokens() != 1)
    {
      usage();
    }
    else
    {
      String symbol = t.nextToken();
      Address a = this$0.lookup(symbol);
      CommandProcessor.access$000(this$0).println(symbol + " = " + a);
    }
  }
}

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

import java.io.PrintStream;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.ui.tree.CTypeTreeNodeAdapter;

final class CommandProcessor$16
  extends CommandProcessor.Command
{
  private final CommandProcessor this$0;
  
  CommandProcessor$16(CommandProcessor paramCommandProcessor, String x0, String x1, boolean x2)
  {
    super(paramCommandProcessor, x0, x1, x2);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    if (t.countTokens() > 1)
    {
      usage();
    }
    else if (t.countTokens() == 0)
    {
      CommandProcessor.access$000(this$0).println("All known static fields");
      printNode(new CTypeTreeNodeAdapter(CommandProcessor.access$900(this$0).getTypeDataBase().getTypes()));
    }
    else
    {
      Type type = CommandProcessor.access$900(this$0).getTypeDataBase().lookupType(t.nextToken());
      CommandProcessor.access$000(this$0).println("Static fields of " + type.getName());
      printNode(new CTypeTreeNodeAdapter(type));
    }
  }
}

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

import sun.jvm.hotspot.tools.PMap;

final class CommandProcessor$17
  extends CommandProcessor.Command
{
  private final CommandProcessor this$0;
  
  CommandProcessor$17(CommandProcessor paramCommandProcessor, String x0, String x1, boolean x2)
  {
    super(paramCommandProcessor, x0, x1, x2);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    PMap pmap = new PMap();
    pmap.run(CommandProcessor.access$000(this$0), CommandProcessor.access$300(this$0).getAgent().getDebugger());
  }
}

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

import sun.jvm.hotspot.tools.PStack;

final class CommandProcessor$18
  extends CommandProcessor.Command
{
  private final CommandProcessor this$0;
  
  CommandProcessor$18(CommandProcessor paramCommandProcessor, String x0, String x1, boolean x2)
  {
    super(paramCommandProcessor, x0, x1, x2);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    boolean verbose = false;
    if ((t.countTokens() > 0) && (t.nextToken().equals("-v"))) {
      verbose = true;
    }
    PStack pstack = new PStack(verbose, true);
    pstack.run(CommandProcessor.access$000(this$0), CommandProcessor.access$300(this$0).getAgent().getDebugger());
  }
}

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

final class CommandProcessor$19
  extends CommandProcessor.Command
{
  private final Comma
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