7030435: Some oop_oop_iterate_m() methods iterate outside of specified memory bounds
Summary: Filter ref-containing locations through the memory-interval specified in the call.
Reviewed-by: jcoomes, jwilhelm, tonyp
--- a/hotspot/src/share/vm/oops/constantPoolKlass.cpp Wed Mar 23 10:55:43 2011 -0700
+++ b/hotspot/src/share/vm/oops/constantPoolKlass.cpp Thu Mar 24 15:45:27 2011 -0700
@@ -245,13 +245,13 @@
}
oop* addr;
addr = cp->tags_addr();
- blk->do_oop(addr);
+ if (mr.contains(addr)) blk->do_oop(addr);
addr = cp->cache_addr();
- blk->do_oop(addr);
+ if (mr.contains(addr)) blk->do_oop(addr);
addr = cp->operands_addr();
- blk->do_oop(addr);
+ if (mr.contains(addr)) blk->do_oop(addr);
addr = cp->pool_holder_addr();
- blk->do_oop(addr);
+ if (mr.contains(addr)) blk->do_oop(addr);
return size;
}