sa-jdi

getString(nameField.getValue(addr));
  }
  
  public void print()
  {
    printOn(System.out);
  }
  
  public void printOn(PrintStream tty)
  {
    tty.print(getName());
    printComponentsOn(tty);
  }
  
  protected void printComponentsOn(PrintStream tty)
  {
    tty.println(" content: [" + contentBegin() + ", " + contentEnd() + "), " + " code: [" + codeBegin() + ", " + codeEnd() + "), " + " data: [" + dataBegin() + ", " + dataEnd() + "), " + " frame size: " + getFrameSize());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.code.CodeBlob
 * 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 CodeCache$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    CodeCache.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.code.CodeCache.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.memory.CodeHeap;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObjectFactory;
import sun.jvm.hotspot.runtime.VirtualConstructor;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.types.WrongTypeException;
import sun.jvm.hotspot.utilities.Assert;

public class CodeCache
{
  private static AddressField heapField;
  private static AddressField scavengeRootNMethodsField;
  private static VirtualConstructor virtualConstructor;
  private CodeHeap heap;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        CodeCache.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("CodeCache");
    
    heapField = type.getAddressField("_heap");
    scavengeRootNMethodsField = type.getAddressField("_scavenge_root_nmethods");
    
    virtualConstructor = new VirtualConstructor(db);
    
    virtualConstructor.addMapping("BufferBlob", BufferBlob.class);
    virtualConstructor.addMapping("nmethod", NMethod.class);
    virtualConstructor.addMapping("RuntimeStub", RuntimeStub.class);
    virtualConstructor.addMapping("SafepointBlob", SafepointBlob.class);
    virtualConstructor.addMapping("DeoptimizationBlob", DeoptimizationBlob.class);
    if (VM.getVM().isServerCompiler())
    {
      virtualConstructor.addMapping("ExceptionBlob", ExceptionBlob.class);
      virtualConstructor.addMapping("UncommonTrapBlob", UncommonTrapBlob.class);
    }
  }
  
  public CodeCache()
  {
    heap = ((CodeHeap)VMObjectFactory.newObject(CodeHeap.class, heapField.getValue()));
  }
  
  public NMethod scavengeRootMethods()
  {
    return (NMethod)VMObjectFactory.newObject(NMethod.class, scavengeRootNMethodsField.getValue());
  }
  
  public boolean contains(Address p)
  {
    return getHeap().contains(p);
  }
  
  public CodeBlob findBlob(Address start)
  {
    CodeBlob result = findBlobUnsafe(start);
    if (result == null) {
      return null;
    }
    if (VM.getVM().isDebugging()) {
      return result;
    }
    if (Assert.ASSERTS_ENABLED) {
      Assert.that((!result.isZombie()) && (!result.isLockedByVM()), "unsafe access to zombie method");
    }
    return result;
  }
  
  public CodeBlob findBlobUnsafe(Address start)
  {
    CodeBlob result = null;
    try
    {
      result = (CodeBlob)virtualConstructor.instantiateWrapperFor(getHeap().findStart(start));
    }
    catch (WrongTypeException wte)
    {
      Address cbAddr = null;
      try
      {
        cbAddr = getHeap().findStart(start);
      }
      catch (Exception findEx)
      {
        findEx.printStackTrace();
      }
      String message = "Couldn't deduce type of CodeBlob ";
      if (cbAddr != null) {
        message = message + "@" + cbAddr + " ";
      }
      message = message + "for PC=" + start;
      
      throw new RuntimeException(message, wte);
    }
    if (result == null) {
      return null;
    }
    if (Assert.ASSERTS_ENABLED) {
      Assert.that((result.blobContains(start)) || (result.blobContains(start.addOffsetTo(8L))), "found wrong CodeBlob");
    }
    return result;
  }
  
  public NMethod findNMethod(Address start)
  {
    CodeBlob cb = findBlob(start);
    if (Assert.ASSERTS_ENABLED) {
      Assert.that((cb == null) || (cb.isNMethod()), "did not find an nmethod");
    }
    return (NMethod)cb;
  }
  
  public NMethod findNMethodUnsafe(Address start)
  {
    CodeBlob cb = findBlobUnsafe(start);
    if (Assert.ASSERTS_ENABLED) {
      Assert.that((cb == null) || (cb.isNMethod()), "did not find an nmethod");
    }
    return (NMethod)cb;
  }
  
  public CodeBlob createCodeBlobWrapper(Address codeBlobAddr)
  {
    try
    {
      return (CodeBlob)virtualConstructor.instantiateWrapperFor(codeBlobAddr);
    }
    catch (Exception e)
    {
      String message = "Unable to deduce type of CodeBlob from address " + codeBlobAddr + " (expected type nmethod, RuntimeStub, ";
      if (VM.getVM().isClientCompiler()) {
        message = message + " or ";
      }
      message = message + "SafepointBlob";
      if (VM.getVM().isServerCompiler()) {
        message = message + ", DeoptimizationBlob, or ExceptionBlob";
      }
      message = message + ")";
      throw new RuntimeException(message);
    }
  }
  
  public void iterate(CodeCacheVisitor visitor)
  {
    CodeHeap heap = getHeap();
    Address ptr = heap.begin();
    Address end = heap.end();
    
    visitor.prologue(ptr, end);
    CodeBlob lastBlob = null;
    while ((ptr != null) && (ptr.lessThan(end)))
    {
      try
      {
        CodeBlob blob = findBlobUnsafe(heap.findStart(ptr));
        if (blob != null)
        {
          visitor.visit(blob);
          if (blob == lastBlob) {
            throw new InternalError("saw same blob twice");
          }
          lastBlob = blob;
        }
      }
      catch (RuntimeException e)
      {
        e.printStackTrace();
      }
      Address next = heap.nextBlock(ptr);
      if ((next != null) && (next.lessThan(ptr))) {
        throw new InternalError("pointer moved backwards");
      }
      ptr = next;
    }
    visitor.epilogue();
  }
  
  private CodeHeap getHeap()
  {
    return heap;
  }
}

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

import sun.jvm.hotspot.debugger.Address;

public abstract interface CodeCacheVisitor
{
  public abstract void prologue(Address paramAddress1, Address paramAddress2);
  
  public abstract void visit(CodeBlob paramCodeBlob);
  
  public abstract void epilogue();
}

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

import sun.jvm.hotspot.debugger.Address;

public class CompressedReadStream
  extends CompressedStream
{
  public CompressedReadStream(Address buffer)
  {
    this(buffer, 0);
  }
  
  public CompressedReadStream(Address buffer, int position)
  {
    super(buffer, position);
  }
  
  public boolean readBoolean()
  {
    return read() != 0;
  }
  
  public byte readByte()
  {
    return (byte)read();
  }
  
  public char readChar()
  {
    return (char)readInt();
  }
  
  public short readShort()
  {
    return (short)readSignedInt();
  }
  
  public int readSignedInt()
  {
    return decodeSign(readInt());
  }
  
  public int readInt()
  {
    int b0 = read();
    if (b0 < 192) {
      return b0;
    }
    return readIntMb(b0);
  }
  
  public float readFloat()
  {
    return Float.intBitsToFloat(reverseInt(readInt()));
  }
  
  public double readDouble()
  {
    int rh = readInt();
    int rl = readInt();
    int h = reverseInt(rh);
    int l = reverseInt(rl);
    return Double.longBitsToDouble(h << 32 | l & 0xFFFFFFFF);
  }
  
  public long readLong()
  {
    long low = readSignedInt() & 0xFFFFFFFF;
    long high = readSignedInt();
    return high << 32 | low;
  }
  
  private int readIntMb(int b0)
  {
    int pos = position - 1;
    int sum = b0;
    
    int lg_H_i = 6;
    int i = 0;
    for (;;)
    {
      int b_i = read(pos + ++i);
      sum += (b_i << lg_H_i);
      if ((b_i < 192) || (i == 4))
      {
        setPosition(pos + i + 1);
        return sum;
      }
      lg_H_i += 6;
    }
  }
  
  private short read(int index)
  {
    return (short)(int)buffer.getCIntegerAt(index, 1L, true);
  }
  
  private short read()
  {
    short retval = (short)(int)buffer.getCIntegerAt(position, 1L, true);
    position += 1;
    return retval;
  }
}

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

import sun.jvm.hotspot.debugger.Address;

public class CompressedStream
{
  protected Address buffer;
  protected int position;
  public static final int LogBitsPerByte = 3;
  public static final int BitsPerByte = 8;
  public static final int lg_H = 6;
  public static final int H = 64;
  public static final int L = 192;
  public static final int MAX_i = 4;
  
  public CompressedStream(Address buffer)
  {
    this(buffer, 0);
  }
  
  public CompressedStream(Address buffer, int position)
  {
    this.buffer = buffer;
    this.position = position;
  }
  
  public Address getBuffer()
  {
    return buffer;
  }
  
  public int getPosition()
  {
    return position;
  }
  
  public void setPosition(int position)
  {
    this.position = position;
  }
  
  public int encodeSign(int value)
  {
    return value << 1 ^ value >> 31;
  }
  
  public int decodeSign(int value)
  {
    return value >>> 1 ^ -(value & 0x1);
  }
  
  public int reverseInt(int i)
  {
    i = (i & 0x55555555) << 1 | i >>> 1 & 0x55555555;
    i = (i & 0x33333333) << 3 | i >>> 2 & 0x33333333;
    i = (i & 0xF0F0F0F) << 4 | i >>> 4 & 0xF0F0F0F;
    i = i << 24 | (i & 0xFF00) << 8 | i >>> 8 & 0xFF00 | i >>> 24;
    return i;
  }
}

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

import sun.jvm.hotspot.debugger.Address;

public class CompressedWriteStream
  extends CompressedStream
{
  public CompressedWriteStream(Address buffer)
  {
    this(buffer, 0);
  }
  
  public CompressedWriteStream(Address buffer, int position)
  {
    super(buffer, position);
  }
}

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

import java.io.PrintStream;

public class ConstantDoubleValue
  extends ScopeValue
{
  private double value;
  
  public ConstantDoubleValue(double value)
  {
    this.value = value;
  }
  
  public boolean isConstantDouble()
  {
    return true;
  }
  
  public double getValue()
  {
    return value;
  }
  
  ConstantDoubleValue(DebugInfoReadStream stream)
  {
    value = stream.readDouble();
  }
  
  public void print()
  {
    printOn(System.out);
  }
  
  public void printOn(PrintStream tty)
  {
    tty.print(value);
  }
}

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

import java.io.PrintStream;

public class ConstantIntValue
  extends ScopeValue
{
  private int value;
  
  public ConstantIntValue(int value)
  {
    this.value = value;
  }
  
  public boolean isConstantInt()
  {
    return true;
  }
  
  public int getValue()
  {
    return value;
  }
  
  ConstantIntValue(DebugInfoReadStream stream)
  {
    value = stream.readSignedInt();
  }
  
  public void print()
  {
    printOn(System.out);
  }
  
  public void printOn(PrintStream tty)
  {
    tty.print(value);
  }
}

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

import java.io.PrintStream;

public class ConstantLongValue
  extends ScopeValue
{
  private long value;
  
  public ConstantLongValue(long value)
  {
    this.value = value;
  }
  
  public boolean isConstantLong()
  {
    return true;
  }
  
  public long getValue()
  {
    return value;
  }
  
  ConstantLongValue(DebugInfoReadStream stream)
  {
    value = stream.readLong();
  }
  
  public void print()
  {
    printOn(System.out);
  }
  
  public void printOn(PrintStream tty)
  {
    tty.print(value);
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.code.ConstantLongValue
 * 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.OopHandle;

public class ConstantOopReadValue
  extends ScopeValue
{
  private OopHandle value;
  
  public ConstantOopReadValue(DebugInfoReadStream stream)
  {
    value = stream.readOopHandle();
  }
  
  public boolean isConstantOop()
  {
    return true;
  }
  
  public OopHandle getValue()
  {
    return value;
  }
  
  public void print()
  {
    printOn(System.out);
  }
  
  public void printOn(PrintStream tty)
  {
    tty.print(value);
  }
}

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

import java.util.Iterator;
import java.util.List;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.utilities.Assert;

public class DebugInfoReadStream
  extends CompressedReadStream
{
  private NMethod code;
  private int InvocationEntryBCI;
  private List objectPool;
  
  public DebugInfoReadStream(NMethod code, int offset)
  {
    super(code.scopesDataBegin(), offset);
    InvocationEntryBCI = VM.getVM().getInvocationEntryBCI();
    this.code = code;
    objectPool = null;
  }
  
  public DebugInfoReadStream(NMethod code, int offset, List objectPool)
  {
    super(code.scopesDataBegin(), offset);
    InvocationEntryBCI = VM.getVM().getInvocationEntryBCI();
    this.code = code;
    this.objectPool = objectPool;
  }
  
  public OopHandle readOopHandle()
  {
    return code.getOopAt(readInt());
  }
  
  ScopeValue readObjectValue()
  {
    int id = readInt();
    Iterator itr;
    if (Assert.ASSERTS_ENABLED)
    {
      Assert.that(objectPool != null, "object pool does not exist");
      for (itr = objectPool.iterator(); itr.hasNext();)
      {
        ObjectValue ov = (ObjectValue)itr.next();
        Assert.that(ov.id() != id, "should not be read twice");
      }
    }
    ObjectValue result = new ObjectValue(id);
    
    objectPool.add(result);
    result.readObject(this);
    return result;
  }
  
  ScopeValue getCachedObject()
  {
    int id = readInt();
    Assert.that(objectPool != null, "object pool does not exist");
    for (Iterator itr = objectPool.iterator(); itr.hasNext();)
    {
      ObjectValue ov = (ObjectValue)itr.next();
      if (ov.id() == id) {
        return ov;
      }
    }
    Assert.that(false, "should not reach here");
    return null;
  }
  
  public int readBCI()
  {
    return readInt() + InvocationEntryBCI;
  }
}

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

public class DebugInformationRecorder
{
  public static final int SERIALIZED_NULL = 0;
  public static final int SYNCHRONIZATION_ENTRY_BCI = -1;
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.code.DebugInformationRecorder
 * 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 DeoptimizationBlob$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    DeoptimizationBlob.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.code.DeoptimizationBlob.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 DeoptimizationBlob
  extends SingletonBlob
{
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        DeoptimizationBlob.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("DeoptimizationBlob");
  }
  
  public DeoptimizationBlob(Address addr)
  {
    super(addr);
  }
  
  public boolean isDeoptimizationStub()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.code.DeoptimizationBlob
 * 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 ExceptionBlob$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    ExceptionBlob.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.code.ExceptionBlob.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 ExceptionBlob
  extends SingletonBlob
{
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        ExceptionBlob.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("ExceptionBlob");
  }
  
  public ExceptionBlob(Address addr)
  {
    super(addr);
  }
  
  public boolean isExceptionStub()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.code.ExceptionBlob
 * 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 Location$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    Location.access$000(VM.getVM().getTypeDataBase());
  }
}

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

public class Location$Type
{
  public static final Type NORMAL = new Type("normal");
  public static final Type OOP = new Type("oop");
  public static final Type NARROWOOP = new Type("narrowoop");
  public static final Type INT_IN_LONG = new Type("int_in_long");
  public static final Type LNG = new Type("lng");
  public static final Type FLOAT_IN_DBL = new Type("float_in_dbl");
  public static final Type DBL = new Type("dbl");
  public static final Type ADDR = new Type("addr");
  public static final Type INVALID = new Type("invalid");
  private String value;
  
  private Location$Type(String value)
  {
    this.value = value;
  }
  
  public String toString()
  {
    return value;
  }
  
  public int getValue()
  {
    if (this == NORMAL) {
      return Location.access$300();
    }
    if (this == OOP) {
      return Location.access$400();
    }
    if (this == NARROWOOP) {
      return Location.access$500();
    }
    if (this == INT_IN_LONG) {
      return Location.access$600();
    }
    if (this == LNG) {
      return Location.access$700();
    }
    if (this == FLOAT_IN_DBL) {
      return Location.access$800();
    }
    if (this == DBL) {
      return Location.access$900();
    }
    if (this == ADDR) {
      return Location.access$1000();
    }
    if (this == INVALID) {
      return Location.access$1100();
    }
    throw new RuntimeException("should not reach here");
  }
}

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

public class Location$Where
{
  public static final Where ON_STACK = new Where("on_stack");
  public static final Where IN_REGISTER = new Where("in_register");
  private String value;
  
  private Location$Where(String value)
  {
    this.value = value;
  }
  
  public String toString()
  {
    return value;
  }
  
  public int getValue()
  {
    if (this == ON_STACK) {
      return Location.access$100();
    }
    if (this == IN_REGISTER) {
      return Location.access$200();
    }
    throw new RuntimeException("should not reach here");
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.code.Location.Where
 * 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.runtime.VM;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.utilities.Assert;

public class Location
{
  private int value;
  private static int OFFSET_MASK;
  private static int OFFSET_SHIFT;
  private static int TYPE_MASK;
  private static int TYPE_SHIFT;
  private static int WHERE_MASK;
  private static int WHERE_SHIFT;
  private static int TYPE_NORMAL;
  private static int TYPE_OOP;
  private static int TYPE_NARROWOOP;
  private static int TYPE_INT_IN_LONG;
  private static int TYPE_LNG;
  private static int TYPE_FLOAT_IN_DBL;
  private static int TYPE_DBL;
  private static int TYPE_ADDR;
  private static int TYPE_INVALID;
  private static int WHERE_ON_STACK;
  private static int WHERE_IN_REGISTER;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        Location.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(!VM.getVM().isCore(), "Debug info not used in core build");
    }
    OFFSET_MASK = db.lookupIntConstant("Location::OFFSET_MASK").intValue();
    OFFSET_SHIFT = db.lookupIntConstant("Location::OFFSET_SHIFT").intValue();
    TYPE_MASK = db.lookupIntConstant("Location::TYPE_MASK").intValue();
    TYPE_SHIFT = db.lookupIntConstant("Location::TYPE_SHIFT").intValue();
    WHERE_MASK = db.lookupIntConstant("Location::WHERE_MASK").intValue();
    WHERE_SHIFT = db.lookupIntConstant("Location::WHERE_SHIFT").intValue();
    
    TYPE_NORMAL = db.lookupIntConstant("Location::normal").intValue();
    TYPE_OOP = db.lookupIntConstant("Location::oop").intValue();
    TYPE_NARROWOOP = db.lookupIntConstant("Location::narrowoop").intValue();
    TYPE_INT_IN_LONG = db.lookupIntConstant("Location::int_in_long").intValue();
    TYPE_LNG = db.lookupIntConstant("Location::lng").intValue();
    TYPE_FLOAT_IN_DBL = db.lookupIntConstant("Location::float_in_dbl").intValue();
    TYPE_DBL = db.lookupIntConstant("Location::dbl").intValue();
    TYPE_ADDR = db.lookupIntConstant("Location::addr").intValue();
    TYPE_INVALID = db.lookupIntConstant("Location::invalid").intValue();
    
    WHERE_ON_STACK = db.lookupIntConstant("Location::on_stack").intValue();
    WHERE_IN_REGISTER = db.lookupIntConstant("Location::in_register").intValue();
  }
  
  public static class Where
  {
    public static final Where ON_STACK = new Where("on_stack");
    public static final Where IN_REGISTER = new Where("in_register");
    private String value;
    
    private Where(String value)
    {
      this.value = value;
    }
    
    public String toString()
    {
      return value;
    }
    
    public int getValue()
    {
      if (this == ON_STACK) {
        return Location.WHERE_ON_STACK;
      }
      if (this == IN_REGISTER) {
        return Location.WHERE_IN_REGISTER;
      }
      throw new RuntimeException("should not reach here");
    }
  }
  
  public static class Type
  {
    public static final Type NORMAL = new Type("normal");
    public static final Type OOP = new Type("oop");
    public static final Type NARROWOOP = new Type("narrowoop");
    public static final Type INT_IN_LONG = new Type("int_in_long");
    public static final Type LNG = new Type("lng");
    public static final Type FLOAT_IN_DBL = new Type("float_in_dbl");
    public static final Type DBL = new Type("dbl");
    public static final Type ADDR = new Type("addr");
    public static final Type INVALID = new Type("invalid");
    private String value;
    
    private Type(String value)
    {
      this.value = value;
    }
    
    public String toString()
    {
      return value;
    }
    
    public int getValue()
    {
      if (this == NORMAL) {
        return Location.TYPE_NORMAL;
      }
      if (this == OOP) {
        return Location.TYPE_OOP;
      }
      if (this == NARROWOOP) {
        return Location.TYPE_NARROWOOP;
      }
      if (this == INT_IN_LONG) {
        return Location.TYPE_INT_IN_LONG;
      }
      if (this == LNG) {
        return Location.TYPE_LNG;
      }
      if (this == FLOAT_IN_DBL) {
        return Location.TYPE_FLOAT_IN_DBL;
      }
      if (this == DBL) {
        return Location.TYPE_DBL;
      }
      if (this == ADDR) {
        return Location.TYPE_ADDR;
      }
      if (this == INVALID) {
        return Location.TYPE_INVALID;
      }
      throw new RuntimeException("should not reach here");
    }
  }
  
  Location(Where where, Type type, int offset)
  {
    setWhere(where);
    setType(type);
    setOffset(offset);
  }
  
  public Where getWhere()
  {
    int where = (value & WHERE_MASK) >> WHERE_SHIFT;
    if (where == WHERE_ON_STACK) {
      return Where.ON_STACK;
    }
    if (where == WHERE_IN_REGISTER) {
      return Where.IN_REGISTER;
    }
    throw new RuntimeException("should not reach here");
  }
  
  public Type getType()
  {
    int type = (value & TYPE_MASK) >> TYPE_SHIFT;
    if (type == TYPE_NORMAL) {
      return Type.NORMAL;
    }
    if (type == TYPE_OOP) {
      return Type.OOP;
    }
    if (type == TYPE_NARROWOOP) {
      return Type.NARROWOOP;
    }
    if (type == TYPE_INT_IN_LONG) {
      return Type.INT_IN_LONG;
    }
    if (type == TYPE_LNG) {
      return Type.LNG;
    }
    if (type == TYPE_FLOAT_IN_DBL) {
      return Type.FLOAT_IN_DBL;
    }
    if (type == TYPE_DBL) {
      return Type.DBL;
    }
    if (type == TYPE_ADDR) {
      return Type.ADDR;
    }
    if (type == TYPE_INVALID) {
      return Type.INVALID;
    }
    throw new RuntimeException("should not reach here");
  }
  
  public short getOffset()
  {
    return (short)((value & OFFSET_MASK) >> OFFSET_SHIFT);
  }
  
  public boolean isRegister()
  {
    return getWhere() == Where.IN_REGISTER;
  }
  
  public boolean isStack()
  {
    return getWhere() == Where.ON_STACK;
  }
  
  public boolean holdsOop()
  {
    return getType() == Type.OOP;
  }
  
  public boolean holdsNarrowOop()
  {
    return getType() == Type.NARROWOOP;
  }
  
  public boolean holdsInt()
  {
    return getType() == Type.INT_IN_LONG;
  }
  
  public boolean holdsLong()
  {
    return getType() == Type.LNG;
  }
  
  public boolean holdsFloat()
  {
    return getType() == Type.FLOAT_IN_DBL;
  }
  
  public boolean holdsDouble()
  {
    return getType() == Type.DBL;
  }
  
  public boolean holdsAddr()
  {
    return getType() == Type.ADDR;
  }
  
  public boolean isIllegal()
  {
    return getType() == Type.INVALID;
  }
  
  public int getStackOffset()
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(getWhere() == Where.ON_STACK, "wrong Where");
    }
    return getOffset() * (int)VM.getVM().getIntSize();
  }
  
  public int getRegisterNumber()
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(getWhere() == Where.IN_REGISTER, "wrong Where");
    }
    return getOffset();
  }
  
  public void print()
  {
    printOn(System.out);
  }
  
  public void printOn(PrintStream tty)
  {
    tty.print("Value " + value + ", ");
    if (isIllegal())
    {
      tty.print("Illegal");
    }
    else
    {
      Where w = getWhere();
      if (w == Where.ON_STACK) {
        tty.print("stack[" + getStackOffset() + "]");
      } else if (w == Where.IN_REGISTER) {
        tty.print("reg " + getRegisterNumber());
      }
      Type type = getType();
      if (type != Type.NORMAL) {
        if (type == Type.OOP) {
          tty.print(",oop");
        } else if (type == Type.NARROWOOP) {
          tty.print(",narrowoop");
        } else if (type == Type.INT_IN_LONG) {
          tty.print(",int");
        } else if (type == Type.LNG) {
          tty.print(",long");
        } else if (type == Type.FLOAT_IN_DBL) {
          tty.print(",float");
        } else if (type == Type.DBL) {
          tty.print(",double");
        } else if (type == Type.ADDR) {
          tty.print(",address");
        } else if (type == Type.INVALID) {
          tty.print(",invalid");
        }
      }
    }
  }
  
  public Location(DebugInfoReadStream stream)
  {
    value = stream.readInt();
  }
  
  private void setWhere(Where where)
  {
    value |= where.getValue() << WHERE_SHIFT & WHERE_MASK;
  }
  
  private void setType(Type type)
  {
    value |= type.getValue() << TYPE_SHIFT & TYPE_MASK;
  }
  
  private void setOffset(int offset)
  {
    value |= offset << OFFSET_SHIFT & OFFSET_MASK;
  }
}

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

import java.io.PrintStream;

public class LocationValue
  extends ScopeValue
{
  private Location location;
  
  public LocationValue(Location location)
  {
    this.location = location;
  }
  
  public boolean isLocation()
  {
    return true;
  }
  
  public Location getLocation()
  {
    return location;
  }
  
  LocationValue(DebugInfoReadStream stream)
  {
    location = new Location(stream);
  }
  
  public void print()
  {
    printOn(System.out);
  }
  
  public void printOn(PrintStream tty)
  {
    getLocation().printOn(tty);
  }
}

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

import java.io.PrintStream;

public class MonitorValue
{
  private ScopeValue owner;
  private Location basicLock;
  private boolean eliminated;
  
  public MonitorValue(DebugInfoReadStream stream)
  {
    basicLock = new Location(stream);
    owner = ScopeValue.readFrom(stream);
    eliminated = stream.readBoolean();
  }
  
  public ScopeValue owner()
  {
    return owner;
  }
  
  public Location basicLock()
  {
    return basicLock;
  }
  
  public boolean eliminated()
  {
    return eliminated;
  }
  
  public void printOn(PrintStream tty)
  {
    tty.print("monitor{");
    owner().printOn(tty);
    tty.print(",");
    basicLock().printOn(tty);
    tty.print("}");
    if (eliminated) {
      tty.print(" (eliminated)");
    }
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.code.MonitorValue
 * 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 NMethod$1
  implements Observer
{
  public void update(Observable o, Object data)
  {
    NMethod.access$000(VM.getVM().getTypeDataBase());
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.code.NMethod.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.HashMap;
import java.util.Map;
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.Klass;
import sun.jvm.hotspot.oops.Method;
import sun.jvm.hotspot.oops.ObjectHeap;
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.CIntegerField;
import sun.jvm.hotspot.types.JByteField;
import sun.jvm.hotspot.types.JIntField;
import sun.jvm.hotspot.types.OopField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.utilities.Assert;

public class NMethod
  extends CodeBlob
{
  private static long pcDescSize;
  private static OopField methodField;
  private static CIntegerField entryBCIField;
  private static AddressField osrLinkField;
  private static AddressField scavengeRootLinkField;
  private static JByteField scavengeRootStateField;
  private static CIntegerField exceptionOffsetField;
  private static CIntegerField deoptOffsetField;
  private static CIntegerField origPCOffsetField;
  private static CIntegerField stubOffsetField;
  private static CIntegerField oopsOffsetField;
  private static CIntegerField scopesDataOffsetField;
  private static CIntegerField scopesPCsOffsetField;
  private static CIntegerField dependenciesOffsetField;
  private static CIntegerField handlerTableOffsetField;
  private static CIntegerField nulChkTableOffsetField;
  private static CIntegerField nmethodEndOffsetField;
  private static AddressField entryPointField;
  private static AddressField verifiedEntryPointField;
  private static AddressField osrEntryPointField;
  private static JIntField lockCountField;
  private static CIntegerField stackTraversalMarkField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        NMethod.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("nmethod");
    
    methodField = type.getOopField("_method");
    entryBCIField = type.getCIntegerField("_entry_bci");
    osrLinkField = type.getAddressField("_osr_link");
    scavengeRootLinkField = type.getAddressField("_scavenge_root_link");
    scavengeRootStateField = type.getJByteField("_scavenge_root_state");
    
    exceptionOffsetField = type.getCIntegerField("_exception_offset");
    deoptOffsetField = type.getCIntegerField("_deoptimize_offset");
    origPCOffsetField = type.getCIntegerField("_orig_pc_offset");
    stubOffsetField = type.getCIntegerField("_stub_offset");
    oopsOffsetField = type.getCIntegerField("_oops_offset");
    scopesDataOffsetField = type.getCIntegerField("_scopes_data_offset");
    scopesPCsOffsetField = type.getCIntegerField("_scopes_pcs_offset");
    dependenciesOffsetField = type.getCIntegerField("_dependencies_offset");
    handlerTableOffsetField = type.getCIntegerField("_handler_table_offset");
    nulChkTableOffsetField = type.getCIntegerField("_nul_chk_table_offset");
    nmethodEndOffsetField = type.getCIntegerField("_nmethod_end_offset");
    entryPointField = type.getAddressField("_entry_point");
    verifiedEntryPointField = type.getAddressField("_verified_entry_point");
    osrEntryPointField = type.getAddressField("_osr_entry_point");
    lockCountField = type.getJIntField("_lock_count");
    stackTraversalMarkField = type.getCIntegerField("_stack_traversal_mark");
    
    pcDescSize = db.lookupType("PcDesc").getSize();
  }
  
  public NMethod(Address addr)
  {
    super(addr);
  }
  
  public Address getAddress()
  {
    return addr;
  }
  
  public Method getMethod()
  {
    return (Method)VM.getVM().getObjectHeap().newOop(methodField.getValue(addr));
  }
  
  public boolean isNMethod()
  {
    return true;
  }
  
  public boolean isJavaMethod()
  {
    return !getMethod().isNative();
  }
  
  public boolean isNativeMethod()
  {
    return getMethod().isNative();
  }
  
  public boolean isOSRMethod()
  {
    return getEntryBCI() != VM.getVM().getInvocationEntryBCI();
  }
  
  public Address constantsBegin()
  {
    return contentBegin();
  }
  
  public Address constantsEnd()
  {
    return getEntryPoint();
  }
  
  public Address instsBegin()
  {
    return codeBegin();
  }
  
  public Address instsEnd()
  {
    return headerBegin().addOffsetTo(getStubOffset());
  }
  
  public Address exceptionBegin()
  {
    return headerBegin().addOffsetTo(getExceptionOffset());
  }
  
  public Address deoptBegin()
  {
    return headerBegin().addOffsetTo(getDeoptOffset());
  }
  
  public Address stubBegin()
  {
    return headerBegin().addOffsetTo(getStubOffset());
  }
  
  public Address stubEnd()
  {
    return headerBegin().addOffsetTo(getOopsOffset());
  }
  
  public Address oopsBegin()
  {
    return headerBegin().addOffsetTo(getOopsOffset());
  }
  
  public Address oopsEnd()
  {
    return headerBegin().addOffsetTo(getScopesDataOffset());
  }
  
  public Address scopesDataBegin()
  {
    return headerBegin().addOffsetTo(getScopesDataOffset());
  }
  
  public Address scopesDataEnd()
  {
    return headerBegin().addOffsetTo(getScopesPCsOffset());
  }
  
  public Address scopesPCsBegin()
  {
    return headerBegin().addOffsetTo(getScopesPCsOffset());
  }
  
  public Address scopesPCsEnd()
  {
    return headerBegin().addOffsetTo(getDependenciesOffset());
  }
  
  public Address dependenciesBegin()
  {
    return headerBegin().addOffsetTo(getDependenciesOffset());
  }
  
  public Address dependenciesEnd()
  {
    return headerBegin().addOffsetTo(getHandlerTableOffset());
  }
  
  public Address handlerTableBegin()
  {
    return headerBegin().addOffsetTo(getHandlerTableOffset());
  }
  
  public Address handlerTableEnd()
  {
    return headerBegin().addOffsetTo(getNulChkTableOffset());
  }
  
  public Address nulChkTableBegin()
  {
    return headerBegin().addOffsetTo(getNulChkTableOffset());
  }
  
  public Address nulChkTableEnd()
  {
    return headerBegin().addOffsetTo(getNMethodEndOffset());
  }
  
  public int constantsSize()
  {
    return (int)constantsEnd().minus(constantsBegin());
  }
  
  public int instsSize()
  {
    return (int)instsEnd().minus(instsBegin());
  }
  
  public int stubSize()
  {
    return (int)stubEnd().minus(stubBegin());
  }
  
  public int oopsSize()
  {
    return (int)oopsEnd().minus(oopsBegin());
  }
  
  public int scopesDataSize()
  {
    return (int)scopesDataEnd().minus(scopesDataBegin());
  }
  
  public int scopesPCsSize()
  {
    return (int)scopesPCsEnd().minus(scopesPCsBegin());
  }
  
  public int dependenciesSize()
  {
    return (int)dependenciesEnd().minus(dependenciesBegin());
  }
  
  public int handlerTableSize()
  {
    return (int)handlerTableEnd().minus(handlerTableBegin());
  }
  
  public int nulChkTableSize()
  {
    return (int)nulChkTableEnd().minus(nulChkTableBegin());
  }
  
  public int origPCOffset()
  {
    return (int)origPCOffsetField.getValue(addr);
  }
  
  public int totalSize()
  {
    return constantsSize() + instsSize() + stubSize() + scopesDataSize() + scopesPCsSize() + dependenciesSize() + handlerTableSize() + nulChkTableSize();
  }
  
  public boolean constantsContains(Address addr)
  {
    return (constantsBegin().lessThanOrEqual(addr)) && (constantsEnd().greaterThan(addr));
  }
  
  public boolean instsContains(Address addr)
  {
    return (instsBegin().lessThanOrEqual(addr)) && (instsEnd().greaterThan(addr));
  }
  
  public boolean stubContains(Address addr)
  {
    return (stubBegin().lessThanOrEqual(addr)) && (stubEnd().greaterThan(addr));
  }
  
  public bo
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