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);
 }