agent/src/share/classes/sun/jvm/hotspot/oops/TypeArray.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7012081 Sdiff agent/src/share/classes/sun/jvm/hotspot/oops

agent/src/share/classes/sun/jvm/hotspot/oops/TypeArray.java

Print this page




  36 public class TypeArray extends Array {
  37   static {
  38     VM.registerVMInitializedObserver(new Observer() {
  39         public void update(Observable o, Object data) {
  40           initialize(VM.getVM().getTypeDataBase());
  41         }
  42       });
  43   }
  44 
  45   private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
  46     Type type = db.lookupType("typeArrayOopDesc");
  47   }
  48 
  49   TypeArray(OopHandle handle, ObjectHeap heap) {
  50     super(handle, heap);
  51   }
  52 
  53   public boolean isTypeArray()         { return true; }
  54 
  55   public byte getByteAt(long index) {



  56     long offset = baseOffsetInBytes(BasicType.T_BYTE) + index * getHeap().getByteSize();
  57     return getHandle().getJByteAt(offset);
  58   }
  59 
  60   public boolean getBooleanAt(long index) {
  61     long offset = baseOffsetInBytes(BasicType.T_BOOLEAN) + index * getHeap().getBooleanSize();
  62     return getHandle().getJBooleanAt(offset);
  63   }
  64 
  65   public char getCharAt(long index) {
  66     long offset = baseOffsetInBytes(BasicType.T_CHAR) + index * getHeap().getCharSize();
  67     return getHandle().getJCharAt(offset);
  68   }
  69 
  70   public int getIntAt(long index) {
  71     long offset = baseOffsetInBytes(BasicType.T_INT) + index * getHeap().getIntSize();
  72     return getHandle().getJIntAt(offset);
  73   }
  74 
  75   public short getShortAt(long index) {




  36 public class TypeArray extends Array {
  37   static {
  38     VM.registerVMInitializedObserver(new Observer() {
  39         public void update(Observable o, Object data) {
  40           initialize(VM.getVM().getTypeDataBase());
  41         }
  42       });
  43   }
  44 
  45   private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
  46     Type type = db.lookupType("typeArrayOopDesc");
  47   }
  48 
  49   TypeArray(OopHandle handle, ObjectHeap heap) {
  50     super(handle, heap);
  51   }
  52 
  53   public boolean isTypeArray()         { return true; }
  54 
  55   public byte getByteAt(long index) {
  56     if (index < 0 || index >= getLength()) {
  57       throw new ArrayIndexOutOfBoundsException(index + " " + getLength());
  58     }
  59     long offset = baseOffsetInBytes(BasicType.T_BYTE) + index * getHeap().getByteSize();
  60     return getHandle().getJByteAt(offset);
  61   }
  62 
  63   public boolean getBooleanAt(long index) {
  64     long offset = baseOffsetInBytes(BasicType.T_BOOLEAN) + index * getHeap().getBooleanSize();
  65     return getHandle().getJBooleanAt(offset);
  66   }
  67 
  68   public char getCharAt(long index) {
  69     long offset = baseOffsetInBytes(BasicType.T_CHAR) + index * getHeap().getCharSize();
  70     return getHandle().getJCharAt(offset);
  71   }
  72 
  73   public int getIntAt(long index) {
  74     long offset = baseOffsetInBytes(BasicType.T_INT) + index * getHeap().getIntSize();
  75     return getHandle().getJIntAt(offset);
  76   }
  77 
  78   public short getShortAt(long index) {


agent/src/share/classes/sun/jvm/hotspot/oops/TypeArray.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File