sa-jdi

 boolean x2)
  {
    super(paramCommandProcessor, x0, x1, x2);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    int tokens = t.countTokens();
    if ((tokens != 0) && (tokens != 1))
    {
      usage();
    }
    else
    {
      String name = tokens > 0 ? t.nextToken() : null;
      
      VM.Flag[] flags = VM.getVM().getCommandLineFlags();
      if (flags == null)
      {
        CommandProcessor.access$000(this$0).println("Command Flag info not available (use 1.4.1_03 or later)!");
      }
      else
      {
        boolean printed = false;
        for (int f = 0; f < flags.length; f++)
        {
          VM.Flag flag = flags[f];
          if ((name == null) || (flag.getName().equals(name)))
          {
            CommandProcessor.access$000(this$0).println(flag.getName() + " = " + flag.getValue());
            printed = true;
          }
        }
        if ((name != null) && (!printed)) {
          CommandProcessor.access$000(this$0).println("Couldn't find flag: " + name);
        }
      }
    }
  }
}

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

import java.util.Comparator;

final class CommandProcessor$7$1
  implements Comparator
{
  private final CommandProcessor.7 this$1;
  
  CommandProcessor$7$1(CommandProcessor.7 param7) {}
  
  public int compare(Object o1, Object o2)
  {
    return o1.toString().compareTo(o2.toString());
  }
}

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

import java.io.PrintStream;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Set;

final class CommandProcessor$7
  extends CommandProcessor.Command
{
  private final CommandProcessor this$0;
  
  CommandProcessor$7(CommandProcessor paramCommandProcessor, String x0, String x1, boolean x2)
  {
    super(paramCommandProcessor, x0, x1, x2);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    int tokens = t.countTokens();
    CommandProcessor.Command cmd = null;
    if (tokens == 1) {
      cmd = CommandProcessor.access$500(this$0, t.nextToken());
    }
    if (cmd != null)
    {
      cmd.usage();
    }
    else if (tokens == 0)
    {
      CommandProcessor.access$000(this$0).println("Available commands:");
      Object[] keys = CommandProcessor.access$600(this$0).keySet().toArray();
      Arrays.sort(keys, new Comparator()
      {
        public int compare(Object o1, Object o2)
        {
          return o1.toString().compareTo(o2.toString());
        }
      });
      for (int i = 0; i < keys.length; i++)
      {
        CommandProcessor.access$000(this$0).print("  ");
        CommandProcessor.access$000(this$0).println(access$600this$0).get(keys[i])).usage);
      }
    }
  }
}

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

import java.io.PrintStream;
import java.util.ArrayList;

final class CommandProcessor$8
  extends CommandProcessor.Command
{
  private final CommandProcessor this$0;
  
  CommandProcessor$8(CommandProcessor paramCommandProcessor, String x0, String x1, boolean x2)
  {
    super(paramCommandProcessor, x0, x1, x2);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    int tokens = t.countTokens();
    if ((tokens != 0) && ((tokens != 1) || (!t.nextToken().equals("-h"))))
    {
      usage();
      return;
    }
    boolean printIndex = tokens == 0;
    for (int i = 0; i < CommandProcessor.access$700(this$0).size(); i++)
    {
      if (printIndex) {
        CommandProcessor.access$000(this$0).print(i + " ");
      }
      CommandProcessor.access$000(this$0).println(CommandProcessor.access$700(this$0).get(i));
    }
  }
}

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

import sun.jvm.hotspot.utilities.HeapProgressThunk;

final class CommandProcessor$9$1
  implements HeapProgressThunk
{
  private final CommandProcessor.9 this$1;
  
  CommandProcessor$9$1(CommandProcessor.9 param9, boolean[] paramArrayOfBoolean) {}
  
  public void heapIterationFractionUpdate(double d) {}
  
  public synchronized void heapIterationComplete()
  {
    val$complete[0] = true;
    notify();
  }
}

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

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
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.utilities.HeapProgressThunk;
import sun.jvm.hotspot.utilities.LivenessPathElement;
import sun.jvm.hotspot.utilities.ReversePtrs;
import sun.jvm.hotspot.utilities.ReversePtrsAnalysis;

final class CommandProcessor$9
  extends CommandProcessor.Command
{
  private final CommandProcessor this$0;
  
  CommandProcessor$9(CommandProcessor paramCommandProcessor, String x0, String x1, boolean x2)
  {
    super(paramCommandProcessor, x0, x1, x2);
  }
  
  public void doit(CommandProcessor.Tokens t)
  {
    int tokens = t.countTokens();
    if ((tokens != 1) && ((tokens != 2) || (!t.nextToken().equals("-c"))))
    {
      usage();
      return;
    }
    boolean chase = tokens == 2;
    ReversePtrs revptrs = VM.getVM().getRevPtrs();
    if (revptrs == null)
    {
      CommandProcessor.access$000(this$0).println("Computing reverse pointers...");
      ReversePtrsAnalysis analysis = new ReversePtrsAnalysis();
      final boolean[] complete = new boolean[1];
      HeapProgressThunk thunk = new HeapProgressThunk()
      {
        public void heapIterationFractionUpdate(double d) {}
        
        public synchronized void heapIterationComplete()
        {
          complete[0] = true;
          notify();
        }
      };
      analysis.setHeapProgressThunk(thunk);
      analysis.run();
      while (complete[0] == 0) {
        synchronized (thunk)
        {
          try
          {
            thunk.wait();
          }
          catch (Exception e) {}
        }
      }
      revptrs = VM.getVM().getRevPtrs();
      CommandProcessor.access$000(this$0).println("Done.");
    }
    Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
    if (VM.getVM().getUniverse().heap().isInReserved(a))
    {
      OopHandle handle = a.addOffsetToAsOopHandle(0L);
      Oop oop = VM.getVM().getObjectHeap().newOop(handle);
      ArrayList ptrs = revptrs.get(oop);
      if (ptrs == null)
      {
        CommandProcessor.access$000(this$0).println("no live references to " + a);
      }
      else
      {
        if (chase) {
          while (ptrs.size() == 1)
          {
            LivenessPathElement e = (LivenessPathElement)ptrs.get(0);
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            Oop.printOopValueOn(e.getObj(), new PrintStream(bos));
            CommandProcessor.access$000(this$0).println(bos.toString());
            ptrs = revptrs.get(e.getObj());
          }
        }
        for (int i = 0; i < ptrs.size(); i++)
        {
          LivenessPathElement e = (LivenessPathElement)ptrs.get(i);
          ByteArrayOutputStream bos = new ByteArrayOutputStream();
          Oop.printOopValueOn(e.getObj(), new PrintStream(bos));
          CommandProcessor.access$000(this$0).println(bos.toString());
          oop = e.getObj();
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     sun.jvm.hotspot.CommandProcessor.9
 * 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.oops.Klass;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.Symbol;
import sun.jvm.hotspot.ui.tree.OopTreeNodeAdapter;
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;

abstract class CommandProcessor$Command
{
  final String name;
  final String usage;
  final boolean okIfDisconnected;
  private final CommandProcessor this$0;
  
  CommandProcessor$Command(CommandProcessor paramCommandProcessor, String n, String u, boolean ok)
  {
    name = n;
    usage = u;
    okIfDisconnected = ok;
  }
  
  CommandProcessor$Command(CommandProcessor paramCommandProcessor, String n, boolean ok)
  {
    name = n;
    usage = n;
    okIfDisconnected = ok;
  }
  
  abstract void doit(CommandProcessor.Tokens paramTokens);
  
  void usage()
  {
    CommandProcessor.access$000(this$0).println("Usage: " + usage);
  }
  
  void printOopValue(Oop oop)
  {
    if (oop != null)
    {
      Klass k = oop.getKlass();
      Symbol s = k.getName();
      if (s != null) {
        CommandProcessor.access$000(this$0).print("Oop for " + s.asString() + " @ ");
      } else {
        CommandProcessor.access$000(this$0).print("Oop @ ");
      }
      Oop.printOopAddressOn(oop, CommandProcessor.access$000(this$0));
    }
    else
    {
      CommandProcessor.access$000(this$0).print("null");
    }
  }
  
  void printNode(SimpleTreeNode node)
  {
    int count = node.getChildCount();
    for (int i = 0; i < count; i++) {
      try
      {
        SimpleTreeNode field = node.getChild(i);
        if ((field instanceof OopTreeNodeAdapter))
        {
          CommandProcessor.access$000(this$0).print(field);
          CommandProcessor.access$000(this$0).print(" ");
          printOopValue(((OopTreeNodeAdapter)field).getOop());
          CommandProcessor.access$000(this$0).println();
        }
        else
        {
          CommandProcessor.access$000(this$0).println(field);
        }
      }
      catch (Exception e)
      {
        CommandProcessor.access$000(this$0).println();
        CommandProcessor.access$000(this$0).println("Error: " + e);
        if (CommandProcessor.access$100(this$0)) {
          e.printStackTrace(CommandProcessor.access$000(this$0));
        }
      }
    }
  }
}

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

public abstract class CommandProcessor$DebuggerInterface
{
  public abstract HotSpotAgent getAgent();
  
  public abstract boolean isAttached();
  
  public abstract void attach(String paramString);
  
  public abstract void attach(String paramString1, String paramString2);
  
  public abstract void detach();
  
  public abstract void reattach();
}

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

import java.util.ArrayList;

class CommandProcessor$Tokens
{
  final String input;
  int i;
  String[] tokens;
  int length;
  
  String[] splitWhitespace(String cmd)
  {
    String[] t = cmd.split("\\s");
    if ((t.length == 1) && (t[0].length() == 0)) {
      return new String[0];
    }
    return t;
  }
  
  void add(String s, ArrayList t)
  {
    if (s.length() > 0) {
      t.add(s);
    }
  }
  
  CommandProcessor$Tokens(String cmd)
  {
    input = cmd;
    
    int quote = cmd.indexOf('"');
    ArrayList t = new ArrayList();
    if (quote != -1) {
      while (cmd.length() > 0) {
        if (quote != -1)
        {
          int endquote = cmd.indexOf('"', quote + 1);
          if (endquote == -1) {
            throw new RuntimeException("mismatched quotes: " + input);
          }
          String before = cmd.substring(0, quote).trim();
          String quoted = cmd.substring(quote + 1, endquote);
          cmd = cmd.substring(endquote + 1).trim();
          if (before.length() > 0)
          {
            String[] w = splitWhitespace(before);
            for (int i = 0; i < w.length; i++) {
              add(w[i], t);
            }
          }
          add(quoted, t);
          quote = cmd.indexOf('"');
        }
        else
        {
          String[] w = splitWhitespace(cmd);
          for (int i = 0; i < w.length; i++) {
            add(w[i], t);
          }
          cmd = "";
        }
      }
    }
    String[] w = splitWhitespace(cmd);
    for (int i = 0; i < w.length; i++) {
      add(w[i], t);
    }
    tokens = ((String[])t.toArray(new String[0]));
    this.i = 0;
    length = tokens.length;
  }
  
  String nextToken()
  {
    return tokens[(i++)];
  }
  
  boolean hasMoreTokens()
  {
    return i < length;
  }
  
  int countTokens()
  {
    return length - i;
  }
  
  void trim(int n)
  {
    if (length >= n) {
      length -= n;
    } else {
      throw new IndexOutOfBoundsException(String.valueOf(n));
    }
  }
  
  String join(String sep)
  {
    StringBuffer result = new StringBuffer();
    for (int w = i; w < length; w++)
    {
      result.append(tokens[w]);
      if (w + 1 < length) {
        result.append(sep);
      }
    }
    return result.toString();
  }
  
  String at(int i)
  {
    if ((i < 0) || (i >= length)) {
      throw new IndexOutOfBoundsException(String.valueOf(i));
    }
    return tokens[i];
  }
}

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

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

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

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

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.code.CompressedWriteStream;
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 OopMap
  extends VMObject
{
  private static CIntegerField pcOffsetField;
  private static CIntegerField omvCountField;
  private static CIntegerField omvDataSizeField;
  private static AddressField omvDataField;
  private static AddressField compressedWriteStreamField;
  private static AddressField compressedStreamBufferField;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        OopMap.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("OopMap");
    
    pcOffsetField = type.getCIntegerField("_pc_offset");
    omvCountField = type.getCIntegerField("_omv_count");
    omvDataSizeField = type.getCIntegerField("_omv_data_size");
    omvDataField = type.getAddressField("_omv_data");
    compressedWriteStreamField = type.getAddressField("_write_stream");
    
    type = db.lookupType("CompressedStream");
    compressedStreamBufferField = type.getAddressField("_buffer");
  }
  
  public OopMap(Address addr)
  {
    super(addr);
  }
  
  public long getOffset()
  {
    return pcOffsetField.getValue(addr);
  }
  
  Address getOMVData()
  {
    return omvDataField.getValue(addr);
  }
  
  long getOMVDataSize()
  {
    return omvDataSizeField.getValue(addr);
  }
  
  long getOMVCount()
  {
    return omvCountField.getValue(addr);
  }
  
  CompressedWriteStream getWriteStream()
  {
    Address wsAddr = compressedWriteStreamField.getValue(addr);
    if (wsAddr == null) {
      return null;
    }
    Address bufferAddr = compressedStreamBufferField.getValue(wsAddr);
    if (bufferAddr == null) {
      return null;
    }
    return new CompressedWriteStream(bufferAddr);
  }
}

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

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

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

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

import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.AddressVisitor;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.utilities.Assert;

class OopMapSet$MyVisitor
  implements OopMapVisitor
{
  private AddressVisitor addressVisitor;
  
  public OopMapSet$MyVisitor(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 narrowOopAddr)
  {
    addressVisitor.visitCompOopAddress(narrowOopAddr);
  }
}

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

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.debugger.Address;
import sun.jvm.hotspot.runtime.AddressVisitor;
import sun.jvm.hotspot.runtime.Frame;
import sun.jvm.hotspot.runtime.RegisterMap;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.runtime.VMReg;
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 OopMapSet
  extends VMObject
{
  private static final boolean DEBUG = System.getProperty("sun.jvm.hotspot.compiler.OopMapSet.DEBUG") != null;
  private static CIntegerField omCountField;
  private static CIntegerField omSizeField;
  private static AddressField omDataField;
  private static int REG_COUNT;
  private static int SAVED_ON_ENTRY_REG_COUNT;
  private static int C_SAVED_ON_ENTRY_REG_COUNT;
  
  private static class MyVisitor
    implements OopMapVisitor
  {
    private AddressVisitor addressVisitor;
    
    public MyVisitor(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 narrowOopAddr)
    {
      addressVisitor.visitCompOopAddress(narrowOopAddr);
    }
  }
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        OopMapSet.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    Type type = db.lookupType("OopMapSet");
    
    omCountField = type.getCIntegerField("_om_count");
    omSizeField = type.getCIntegerField("_om_size");
    omDataField = type.getAddressField("_om_data");
    if (!VM.getVM().isCore())
    {
      REG_COUNT = db.lookupIntConstant("REG_COUNT").intValue();
      if (VM.getVM().isServerCompiler())
      {
        SAVED_ON_ENTRY_REG_COUNT = db.lookupIntConstant("SAVED_ON_ENTRY_REG_COUNT").intValue();
        C_SAVED_ON_ENTRY_REG_COUNT = db.lookupIntConstant("C_SAVED_ON_ENTRY_REG_COUNT").intValue();
      }
    }
  }
  
  public OopMapSet(Address addr)
  {
    super(addr);
  }
  
  public long getSize()
  {
    return omCountField.getValue(addr);
  }
  
  public OopMap getMapAt(int index)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that((index >= 0) && (index <= getSize()), "bad index");
    }
    Address omDataAddr = omDataField.getValue(addr);
    Address oopMapAddr = omDataAddr.getAddressAt(index * VM.getVM().getAddressSize());
    if (oopMapAddr == null) {
      return null;
    }
    return new OopMap(oopMapAddr);
  }
  
  public OopMap findMapAtOffset(long pcOffset, boolean debugging)
  {
    int len = (int)getSize();
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(len > 0, "must have pointer maps");
    }
    for (int i = 0; i < len; i++) {
      if (getMapAt(i).getOffset() >= pcOffset) {
        break;
      }
    }
    if (!debugging)
    {
      if (Assert.ASSERTS_ENABLED)
      {
        Assert.that(i < len, "oopmap not found for pcOffset = " + pcOffset + "; len = " + len);
        Assert.that(getMapAt(i).getOffset() == pcOffset, "oopmap not found");
      }
    }
    else if (i == len)
    {
      if (DEBUG)
      {
        System.out.println("can't find oopmap at " + pcOffset);
        System.out.print("Oopmap offsets are [ ");
        for (i = 0; i < len; i++) {
          System.out.print(getMapAt(i).getOffset());
        }
        System.out.println("]");
      }
      i = len - 1;
      return getMapAt(i);
    }
    OopMap m = getMapAt(i);
    return m;
  }
  
  public static void oopsDo(Frame fr, CodeBlob cb, RegisterMap regMap, AddressVisitor oopVisitor, boolean debugging)
  {
    allDo(fr, cb, regMap, new MyVisitor(oopVisitor), debugging);
  }
  
  public static void allDo(Frame fr, CodeBlob cb, RegisterMap regMap, OopMapVisitor visitor, boolean debugging)
  {
    if (Assert.ASSERTS_ENABLED)
    {
      CodeBlob tmpCB = VM.getVM().getCodeCache().findBlob(fr.getPC());
      Assert.that((tmpCB != null) && (cb.equals(tmpCB)), "wrong codeblob passed in");
    }
    OopMapSet maps = cb.getOopMaps();
    OopMap map = cb.getOopMapForReturnAddress(fr.getPC(), debugging);
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(map != null, "no ptr map found");
    }
    for (OopMapStream oms = new OopMapStream(map, OopMapValue.OopTypes.DERIVED_OOP_VALUE); !oms.isDone(); oms.next())
    {
      if (VM.getVM().isClientCompiler()) {
        Assert.that(false, "should not reach here");
      }
      OopMapValue omv = oms.getCurrent();
      Address loc = fr.oopMapRegToLocation(omv.getReg(), regMap);
      if (loc != null)
      {
        Address baseLoc = fr.oopMapRegToLocation(omv.getContentReg(), regMap);
        Address derivedLoc = loc;
        visitor.visitDerivedOopLocation(baseLoc, derivedLoc);
      }
    }
    OopMapValue.OopTypes[] values = { OopMapValue.OopTypes.OOP_VALUE, OopMapValue.OopTypes.VALUE_VALUE, OopMapValue.OopTypes.NARROWOOP_VALUE };
    for (OopMapStream oms = new OopMapStream(map, values); !oms.isDone(); oms.next())
    {
      OopMapValue omv = oms.getCurrent();
      Address loc = fr.oopMapRegToLocation(omv.getReg(), regMap);
      if (loc != null) {
        if (omv.getType() == OopMapValue.OopTypes.OOP_VALUE) {
          visitor.visitOopLocation(loc);
        } else if (omv.getType() == OopMapValue.OopTypes.VALUE_VALUE) {
          visitor.visitValueLocation(loc);
        } else if (omv.getType() == OopMapValue.OopTypes.NARROWOOP_VALUE) {
          visitor.visitNarrowOopLocation(loc);
        }
      }
    }
  }
  
  public static void updateRegisterMap(Frame fr, CodeBlob cb, RegisterMap regMap, boolean debugging)
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(!VM.getVM().isCore(), "non-core builds only");
    }
    if (!VM.getVM().isDebugging())
    {
      if (Assert.ASSERTS_ENABLED)
      {
        OopMapSet maps = cb.getOopMaps();
        Assert.that((maps != null) && (maps.getSize() > 0L), "found null or empty OopMapSet for CodeBlob");
      }
    }
    else
    {
      OopMapSet maps = cb.getOopMaps();
      if ((maps == null) || (maps.getSize() == 0L)) {
        return;
      }
    }
    regMap.setIncludeArgumentOops(cb.callerMustGCArguments(regMap.getThread()));
    
    int nofCallee = 0;
    Address[] locs = new Address[2 * REG_COUNT + 1];
    VMReg[] regs = new VMReg[2 * REG_COUNT + 1];
    
    OopMap map = cb.getOopMapForReturnAddress(fr.getPC(), debugging);
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(map != null, "no ptr map found");
    }
    OopMapValue omv = null;
    for (OopMapStream oms = new OopMapStream(map, OopMapValue.OopTypes.CALLEE_SAVED_VALUE); !oms.isDone(); oms.next())
    {
      omv = oms.getCurrent();
      if (Assert.ASSERTS_ENABLED) {
        Assert.that(nofCallee < 2 * REG_COUNT, "overflow");
      }
      regs[nofCallee] = omv.getContentReg();
      locs[nofCallee] = fr.oopMapRegToLocation(omv.getReg(), regMap);
      nofCallee++;
    }
    if ((Assert.ASSERTS_ENABLED) && 
      (VM.getVM().isServerCompiler())) {
      Assert.that((!cb.isRuntimeStub()) || (nofCallee >= SAVED_ON_ENTRY_REG_COUNT) || (nofCallee >= C_SAVED_ON_ENTRY_REG_COUNT), "must save all");
    }
    for (int i = 0; i < nofCallee; i++) {
      regMap.setLocation(regs[i], locs[i]);
    }
  }
}

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

import sun.jvm.hotspot.code.CompressedReadStream;
import sun.jvm.hotspot.code.CompressedWriteStream;

public class OopMapStream
{
  private CompressedReadStream stream;
  private OopMap oopMap;
  private int mask;
  private int size;
  private int position;
  private OopMapValue omv;
  private boolean omvValid;
  
  public OopMapStream(OopMap oopMap)
  {
    this(oopMap, (OopMapValue.OopTypes[])null);
  }
  
  public OopMapStream(OopMap oopMap, OopMapValue.OopTypes type)
  {
    this(oopMap, (OopMapValue.OopTypes[])null);
    mask = type.getValue();
  }
  
  public OopMapStream(OopMap oopMap, OopMapValue.OopTypes[] types)
  {
    if (oopMap.getOMVData() == null) {
      stream = new CompressedReadStream(oopMap.getWriteStream().getBuffer());
    } else {
      stream = new CompressedReadStream(oopMap.getOMVData());
    }
    mask = computeMask(types);
    size = ((int)oopMap.getOMVCount());
    position = 0;
    omv = new OopMapValue();
    omvValid = false;
  }
  
  public boolean isDone()
  {
    if (!omvValid) {
      findNext();
    }
    return !omvValid;
  }
  
  public void next()
  {
    findNext();
  }
  
  public OopMapValue getCurrent()
  {
    return omv;
  }
  
  private int computeMask(OopMapValue.OopTypes[] types)
  {
    mask = 0;
    if (types != null) {
      for (int i = 0; i < types.length; i++) {
        mask |= types[i].getValue();
      }
    }
    return mask;
  }
  
  private void findNext()
  {
    while (position++ < size)
    {
      omv.readFrom(stream);
      if ((omv.getType().getValue() & mask) > 0)
      {
        omvValid = true;
        return;
      }
    }
    omvValid = false;
  }
}

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

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

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

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

final class OopMapValue$OopTypes$1
  extends OopMapValue.OopTypes
{
  int getValue()
  {
    return OopMapValue.UNUSED_VALUE;
  }
}

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

final class OopMapValue$OopTypes$2
  extends OopMapValue.OopTypes
{
  int getValue()
  {
    return OopMapValue.OOP_VALUE;
  }
}

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

final class OopMapValue$OopTypes$3
  extends OopMapValue.OopTypes
{
  int getValue()
  {
    return OopMapValue.VALUE_VALUE;
  }
}

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

final class OopMapValue$OopTypes$4
  extends OopMapValue.OopTypes
{
  int getValue()
  {
    return OopMapValue.NARROWOOP_VALUE;
  }
}

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

final class OopMapValue$OopTypes$5
  extends OopMapValue.OopTypes
{
  int getValue()
  {
    return OopMapValue.CALLEE_SAVED_VALUE;
  }
}

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

final class OopMapValue$OopTypes$6
  extends OopMapValue.OopTypes
{
  int getValue()
  {
    return OopMapValue.DERIVED_OOP_VALUE;
  }
}

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

public abstract class OopMapValue$OopTypes
{
  public static final OopTypes UNUSED_VALUE = new OopTypes()
  {
    int getValue()
    {
      return OopMapValue.UNUSED_VALUE;
    }
  };
  public static final OopTypes OOP_VALUE = new OopTypes()
  {
    int getValue()
    {
      return OopMapValue.OOP_VALUE;
    }
  };
  public static final OopTypes VALUE_VALUE = new OopTypes()
  {
    int getValue()
    {
      return OopMapValue.VALUE_VALUE;
    }
  };
  public static final OopTypes NARROWOOP_VALUE = new OopTypes()
  {
    int getValue()
    {
      return OopMapValue.NARROWOOP_VALUE;
    }
  };
  public static final OopTypes CALLEE_SAVED_VALUE = new OopTypes()
  {
    int getValue()
    {
      return OopMapValue.CALLEE_SAVED_VALUE;
    }
  };
  public static final OopTypes DERIVED_OOP_VALUE = new OopTypes()
  {
    int getValue()
    {
      return OopMapValue.DERIVED_OOP_VALUE;
    }
  };
  
  abstract int getValue();
}

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

import java.util.Observable;
import java.util.Observer;
import sun.jvm.hotspot.code.CompressedReadStream;
import sun.jvm.hotspot.code.VMRegImpl;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMReg;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.utilities.Assert;

public class OopMapValue
{
  private short value;
  private short contentReg;
  static int TYPE_BITS;
  static int REGISTER_BITS;
  static int TYPE_SHIFT;
  static int REGISTER_SHIFT;
  static int TYPE_MASK;
  static int TYPE_MASK_IN_PLACE;
  static int REGISTER_MASK;
  static int REGISTER_MASK_IN_PLACE;
  static int UNUSED_VALUE;
  static int OOP_VALUE;
  static int VALUE_VALUE;
  static int NARROWOOP_VALUE;
  static int CALLEE_SAVED_VALUE;
  static int DERIVED_OOP_VALUE;
  
  static
  {
    VM.registerVMInitializedObserver(new Observer()
    {
      public void update(Observable o, Object data)
      {
        OopMapValue.initialize(VM.getVM().getTypeDataBase());
      }
    });
  }
  
  private static void initialize(TypeDataBase db)
  {
    TYPE_BITS = db.lookupIntConstant("OopMapValue::type_bits").intValue();
    REGISTER_BITS = db.lookupIntConstant("OopMapValue::register_bits").intValue();
    TYPE_SHIFT = db.lookupIntConstant("OopMapValue::type_shift").intValue();
    REGISTER_SHIFT = db.lookupIntConstant("OopMapValue::register_shift").intValue();
    TYPE_MASK = db.lookupIntConstant("OopMapValue::type_mask").intValue();
    TYPE_MASK_IN_PLACE = db.lookupIntConstant("OopMapValue::type_mask_in_place").intValue();
    REGISTER_MASK = db.lookupIntConstant("OopMapValue::register_mask").intValue();
    REGISTER_MASK_IN_PLACE = db.lookupIntConstant("OopMapValue::register_mask_in_place").intValue();
    UNUSED_VALUE = db.lookupIntConstant("OopMapValue::unused_value").intValue();
    OOP_VALUE = db.lookupIntConstant("OopMapValue::oop_value").intValue();
    VALUE_VALUE = db.lookupIntConstant("OopMapValue::value_value").intValue();
    NARROWOOP_VALUE = db.lookupIntConstant("OopMapValue::narrowoop_value").intValue();
    CALLEE_SAVED_VALUE = db.lookupIntConstant("OopMapValue::callee_saved_value").intValue();
    DERIVED_OOP_VALUE = db.lookupIntConstant("OopMapValue::derived_oop_value").intValue();
  }
  
  public static abstract class OopTypes
  {
    public static final OopTypes UNUSED_VALUE = new OopTypes()
    {
      int getValue()
      {
        return OopMapValue.UNUSED_VALUE;
      }
    };
    public static final OopTypes OOP_VALUE = new OopTypes()
    {
      int getValue()
      {
        return OopMapValue.OOP_VALUE;
      }
    };
    public static final OopTypes VALUE_VALUE = new OopTypes()
    {
      int getValue()
      {
        return OopMapValue.VALUE_VALUE;
      }
    };
    public static final OopTypes NARROWOOP_VALUE = new OopTypes()
    {
      int getValue()
      {
        return OopMapValue.NARROWOOP_VALUE;
      }
    };
    public static final OopTypes CALLEE_SAVED_VALUE = new OopTypes()
    {
      int getValue()
      {
        return OopMapValue.CALLEE_SAVED_VALUE;
      }
    };
    public static final OopTypes DERIVED_OOP_VALUE = new OopTypes()
    {
      int getValue()
      {
        return OopMapValue.DERIVED_OOP_VALUE;
      }
    };
    
    abstract int getValue();
  }
  
  public OopMapValue()
  {
    setValue((short)0);setContentReg(new VMReg(0));
  }
  
  public OopMapValue(VMReg reg, OopTypes t)
  {
    setReg(reg);setType(t);
  }
  
  public OopMapValue(VMReg reg, OopTypes t, VMReg reg2)
  {
    setReg(reg);setType(t);setContentReg(reg2);
  }
  
  public OopMapValue(CompressedReadStream stream)
  {
    readFrom(stream);
  }
  
  public void readFrom(CompressedReadStream stream)
  {
    setValue((short)stream.readInt());
    if ((isCalleeSaved()) || (isDerivedOop())) {
      setContentReg(new VMReg(stream.readInt()));
    }
  }
  
  public boolean isOop()
  {
    return (getValue() & TYPE_MASK_IN_PLACE) == OOP_VALUE;
  }
  
  public boolean isValue()
  {
    return (getValue() & TYPE_MASK_IN_PLACE) == VALUE_VALUE;
  }
  
  public boolean isNarrowOop()
  {
    return (getValue() & TYPE_MASK_IN_PLACE) == NARROWOOP_VALUE;
  }
  
  public boolean isCalleeSaved()
  {
    return (getValue() & TYPE_MASK_IN_PLACE) == CALLEE_SAVED_VALUE;
  }
  
  public boolean isDerivedOop()
  {
    return (getValue() & TYPE_MASK_IN_PLACE) == DERIVED_OOP_VALUE;
  }
  
  public VMReg getReg()
  {
    return new VMReg((getValue() & REGISTER_MASK_IN_PLACE) >> REGISTER_SHIFT);
  }
  
  public void setReg(VMReg r)
  {
    setValue((short)(r.getValue() << REGISTER_SHIFT | getValue() & TYPE_MASK_IN_PLACE));
  }
  
  public OopTypes getType()
  {
    int which = getValue() & TYPE_MASK_IN_PLACE;
    if (which == UNUSED_VALUE) {
      return OopTypes.UNUSED_VALUE;
    }
    if (which == OOP_VALUE) {
      return OopTypes.OOP_VALUE;
    }
    if (which == VALUE_VALUE) {
      return OopTypes.VALUE_VALUE;
    }
    if (which == NARROWOOP_VALUE) {
      return OopTypes.NARROWOOP_VALUE;
    }
    if (which == CALLEE_SAVED_VALUE) {
      return OopTypes.CALLEE_SAVED_VALUE;
    }
    if (which == DERIVED_OOP_VALUE) {
      return OopTypes.DERIVED_OOP_VALUE;
    }
    throw new InternalError("unknown which " + which + " (TYPE_MASK_IN_PLACE = " + TYPE_MASK_IN_PLACE + ")");
  }
  
  public void setType(OopTypes t)
  {
    setValue((short)(getValue() & REGISTER_MASK_IN_PLACE | t.getValue()));
  }
  
  public VMReg getContentReg()
  {
    return new VMReg(contentReg);
  }
  
  public void setContentReg(VMReg r)
  {
    contentReg = ((short)r.getValue());
  }
  
  public boolean isRegisterLoc()
  {
    VM.getVM().getVMRegImplInfo();return getReg().lessThan(VMRegImpl.getStack0());
  }
  
  public boolean isStackLoc()
  {
    VM.getVM().getVMRegImplInfo();return getReg().greaterThanOrEqual(VMRegImpl.getStack0());
  }
  
  public int getStackOffset()
  {
    if (Assert.ASSERTS_ENABLED) {
      Assert.that(isStackLoc(), "must be stack location");
    }
    VM.getVM().getVMRegImplInfo();return getReg().minus(VMRegImpl.getStack0());
  }
  
  private void setValue(short value)
  {
    this.value = value;
  }
  
  private int getValue()
  {
    return value;
  }
}

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

import sun.jvm.hotspot.debugger.Address;

public abstract interface OopMapVisitor
{
  public abstract void visitOopLocation(Address paramAddress);
  
  public abstract void visitDerivedOopLocation(Address paramAddress1, Address paramAddress2);
  
  public abstract void visitValueLocation(Address paramAddress);
  
  public abstract void visitNarrowOopLocation(Address paramAddress);
}

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

public abstract interface Address
{
  public abstract boolean equals(Object paramObject);
  
  public abstract int hashCode();
  
  public abstract long getCIntegerAt(long paramLong1, long paramLong2, boolean paramBoolean)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract Address getAddressAt(long paramLong)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract Address getCompOopAddressAt(long paramLong)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract boolean getJBooleanAt(long paramLong)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract byte getJByteAt(long paramLong)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract char getJCharAt(long paramLong)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract double getJDoubleAt(long paramLong)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract float getJFloatAt(long paramLong)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract int getJIntAt(long paramLong)
    throws UnmappedAddressException, UnalignedAddressException;
  
  public abstract long getJLongAt(long paramLong)
    th
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