agent/src/share/classes/sun/jvm/hotspot/memory/CMSCollector.java

Print this page
rev 4134 : imported patch remove-prints


  44         }
  45       });
  46   }
  47 
  48   private static synchronized void initialize(TypeDataBase db) {
  49     Type type = db.lookupType("CMSCollector");
  50     markBitMapFieldOffset = type.getField("_markBitMap").getOffset();
  51   }
  52 
  53   //Accessing mark bitmap
  54   public CMSBitMap markBitMap() {
  55    return (CMSBitMap) VMObjectFactory.newObject(
  56                                 CMSBitMap.class,
  57                                 addr.addOffsetTo(markBitMapFieldOffset));
  58   }
  59 
  60   public long blockSizeUsingPrintezisBits(Address addr) {
  61     CMSBitMap markBitMap = markBitMap();
  62     long addressSize = VM.getVM().getAddressSize();
  63     if ( markBitMap.isMarked(addr) &&  markBitMap.isMarked(addr.addOffsetTo(1*addressSize)) ) {
  64        System.err.println("Printezis bits are set...");
  65       Address nextOneAddr = markBitMap.getNextMarkedWordAddress(addr.addOffsetTo(2*addressSize));
  66       //return size in bytes
  67       long size =  (nextOneAddr.addOffsetTo(1*addressSize)).minus(addr);
  68       return size;
  69     } else {
  70      //missing Printezis marks
  71      System.err.println("Missing Printszis marks...");
  72      return -1;
  73     }
  74 
  75   }
  76 }


  44         }
  45       });
  46   }
  47 
  48   private static synchronized void initialize(TypeDataBase db) {
  49     Type type = db.lookupType("CMSCollector");
  50     markBitMapFieldOffset = type.getField("_markBitMap").getOffset();
  51   }
  52 
  53   //Accessing mark bitmap
  54   public CMSBitMap markBitMap() {
  55    return (CMSBitMap) VMObjectFactory.newObject(
  56                                 CMSBitMap.class,
  57                                 addr.addOffsetTo(markBitMapFieldOffset));
  58   }
  59 
  60   public long blockSizeUsingPrintezisBits(Address addr) {
  61     CMSBitMap markBitMap = markBitMap();
  62     long addressSize = VM.getVM().getAddressSize();
  63     if ( markBitMap.isMarked(addr) &&  markBitMap.isMarked(addr.addOffsetTo(1*addressSize)) ) {

  64       Address nextOneAddr = markBitMap.getNextMarkedWordAddress(addr.addOffsetTo(2*addressSize));
  65       //return size in bytes
  66       long size =  (nextOneAddr.addOffsetTo(1*addressSize)).minus(addr);
  67       return size;
  68     } else {
  69       //missing Printezis marks

  70       return -1;
  71     }
  72 
  73   }
  74 }