hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java
changeset 13969 d2a189b83b87
parent 5547 f4b087cbb361
equal deleted inserted replaced
13968:8c9029c01470 13969:d2a189b83b87
    56   // heap data.
    56   // heap data.
    57   protected long oopSize;
    57   protected long oopSize;
    58   protected long heapOopSize;
    58   protected long heapOopSize;
    59   protected long narrowOopBase;  // heap base for compressed oops.
    59   protected long narrowOopBase;  // heap base for compressed oops.
    60   protected int  narrowOopShift; // shift to decode compressed oops.
    60   protected int  narrowOopShift; // shift to decode compressed oops.
       
    61   // class metadata space
       
    62   protected long klassPtrSize;
       
    63   protected long narrowKlassBase;  // heap base for compressed klass ptrs.
       
    64   protected int  narrowKlassShift; // shift to decode compressed klass ptrs.
    61   // Should be initialized if desired by calling initCache()
    65   // Should be initialized if desired by calling initCache()
    62   private PageCache cache;
    66   private PageCache cache;
    63 
    67 
    64   // State for faster accessors that don't allocate memory on each read
    68   // State for faster accessors that don't allocate memory on each read
    65   private boolean useFastAccessors;
    69   private boolean useFastAccessors;
   157        (jshortSize   == 2));
   161        (jshortSize   == 2));
   158 
   162 
   159     javaPrimitiveTypesConfigured = true;
   163     javaPrimitiveTypesConfigured = true;
   160   }
   164   }
   161 
   165 
   162   public void putHeapConst(long heapOopSize, long narrowOopBase, int narrowOopShift) {
   166   public void putHeapConst(long heapOopSize, long klassPtrSize, long narrowOopBase, int narrowOopShift,
       
   167                            long narrowKlassBase, int narrowKlassShift) {
   163     this.heapOopSize = heapOopSize;
   168     this.heapOopSize = heapOopSize;
       
   169     this.klassPtrSize = klassPtrSize;
   164     this.narrowOopBase = narrowOopBase;
   170     this.narrowOopBase = narrowOopBase;
   165     this.narrowOopShift = narrowOopShift;
   171     this.narrowOopShift = narrowOopShift;
       
   172     this.narrowKlassBase = narrowKlassBase;
       
   173     this.narrowKlassShift = narrowKlassShift;
   166   }
   174   }
   167 
   175 
   168   /** May be called by subclasses if desired to initialize the page
   176   /** May be called by subclasses if desired to initialize the page
   169       cache but may not be overridden */
   177       cache but may not be overridden */
   170   protected final void initCache(long pageSize, long maxNumPages) {
   178   protected final void initCache(long pageSize, long maxNumPages) {
   462       value = (long)(narrowOopBase + (long)(value << narrowOopShift));
   470       value = (long)(narrowOopBase + (long)(value << narrowOopShift));
   463     }
   471     }
   464     return value;
   472     return value;
   465   }
   473   }
   466 
   474 
       
   475   protected long readCompKlassAddressValue(long address)
       
   476     throws UnmappedAddressException, UnalignedAddressException {
       
   477     long value = readCInteger(address, getKlassPtrSize(), true);
       
   478     if (value != 0) {
       
   479       value = (long)(narrowKlassBase + (long)(value << narrowKlassShift));
       
   480     }
       
   481     return value;
       
   482   }
       
   483 
   467   protected void writeAddressValue(long address, long value)
   484   protected void writeAddressValue(long address, long value)
   468     throws UnmappedAddressException, UnalignedAddressException {
   485     throws UnmappedAddressException, UnalignedAddressException {
   469     writeCInteger(address, machDesc.getAddressSize(), value);
   486     writeCInteger(address, machDesc.getAddressSize(), value);
   470   }
   487   }
   471 
   488 
   549     return narrowOopBase;
   566     return narrowOopBase;
   550   }
   567   }
   551   public int getNarrowOopShift() {
   568   public int getNarrowOopShift() {
   552     return narrowOopShift;
   569     return narrowOopShift;
   553   }
   570   }
       
   571 
       
   572   public long getKlassPtrSize() {
       
   573     return klassPtrSize;
       
   574   }
       
   575 
       
   576   public long getNarrowKlassBase() {
       
   577     return narrowKlassBase;
       
   578   }
       
   579   public int getNarrowKlassShift() {
       
   580     return narrowKlassShift;
       
   581   }
   554 }
   582 }