7121373: Clean up CollectedHeap::is_in

Fixed G1CollectedHeap::is_in, added tests, cleaned up comments and made Space::is_in pure virtual.

Reviewed-by: brutisso, tonyp, jcoomes
This commit is contained in:
Stefan Karlsson 2011-12-14 12:15:26 +01:00
parent 714e978aac
commit a3943834e1
15 changed files with 54 additions and 32 deletions

View file

@ -217,8 +217,8 @@ class CollectedHeap : public CHeapObj {
return p == NULL || is_in_reserved(p);
}
// Returns "TRUE" if "p" points to the head of an allocated object in the
// heap. Since this method can be expensive in general, we restrict its
// Returns "TRUE" iff "p" points into the committed areas of the heap.
// Since this method can be expensive in general, we restrict its
// use to assertion checking only.
virtual bool is_in(const void* p) const = 0;
@ -648,6 +648,10 @@ class CollectedHeap : public CHeapObj {
// reduce the occurrence of ParallelGCThreads to uses where the
// actual number may be germane.
static bool use_parallel_gc_threads() { return ParallelGCThreads > 0; }
/////////////// Unit tests ///////////////
NOT_PRODUCT(static void test_is_in();)
};
// Class to set and reset the GC cause for a CollectedHeap.