/**
  * Debugging routine only. Returns non-null JNIHandleBlock containing the JNI handle or null if
  * this handle block and its successors did not contain it (or if the handle was deleted).
  */
 public JNIHandleBlock blockContainingHandle(Address jniHandle) {
   JNIHandleBlock cur = this;
   while (cur != null) {
     if (indexOfHandle(jniHandle) >= 0) {
       return cur;
     }
     cur = cur.next();
   }
   return null;
 }
  public void oopsDo(AddressVisitor visitor) {
    // Visit handles in this block
    for (int i = 0; i < top(); i++) {
      Address cur = getOopHandleAddress(i);
      if (cur != null) {
        visitor.visitAddress(cur);
      }
    }

    // Visit handles in subsequent blocks if necessary
    JNIHandleBlock n = next();
    if (n != null) {
      n.oopsDo(visitor);
    }
  }
 // Traverse a JNIHandleBlock
 private void doJNIHandleBlock(JNIHandleBlock handles, AddressVisitor oopVisitor) {
   handles.oopsDo(oopVisitor);
 }