< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Generation.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 167 
 168   /** Returns "TRUE" iff "p" points into the reserved area of the
 169      generation. */
 170   public boolean isInReserved(Address p) {
 171     return reserved().contains(p);
 172   }
 173 
 174   protected VirtualSpace virtualSpace() {
 175     return (VirtualSpace) VMObjectFactory.newObject(VirtualSpace.class, addr.addOffsetTo(virtualSpaceFieldOffset));
 176   }
 177 
 178   public abstract String name();
 179 
 180   /** Equivalent to spaceIterate(blk, false) */
 181   public void spaceIterate(SpaceClosure blk) {
 182     spaceIterate(blk, false);
 183   }
 184 
 185   /** Iteration - do not use for time critical operations */
 186   public abstract void spaceIterate(SpaceClosure blk, boolean usedOnly);

 187 
 188   public void print() { printOn(System.out); }
 189   public abstract void printOn(PrintStream tty);
 190 
 191   public static class StatRecord extends VMObject {
 192     public StatRecord(Address addr) {
 193       super(addr);
 194     }
 195 
 196     public int getInvocations() {
 197       return (int) invocationField.getValue(addr);
 198     }
 199 
 200   }
 201 
 202   private StatRecord getStatRecord() {
 203     return (StatRecord) VMObjectFactory.newObject(Generation.StatRecord.class, addr.addOffsetTo(statRecordField.getOffset()));
 204   }
 205 }
   1 /*
   2  * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 167 
 168   /** Returns "TRUE" iff "p" points into the reserved area of the
 169      generation. */
 170   public boolean isInReserved(Address p) {
 171     return reserved().contains(p);
 172   }
 173 
 174   protected VirtualSpace virtualSpace() {
 175     return (VirtualSpace) VMObjectFactory.newObject(VirtualSpace.class, addr.addOffsetTo(virtualSpaceFieldOffset));
 176   }
 177 
 178   public abstract String name();
 179 
 180   /** Equivalent to spaceIterate(blk, false) */
 181   public void spaceIterate(SpaceClosure blk) {
 182     spaceIterate(blk, false);
 183   }
 184 
 185   /** Iteration - do not use for time critical operations */
 186   public abstract void spaceIterate(SpaceClosure blk, boolean usedOnly);
 187   public abstract void liveRegionsIterate(LiveRegionsClosure closure);
 188 
 189   public void print() { printOn(System.out); }
 190   public abstract void printOn(PrintStream tty);
 191 
 192   public static class StatRecord extends VMObject {
 193     public StatRecord(Address addr) {
 194       super(addr);
 195     }
 196 
 197     public int getInvocations() {
 198       return (int) invocationField.getValue(addr);
 199     }
 200 
 201   }
 202 
 203   private StatRecord getStatRecord() {
 204     return (StatRecord) VMObjectFactory.newObject(Generation.StatRecord.class, addr.addOffsetTo(statRecordField.getOffset()));
 205   }
 206 }
< prev index next >