sa-jdi

ert.ASSERTS_ENABLED) {
      Assert.that(location.isStack(), "for now we only look at the stack");
    }
    int byteOffset = location.getStackOffset();
    
    return new BasicLock(getFrame().getUnextendedSP().addOffsetTo(byteOffset));
  }
}

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

import sun.jvm.hotspot.debugger.Address;

public class CompilerThread
  extends JavaThread
{
  public CompilerThread(Address addr)
  {
    super(addr);
  }
  
  public boolean isJavaThread()
  {
    return false;
  }
  
  public boolean isHiddenFromExternalView()
  {
    return true;
  }
  
  public boolean isCompilerThread()
  {
    return true;
  }
}

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

import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import sun.jvm.hotspot.oops.DefaultHeapVisitor;
import sun.jvm.hotspot.oops.Oop;

final class ConcurrentLocksPrinter$1
  extends DefaultHeapVisitor
{
  private final ConcurrentLocksPrinter this$0;
  
  ConcurrentLocksPrinter$1(ConcurrentLocksPrinter paramConcurrentLocksPrinter) {}
  
  public boolean doObj(Oop oop)
  {
    JavaThread thread = ConcurrentLocksPrinter.access$000(this$0, oop);
    if (thread != null)
    {
      List locks = (List)ConcurrentLocksPrinter.access$100(this$0).get(thread);
      if (locks == null)
      {
        locks = new LinkedList();
        ConcurrentLocksPrinter.access$100(this$0).put(thread, locks);
      }
      locks.add(oop);
    }
    return false;
  }
}

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

import java.io.PrintStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import sun.jvm.hotspot.memory.SystemDictionary;
import sun.jvm.hotspot.oops.DefaultHeapVisitor;
import sun.jvm.hotspot.oops.Klass;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.OopUtilities;
import sun.jvm.hotspot.oops.Symbol;

public class ConcurrentLocksPrinter
{
  private Map locksMap = new HashMap();
  
  public ConcurrentLocksPrinter()
  {
    fillLocks();
  }
  
  public void print(JavaThread jthread, PrintStream tty)
  {
    List locks = (List)locksMap.get(jthread);
    tty.println("Locked ownable synchronizers:");
    Iterator itr;
    if ((locks == null) || (locks.isEmpty())) {
      tty.println("    - None");
    } else {
      for (itr = locks.iterator(); itr.hasNext();)
      {
        Oop oop = (Oop)itr.next();
        tty.println("    - <" + oop.getHandle() + ">, (a " + oop.getKlass().getName().asString() + ")");
      }
    }
  }
  
  private JavaThread getOwnerThread(Oop oop)
  {
    Oop threadOop = OopUtilities.abstractOwnableSynchronizerGetOwnerThread(oop);
    if (threadOop == null) {
      return null;
    }
    return OopUtilities.threadOopGetJavaThread(threadOop);
  }
  
  private void fillLocks()
  {
    VM vm = VM.getVM();
    SystemDictionary sysDict = vm.getSystemDictionary();
    Klass absOwnSyncKlass = sysDict.getAbstractOwnableSynchronizerKlass();
    ObjectHeap heap = vm.getObjectHeap();
    if (absOwnSyncKlass != null) {
      heap.iterateObjectsOfKlass(new DefaultHeapVisitor()
      {
        public boolean doObj(Oop oop)
        {
          JavaThread thread = ConcurrentLocksPrinter.this.getOwnerThread(oop);
          if (thread != null)
          {
            List locks = (List)locksMap.get(thread);
            if (locks == null)
            {
              locks = new LinkedList();
              locksMap.put(thread, locks);
            }
            locks.add(oop);
          }
          return false;
        }
      }, absOwnSyncKlass, true);
    }
  }
}

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

public class ConstructionException
  extends RuntimeException
{
  public ConstructionException() {}
  
  public ConstructionException(String message)
  {
    super(message);
  }
  
  public ConstructionException(Throwable e)
  {
    super(e);
  }
  
  public ConstructionException(String message, Throwable e)
  {
    super(message, e);
  }
}

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

import java.io.PrintStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Set;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.memory.SystemDictionary;
import sun.jvm.hotspot.oops.Klass;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.OopUtilities;
import sun.jvm.hotspot.oops.Symbol;

public class DeadlockDetector
{
  private static Threads threads;
  private static ObjectHeap heap;
  private static HashMap threadTable;
  
  public static void print(PrintStream tty)
  {
    print(tty, true);
  }
  
  public static void print(PrintStream tty, boolean concurrentLocks)
  {
    tty.println("Deadlock Detection:");
    tty.println();
    
    int globalDfn = 0;
    int numberOfDeadlocks = 0;
    JavaThread currentThread = null;JavaThread previousThread = null;
    ObjectMonitor waitingToLockMonitor = null;
    Oop waitingToLockBlocker = null;
    
    threads = VM.getVM().getThreads();
    heap = VM.getVM().getObjectHeap();
    createThreadTable();
    
    Iterator i = threadTable.entrySet().iterator();
    while (i.hasNext())
    {
      Map.Entry e = (Map.Entry)i.next();
      if (dfn(e) < 0)
      {
        int thisDfn = globalDfn;
        JavaThread thread = (JavaThread)e.getKey();
        previousThread = thread;
        try
        {
          waitingToLockMonitor = thread.getCurrentPendingMonitor();
        }
        catch (RuntimeException re)
        {
          tty.println("This version of HotSpot VM doesn't support deadlock detection.");
          return;
        }
        Klass abstractOwnableSyncKlass = null;
        if (concurrentLocks)
        {
          waitingToLockBlocker = thread.getCurrentParkBlocker();
          SystemDictionary sysDict = VM.getVM().getSystemDictionary();
          abstractOwnableSyncKlass = sysDict.getAbstractOwnableSynchronizerKlass();
        }
        while ((waitingToLockMonitor != null) || (waitingToLockBlocker != null))
        {
          if (waitingToLockMonitor != null)
          {
            currentThread = threads.owningThreadFromMonitor(waitingToLockMonitor);
          }
          else if ((concurrentLocks) && 
            (waitingToLockBlocker.isA(abstractOwnableSyncKlass)))
          {
            Oop threadOop = OopUtilities.abstractOwnableSynchronizerGetOwnerThread(waitingToLockBlocker);
            if (threadOop != null) {
              currentThread = OopUtilities.threadOopGetJavaThread(threadOop);
            }
          }
          if (currentThread == null) {
            break;
          }
          if (dfn(currentThread) < 0)
          {
            threadTable.put(currentThread, new Integer(globalDfn++));
          }
          else
          {
            if (dfn(currentThread) < thisDfn) {
              break;
            }
            if (currentThread == previousThread) {
              break;
            }
            numberOfDeadlocks++;
            printOneDeadlock(tty, currentThread, concurrentLocks);
            break;
          }
          previousThread = currentThread;
          waitingToLockMonitor = currentThread.getCurrentPendingMonitor();
          if (concurrentLocks) {
            waitingToLockBlocker = currentThread.getCurrentParkBlocker();
          }
        }
      }
    }
    switch (numberOfDeadlocks)
    {
    case 0: 
      tty.println("No deadlocks found.");
      break;
    case 1: 
      tty.println("Found a total of 1 deadlock.");
      break;
    default: 
      tty.println("Found a total of " + numberOfDeadlocks + " deadlocks.");
    }
    tty.println();
  }
  
  private static void createThreadTable()
  {
    threadTable = new HashMap();
    for (JavaThread cur = threads.first(); cur != null; cur = cur.next()) {
      threadTable.put(cur, new Integer(-1));
    }
  }
  
  private static int dfn(JavaThread thread)
  {
    Object obj = threadTable.get(thread);
    if (obj != null) {
      return ((Integer)obj).intValue();
    }
    return -1;
  }
  
  private static int dfn(Map.Entry e)
  {
    return ((Integer)e.getValue()).intValue();
  }
  
  private static void printOneDeadlock(PrintStream tty, JavaThread thread, boolean concurrentLocks)
  {
    tty.println("Found one Java-level deadlock:");
    tty.println("=============================");
    ObjectMonitor waitingToLockMonitor = null;
    Oop waitingToLockBlocker = null;
    JavaThread currentThread = thread;
    do
    {
      tty.println();
      tty.println("\"" + currentThread.getThreadName() + "\":");
      waitingToLockMonitor = currentThread.getCurrentPendingMonitor();
      if (waitingToLockMonitor != null)
      {
        tty.print("  waiting to lock Monitor@" + waitingToLockMonitor.getAddress());
        OopHandle obj = waitingToLockMonitor.object();
        Oop oop = heap.newOop(obj);
        if (obj != null)
        {
          tty.print(" (Object@");
          Oop.printOopAddressOn(oop, tty);
          tty.print(", a " + oop.getKlass().getName().asString() + ")");
          tty.print(",\n  which is held by");
        }
        else
        {
          tty.print(" (raw monitor),\n  which is held by");
        }
        currentThread = threads.owningThreadFromMonitor(waitingToLockMonitor);
        tty.print(" \"" + currentThread.getThreadName() + "\"");
      }
      else if (concurrentLocks)
      {
        waitingToLockBlocker = currentThread.getCurrentParkBlocker();
        tty.print(" waiting for ownable synchronizer ");
        Oop.printOopAddressOn(waitingToLockBlocker, tty);
        tty.print(", (a " + waitingToLockBlocker.getKlass().getName().asString() + ")");
        Oop threadOop = OopUtilities.abstractOwnableSynchronizerGetOwnerThread(waitingToLockBlocker);
        currentThread = OopUtilities.threadOopGetJavaThread(threadOop);
        tty.print(",\n which is held by");
        tty.print(" \"" + currentThread.getThreadName() + "\"");
      }
    } while (!currentThread.equals(thread));
    tty.println();
    tty.println();
  }
}

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

import java.io.PrintStream;

public class ExternalVFrame
  extends VFrame
{
  private boolean mayBeImprecise;
  
  ExternalVFrame(Frame fr, RegisterMap regMap, JavaThread thread, boolean mayBeImprecise)
  {
    super(fr, regMap, thread);
    
    this.mayBeImprecise = mayBeImprecise;
  }
  
  public void print()
  {
    printOn(System.out);
  }
  
  public void printOn(PrintStream tty)
  {
    getFrame().printValueOn(tty);
  }
  
  public void printValue()
  {
    printValueOn(System.out);
  }
  
  public void printValueOn(PrintStream tty)
  {
    super.printOn(tty);
  }
  
  public boolean mayBeImpreciseDbg()
  {
    return mayBeImprecise;
  }
}

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

import java.util.Observable;
import java.util.Observer;

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

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

import sun.jvm.hotspot.compiler.OopMapVisitor;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.utilities.Assert;

class Frame$InterpVisitor
  implements OopMapVisitor
{
  private AddressVisitor addressVisitor;
  
  public Frame$InterpVisitor(AddressVisitor oopVisitor)
  {
    setAddressVisitor(oopVisitor);
  }
  
  public void setAddressVisitor(AddressVisitor addressVisitor)
  {
    this.addressVisitor = addressVisitor;
  }
  
  public void visitOopLocation(Address oopAddr)
  {
    addressVisitor.visitAddress(oopAddr);
  }
  
  public void visitDerivedOopLocation(Address baseOopAddr, Address derivedOopAddr)
  {
    if (VM.getVM().isClientCompiler()) {
      Assert.that(false, "should not reach here");
    } else if ((VM.getVM().isServerCompiler()) && (VM.getVM().useDerivedPointerTable())) {
      Assert.that(false, "FIXME: add derived pointer table");
    }
  }
  
  public void visitValueLocation(Address valueAddr) {}
  
  public void visitNarrowOopLocation(Address compOopAddr)
  {
    addressVisitor.visitCompOopAddress(compOopAddr);
  }
}

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

import java.io.PrintStream;
import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.code.CodeBlob;
import sun.jvm.hotspot.code.CodeCache;
import sun.jvm.hotspot.code.VMRegImpl;
import sun.jvm.hotspot.compiler.OopMapSet;
import sun.jvm.hotspot.compiler.OopMapVisitor;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.interpreter.BytecodeInvoke;
import sun.jvm.hotspot.interpreter.Interpreter;
import sun.jvm.hotspot.interpreter.OopMapCacheEntry;
import sun.jvm.hotspot.oops.ConstMethod;
import sun.jvm.hotspot.oops.ConstantPoolCache;
import sun.jvm.hotspot.oops.Method;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.oops.Symbol;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.utilities.Assert;

public abstract class Frame
  implements Cloneable
{
  protected Address raw_sp;
  protected Address pc;
  protected boolean deoptimized;
  private static long constMethodOopDescSize;
  
  public Frame()
  {
    deoptimized = false;
  }
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        Frame.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type constMethodOopType = db.lookupType("constMethodOopDesc");
    
    constMethodOopDescSize = constMethodOopType.getSize();
  }
  
  protected int bcpToBci(Address bcp, ConstMethod cm)
  {
    if (bcp == null) {
      return 0;
    }
    long bci = bcp.minus(null);
    if ((bci >= 0L) && (bci < cm.getCodeSize())) {
      return (int)bci;
    }
    return (int)(bcp.minus(cm.getHandle()) - constMethodOopDescSize);
  }
  
  protected int bcpToBci(Address bcp, Method m)
  {
    return bcpToBci(bcp, m.getConstMethod());
  }
  
  public Address getPC()
  {
    return pc;
  }
  
  public void setPC(Address newpc)
  {
    pc = newpc;
  }
  
  public boolean isDeoptimized()
  {
    return deoptimized;
  }
  
  public boolean isInterpretedFrame()
  {
    return VM.getVM().getInterpreter().contains(getPC());
  }
  
  public boolean isJavaFrame()
  {
    if (isInterpretedFrame()) {
      return true;
    }
    if ((!VM.getVM().isCore()) && 
      (isCompiledFrame())) {
      return true;
    }
    return false;
  }
  
  public boolean isEntryFrame()
  {
    return VM.getVM().getStubRoutines().returnsToCallStub(getPC());
  }
  
  public boolean isNativeFrame()
  {
    if (!VM.getVM().isCore())
    {
      CodeBlob cb = VM.getVM().getCodeCache().findBlob(getPC());
      return (cb != null) && (cb.isNativeMethod());
    }
    return false;
  }
  
  public boolean isCompiledFrame()
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(!VM.getVM().isCore(), "noncore builds only");
    }
    CodeBlob cb = VM.getVM().getCodeCache().findBlob(getPC());
    return (cb != null) && (cb.isJavaMethod());
  }
  
  public boolean isGlueFrame()
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(!VM.getVM().isCore(), "noncore builds only");
    }
    CodeBlob cb = VM.getVM().getCodeCache().findBlob(getPC());
    if (cb == null) {
      return false;
    }
    if (cb.isRuntimeStub()) {
      return true;
    }
    return false;
  }
  
  public boolean isFirstFrame()
  {
    return ((isEntryFrame()) && (entryFrameIsFirst())) || ((!isJavaFrame()) && (!hasSenderPD()));
  }
  
  public boolean isFirstJavaFrame()
  {
    throw new RuntimeException("not yet implemented");
  }
  
  public boolean shouldBeDeoptimized()
  {
    throw new RuntimeException("not yet implemented");
  }
  
  public boolean canBeDeoptimized()
  {
    throw new RuntimeException("not yet implemented");
  }
  
  public Frame sender(RegisterMap map)
  {
    return sender(map, null);
  }
  
  public Frame realSender(RegisterMap map)
  {
    if (!VM.getVM().isCore())
    {
      Frame result = sender(map);
      while (result.isGlueFrame()) {
        result = result.sender(map);
      }
      return result;
    }
    return sender(map);
  }
  
  public Address addressOfStackSlot(int slot)
  {
    return getFP().addOffsetTo(slot * VM.getVM().getAddressSize());
  }
  
  public OopHandle getOopHandleAt(int slot)
  {
    return addressOfStackSlot(slot).getOopHandleAt(0L);
  }
  
  public int getIntAt(int slot)
  {
    return addressOfStackSlot(slot).getJIntAt(0L);
  }
  
  public Address addressOfInterpreterFrameLocal(int slot)
  {
    return addressOfInterpreterFrameLocals().getAddressAt(0L).addOffsetTo(-slot * VM.getVM().getAddressSize());
  }
  
  public Address addressOfInterpreterFrameExpressionStackSlot(int slot)
  {
    return addressOfInterpreterFrameExpressionStack().addOffsetTo(-slot * VM.getVM().getAddressSize());
  }
  
  public int getInterpreterFrameExpressionStackSize()
  {
    return (int)(1L + getInterpreterFrameExpressionStackDirection() * addressOfInterpreterFrameTOS().minus(addressOfInterpreterFrameExpressionStack()));
  }
  
  public BasicObjectLock nextMonitorInInterpreterFrame(BasicObjectLock cur)
  {
    return new BasicObjectLock(cur.address().addOffsetTo(interpreterFrameMonitorSize()));
  }
  
  public BasicObjectLock previousMonitorInInterpreterFrame(BasicObjectLock cur)
  {
    return new BasicObjectLock(cur.address().addOffsetTo(-1 * interpreterFrameMonitorSize()));
  }
  
  public Method getInterpreterFrameMethod()
  {
    return (Method)VM.getVM().getObjectHeap().newOop(addressOfInterpreterFrameMethod().getOopHandleAt(0L));
  }
  
  public ConstantPoolCache getInterpreterFrameCPCache()
  {
    return (ConstantPoolCache)VM.getVM().getObjectHeap().newOop(addressOfInterpreterFrameCPCache().getOopHandleAt(0L));
  }
  
  public boolean entryFrameIsFirst()
  {
    return getEntryFrameCallWrapper().getLastJavaSP() == null;
  }
  
  public OopHandle getSavedOopResult()
  {
    return addressOfSavedOopResult().getOopHandleAt(0L);
  }
  
  public OopHandle getSavedReceiver()
  {
    return addressOfSavedReceiver().getOopHandleAt(0L);
  }
  
  public void oopsInterpretedArgumentsDo(Symbol signature, boolean isStatic, AddressVisitor f)
  {
    ArgumentOopFinder finder = new ArgumentOopFinder(signature, isStatic, this, f);
    finder.oopsDo();
  }
  
  public Address oopMapRegToLocation(VMReg reg, RegisterMap regMap)
  {
    VM.getVM().getVMRegImplInfo();VMReg stack0 = VMRegImpl.getStack0();
    if (reg.lessThan(stack0)) {
      return regMap.getLocation(reg);
    }
    long spOffset = VM.getVM().getAddressSize() * reg.minus(stack0);
    return getUnextendedSP().addOffsetTo(spOffset);
  }
  
  public void oopsDo(AddressVisitor oopVisitor, RegisterMap map)
  {
    if (isInterpretedFrame()) {
      oopsInterpretedDo(oopVisitor, map);
    } else if (isEntryFrame()) {
      oopsEntryDo(oopVisitor, map);
    } else if (VM.getVM().getCodeCache().contains(getPC())) {
      oopsCodeBlobDo(oopVisitor, map);
    } else {
      Assert.that(false, "should not reach here");
    }
  }
  
  public void printValue()
  {
    printValueOn(System.out);
  }
  
  public void print()
  {
    printOn(System.out);
  }
  
  private static class InterpVisitor
    implements OopMapVisitor
  {
    private AddressVisitor addressVisitor;
    
    public InterpVisitor(AddressVisitor oopVisitor)
    {
      setAddressVisitor(oopVisitor);
    }
    
    public void setAddressVisitor(AddressVisitor addressVisitor)
    {
      this.addressVisitor = addressVisitor;
    }
    
    public void visitOopLocation(Address oopAddr)
    {
      addressVisitor.visitAddress(oopAddr);
    }
    
    public void visitDerivedOopLocation(Address baseOopAddr, Address derivedOopAddr)
    {
      if (VM.getVM().isClientCompiler()) {
        Assert.that(false, "should not reach here");
      } else if ((VM.getVM().isServerCompiler()) && (VM.getVM().useDerivedPointerTable())) {
        Assert.that(false, "FIXME: add derived pointer table");
      }
    }
    
    public void visitValueLocation(Address valueAddr) {}
    
    public void visitNarrowOopLocation(Address compOopAddr)
    {
      addressVisitor.visitCompOopAddress(compOopAddr);
    }
  }
  
  private void oopsInterpretedDo(AddressVisitor oopVisitor, RegisterMap map)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(map != null, "map must be set");
    }
    Method m = getInterpreterFrameMethod();
    int bci = getInterpreterFrameBCI();
    if ((VM.getVM().isDebugging()) && (
      (bci < 0) || (bci >= m.getCodeSize()))) {
      return;
    }
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(((m.isNative()) && (bci == 0)) || ((bci >= 0) && (bci < m.getCodeSize())), "invalid bci value");
    }
    oopVisitor.visitAddress(addressOfInterpreterFrameMethod());
    oopVisitor.visitAddress(addressOfInterpreterFrameCPCache());
    
    int maxLocals = (int)(m.isNative() ? m.getSizeOfParameters() : m.getMaxLocals());
    InterpreterFrameClosure blk = new InterpreterFrameClosure(this, maxLocals, (int)m.getMaxStack(), oopVisitor);
    
    OopMapCacheEntry mask = m.getMaskFor(bci);
    mask.iterateOop(blk);
    if ((map.getIncludeArgumentOops()) && (!m.isNative()))
    {
      BytecodeInvoke call = BytecodeInvoke.atCheck(m, bci);
      if ((call != null) && (getInterpreterFrameExpressionStackSize() > 0)) {
        oopsInterpretedArgumentsDo(call.signature(), call.isInvokestatic(), oopVisitor);
      }
    }
  }
  
  private void oopsCodeBlobDo(AddressVisitor oopVisitor, RegisterMap regMap)
  {
    CodeBlob cb = VM.getVM().getCodeCache().findBlob(getPC());
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(cb != null, "sanity check");
    }
    if (cb.getOopMaps() != null) {
      OopMapSet.oopsDo(this, cb, regMap, oopVisitor, VM.getVM().isDebugging());
    }
  }
  
  public abstract Object clone();
  
  public abstract Address getSP();
  
  public abstract Address getID();
  
  public abstract Address getFP();
  
  public abstract boolean equals(Object paramObject);
  
  public abstract boolean isSignalHandlerFrameDbg();
  
  public abstract int getSignalNumberDbg();
  
  public abstract String getSignalNameDbg();
  
  public abstract boolean isInterpretedFrameValid();
  
  public abstract Frame sender(RegisterMap paramRegisterMap, CodeBlob paramCodeBlob);
  
  protected abstract boolean hasSenderPD();
  
  public abstract long frameSize();
  
  public abstract Address getLink();
  
  public abstract Address getSenderPC();
  
  public abstract Address getUnextendedSP();
  
  public abstract Address getSenderSP();
  
  public abstract Address addressOfInterpreterFrameLocals();
  
  public abstract int getInterpreterFrameBCI();
  
  public abstract Address addressOfInterpreterFrameExpressionStack();
  
  public abstract int getInterpreterFrameExpressionStackDirection();
  
  public abstract Address addressOfInterpreterFrameTOS();
  
  public abstract Address addressOfInterpreterFrameTOSAt(int paramInt);
  
  public abstract Address getInterpreterFrameSenderSP();
  
  public abstract BasicObjectLock interpreterFrameMonitorBegin();
  
  public abstract BasicObjectLock interpreterFrameMonitorEnd();
  
  public abstract int interpreterFrameMonitorSize();
  
  public abstract Address addressOfInterpreterFrameMethod();
  
  public abstract Address addressOfInterpreterFrameCPCache();
  
  public abstract JavaCallWrapper getEntryFrameCallWrapper();
  
  protected abstract Address addressOfSavedOopResult();
  
  protected abstract Address addressOfSavedReceiver();
  
  public void printValueOn(PrintStream tty) {}
  
  public void printOn(PrintStream tty) {}
  
  public void interpreterFramePrintOn(PrintStream tty) {}
  
  private void oopsEntryDo(AddressVisitor oopVisitor, RegisterMap regMap) {}
}

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

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

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

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

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

public class cInterpreter
  extends VMObject
{
  private static final boolean DEBUG = true;
  private static AddressField bcpField;
  private static AddressField localsField;
  private static AddressField constantsField;
  private static AddressField methodField;
  private static AddressField stackField;
  private static AddressField stackBaseField;
  private static AddressField stackLimitField;
  private static AddressField monitorBaseField;
  private static CIntegerField messageField;
  private static AddressField prevFieldField;
  private static AddressField wrapperField;
  private static AddressField prevField;
  private static int NO_REQUEST;
  private static int INITIALIZE;
  private static int METHOD_ENTRY;
  private static int METHOD_RESUME;
  private static int GOT_MONITORS;
  private static int RETHROW_EXCEPTION;
  private static int CALL_METHOD;
  private static int RETURN_FROM_METHOD;
  private static int RETRY_METHOD;
  private static int MORE_MONITORS;
  private static int THROWING_EXCEPTION;
  private static int POPPING_FRAME;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        cInterpreter.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type cInterpreterType = db.lookupType("cInterpreter");
    bcpField = cInterpreterType.getAddressField("_bcp");
    localsField = cInterpreterType.getAddressField("_locals");
    constantsField = cInterpreterType.getAddressField("_constants");
    methodField = cInterpreterType.getAddressField("_method");
    stackField = cInterpreterType.getAddressField("_stack");
    stackBaseField = cInterpreterType.getAddressField("_stack_base");
    stackLimitField = cInterpreterType.getAddressField("_stack_limit");
    monitorBaseField = cInterpreterType.getAddressField("_monitor_base");
    
    messageField = null;
    wrapperField = cInterpreterType.getAddressField("_wrapper");
    prevField = cInterpreterType.getAddressField("_prev_link");
  }
  
  public cInterpreter(Address addr)
  {
    super(addr);
  }
  
  public Address prev()
  {
    return prevField.getValue(addr);
  }
  
  public Address locals()
  {
    Address val = localsField.getValue(addr);
    return val;
  }
  
  public Address localsAddr()
  {
    Address localsAddr = localsField.getValue(addr);
    return localsAddr;
  }
  
  public Address bcp()
  {
    Address val = bcpField.getValue(addr);
    return val;
  }
  
  public Address bcpAddr()
  {
    Address bcpAddr = addr.addOffsetTo(bcpField.getOffset());
    return bcpAddr;
  }
  
  public Address constants()
  {
    Address val = constantsField.getValue(addr);
    return val;
  }
  
  public Address constantsAddr()
  {
    Address constantsAddr = constantsField.getValue(addr);
    return constantsAddr;
  }
  
  public Address method()
  {
    Address val = methodField.getValue(addr);
    return val;
  }
  
  public Address methodAddr()
  {
    Address methodAddr = addr.addOffsetTo(methodField.getOffset());
    return methodAddr;
  }
  
  public Address stack()
  {
    Address val = stackField.getValue(addr);
    return val;
  }
  
  public Address stackBase()
  {
    Address val = stackBaseField.getValue(addr);
    return val;
  }
  
  public Address stackLimit()
  {
    Address val = stackLimitField.getValue(addr);
    return val;
  }
  
  public Address monitorBase()
  {
    Address val = monitorBaseField.getValue(addr);
    return val;
  }
  
  public Address wrapper()
  {
    return wrapperField.getValue(addr);
  }
  
  public int message()
  {
    int val = (int)messageField.getValue(addr);
    return val;
  }
}

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.ia64.IA64ThreadContext;
import sun.jvm.hotspot.runtime.JavaThread;

public class IA64CurrentFrameGuess
{
  private IA64ThreadContext context;
  private JavaThread thread;
  private Address spFound;
  private Address fpFound;
  private Address pcFound;
  private static final boolean DEBUG = false;
  
  public IA64CurrentFrameGuess(IA64ThreadContext context, JavaThread thread)
  {
    this.context = context;
    this.thread = thread;
  }
  
  public boolean run(long regionInBytesToSearch)
  {
    return false;
  }
  
  public Address getSP()
  {
    return null;
  }
  
  public Address getFP()
  {
    return null;
  }
  
  public Address getPC()
  {
    return null;
  }
  
  private void setValues(Address sp, Address fp, Address pc)
  {
    spFound = sp;
    fpFound = fp;
    pcFound = pc;
  }
}

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

import sun.jvm.hotspot.code.CodeBlob;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.oops.Method;
import sun.jvm.hotspot.oops.ObjectHeap;
import sun.jvm.hotspot.runtime.BasicObjectLock;
import sun.jvm.hotspot.runtime.Frame;
import sun.jvm.hotspot.runtime.JavaCallWrapper;
import sun.jvm.hotspot.runtime.RegisterMap;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.utilities.AddressOps;
import sun.jvm.hotspot.utilities.Assert;

public class IA64Frame
  extends Frame
{
  private static final boolean DEBUG = false;
  Address iframe;
  
  private IA64Frame() {}
  
  public IA64Frame(Address raw_sp, Address iframe, Address pc)
  {
    this.raw_sp = raw_sp;
    this.iframe = iframe;
    this.pc = pc;
  }
  
  public Object clone()
  {
    IA64Frame frame = new IA64Frame();
    raw_sp = raw_sp;
    iframe = iframe;
    pc = pc;
    return frame;
  }
  
  public boolean equals(Object arg)
  {
    if (arg == null) {
      return false;
    }
    if (!(arg instanceof IA64Frame)) {
      return false;
    }
    IA64Frame other = (IA64Frame)arg;
    
    return (AddressOps.equal(getSP(), other.getSP())) && (AddressOps.equal(getIFRAME(), other.getIFRAME())) && (AddressOps.equal(getPC(), other.getPC()));
  }
  
  public int hashCode()
  {
    if (iframe == null) {
      return 0;
    }
    return iframe.hashCode();
  }
  
  public String toString()
  {
    return "sp: " + (getSP() == null ? "null" : getSP().toString()) + ", iframe: " + (getIFRAME() == null ? "null" : getIFRAME().toString()) + ", pc: " + (pc == null ? "null" : pc.toString());
  }
  
  public Address getFP()
  {
    return null;
  }
  
  public Address getIFRAME()
  {
    return iframe;
  }
  
  public Address getSP()
  {
    return raw_sp;
  }
  
  public Address getID()
  {
    return getFP();
  }
  
  public boolean isSignalHandlerFrameDbg()
  {
    return false;
  }
  
  public int getSignalNumberDbg()
  {
    return 0;
  }
  
  public String getSignalNameDbg()
  {
    return null;
  }
  
  public boolean isInterpretedFrameValid()
  {
    return true;
  }
  
  public boolean isInterpretedFrame()
  {
    return iframe != null;
  }
  
  public Frame sender(RegisterMap regMap, CodeBlob cb)
  {
    if (iframe == null) {
      return null;
    }
    cInterpreter fr = new cInterpreter(iframe);
    if (fr.prev() == null)
    {
      Address wrapper = fr.wrapper();
      if (wrapper == null) {
        return null;
      }
      IA64JavaCallWrapper jcw = new IA64JavaCallWrapper(wrapper);
      Address iprev = jcw.getPrevIFrame();
      if (iprev == null) {
        return null;
      }
      return new IA64Frame(null, iprev, null);
    }
    return new IA64Frame(null, fr.prev(), null);
  }
  
  private Frame senderForEntryFrame(IA64RegisterMap map)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(map != null, "map must be set");
    }
    throw new RuntimeException("senderForEntryFrame NYI");
  }
  
  private Frame senderForInterpreterFrame(IA64RegisterMap map)
  {
    throw new RuntimeException("senderForInterpreterFrame NYI");
  }
  
  private Frame senderForDeoptimizedFrame(IA64RegisterMap map, CodeBlob cb)
  {
    throw new RuntimeException("Deoptimized frames not handled yet");
  }
  
  private Frame senderForCompiledFrame(IA64RegisterMap map, CodeBlob cb)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(map != null, "map must be set");
    }
    throw new RuntimeException("senderForCompiledFrame NYI");
  }
  
  protected boolean hasSenderPD()
  {
    return true;
  }
  
  public long frameSize()
  {
    throw new RuntimeException("frameSize NYI");
  }
  
  public Address getLink()
  {
    throw new RuntimeException("getLink NYI");
  }
  
  public Address getUnextendedSP()
  {
    return getSP();
  }
  
  public Address getSenderPC()
  {
    return null;
  }
  
  public Address getSenderSP()
  {
    return null;
  }
  
  public Address addressOfInterpreterFrameLocals()
  {
    if (iframe == null) {
      throw new RuntimeException("Not an Interpreter frame");
    }
    cInterpreter fr = new cInterpreter(iframe);
    return fr.locals();
  }
  
  private Address addressOfInterpreterFrameBCX()
  {
    if (iframe == null) {
      throw new RuntimeException("Not an Interpreter frame");
    }
    cInterpreter fr = new cInterpreter(iframe);
    return fr.bcpAddr();
  }
  
  public int getInterpreterFrameBCI()
  {
    Address bcp = addressOfInterpreterFrameBCX().getAddressAt(0L);
    OopHandle methodHandle = addressOfInterpreterFrameMethod().getOopHandleAt(0L);
    Method method = (Method)VM.getVM().getObjectHeap().newOop(methodHandle);
    return bcpToBci(bcp, method);
  }
  
  public Address addressOfInterpreterFrameMDX()
  {
    return null;
  }
  
  public Address addressOfInterpreterFrameExpressionStack()
  {
    if (iframe == null) {
      throw new RuntimeException("Not an Interpreter frame");
    }
    cInterpreter fr = new cInterpreter(iframe);
    return fr.stackBase();
  }
  
  public int getInterpreterFrameExpressionStackDirection()
  {
    return -1;
  }
  
  public Address addressOfInterpreterFrameTOS()
  {
    if (iframe == null) {
      throw new RuntimeException("Not an Interpreter frame");
    }
    cInterpreter fr = new cInterpreter(iframe);
    
    return fr.stackBase().addOffsetTo(VM.getVM().getAddressSize());
  }
  
  public Address addressOfInterpreterFrameTOSAt(int slot)
  {
    return addressOfInterpreterFrameTOS().addOffsetTo(slot * VM.getVM().getAddressSize());
  }
  
  public Address getInterpreterFrameSenderSP()
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(isInterpretedFrame(), "interpreted frame expected");
    }
    throw new RuntimeException("getInterpreterFrameSenderSP NYI");
  }
  
  public BasicObjectLock interpreterFrameMonitorBegin()
  {
    if (iframe == null) {
      throw new RuntimeException("Not an Interpreter frame");
    }
    cInterpreter fr = new cInterpreter(iframe);
    return new BasicObjectLock(fr.monitorBase());
  }
  
  public BasicObjectLock interpreterFrameMonitorEnd()
  {
    if (iframe == null) {
      throw new RuntimeException("Not an Interpreter frame");
    }
    cInterpreter fr = new cInterpreter(iframe);
    
    Address result = fr.stackBase().addOffsetTo(2L * VM.getVM().getAddressSize());
    
    return new BasicObjectLock(result);
  }
  
  public int interpreterFrameMonitorSize()
  {
    return BasicObjectLock.size();
  }
  
  public Address addressOfInterpreterFrameMethod()
  {
    if (iframe == null) {
      throw new RuntimeException("Not an Interpreter frame");
    }
    cInterpreter fr = new cInterpreter(iframe);
    return fr.methodAddr();
  }
  
  public Address addressOfInterpreterFrameCPCache()
  {
    if (iframe == null) {
      throw new RuntimeException("Not an Interpreter frame");
    }
    cInterpreter fr = new cInterpreter(iframe);
    return fr.constantsAddr();
  }
  
  public JavaCallWrapper getEntryFrameCallWrapper()
  {
    throw new RuntimeException("getEntryFrameCallWrapper NYI");
  }
  
  protected Address addressOfSavedOopResult()
  {
    throw new RuntimeException("public boolean isInterpretedFrame() NYI");
  }
  
  protected Address addressOfSavedReceiver()
  {
    throw new RuntimeException("getEntryFrameCallWrapper NYI");
  }
  
  private void dumpStack() {}
}

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

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

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

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

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.JavaCallWrapper;
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 IA64JavaCallWrapper
  extends JavaCallWrapper
{
  private static AddressField lastJavaIFrameField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        IA64JavaCallWrapper.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static synchronized void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("JavaCallWrapper");
    
    lastJavaIFrameField = type.getAddressField("_last_Java_iframe");
  }
  
  public IA64JavaCallWrapper(Address addr)
  {
    super(addr);
  }
  
  public Address ge
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