8076231: Remove unused is_in_partial_collection()

Reviewed-by: brutisso, drwhite
This commit is contained in:
Per Lidén 2015-03-31 08:27:30 +02:00
parent 062cf882e0
commit ff23a17283
7 changed files with 3 additions and 47 deletions

View file

@ -402,25 +402,6 @@ HeapRegion* G1CollectedHeap::pop_dirty_cards_region()
return hr; return hr;
} }
#ifdef ASSERT
// A region is added to the collection set as it is retired
// so an address p can point to a region which will be in the
// collection set but has not yet been retired. This method
// therefore is only accurate during a GC pause after all
// regions have been retired. It is used for debugging
// to check if an nmethod has references to objects that can
// be move during a partial collection. Though it can be
// inaccurate, it is sufficient for G1 because the conservative
// implementation of is_scavengable() for G1 will indicate that
// all nmethods must be scanned during a partial collection.
bool G1CollectedHeap::is_in_partial_collection(const void* p) {
if (p == NULL) {
return false;
}
return heap_region_containing(p)->in_collection_set();
}
#endif
// Returns true if the reference points to an object that // Returns true if the reference points to an object that
// can move in an incremental collection. // can move in an incremental collection.
bool G1CollectedHeap::is_scavengable(const void* p) { bool G1CollectedHeap::is_scavengable(const void* p) {

View file

@ -1379,10 +1379,6 @@ public:
inline bool is_in_young(const oop obj); inline bool is_in_young(const oop obj);
#ifdef ASSERT
virtual bool is_in_partial_collection(const void* p);
#endif
virtual bool is_scavengable(const void* addr); virtual bool is_scavengable(const void* addr);
// We don't need barriers for initializing stores to objects // We don't need barriers for initializing stores to objects

View file

@ -203,17 +203,6 @@ bool ParallelScavengeHeap::is_scavengable(const void* addr) {
return is_in_young((oop)addr); return is_in_young((oop)addr);
} }
#ifdef ASSERT
// Don't implement this by using is_in_young(). This method is used
// in some cases to check that is_in_young() is correct.
bool ParallelScavengeHeap::is_in_partial_collection(const void *p) {
assert(is_in_reserved(p) || p == NULL,
"Does not work if address is non-null and outside of the heap");
// The order of the generations is old (low addr), young (high addr)
return p >= old_gen()->reserved().end();
}
#endif
// There are two levels of allocation policy here. // There are two levels of allocation policy here.
// //
// When an allocation request fails, the requesting thread must invoke a VM // When an allocation request fails, the requesting thread must invoke a VM

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -141,10 +141,6 @@ class ParallelScavengeHeap : public CollectedHeap {
bool is_in_reserved(const void* p) const; bool is_in_reserved(const void* p) const;
#ifdef ASSERT
virtual bool is_in_partial_collection(const void *p);
#endif
bool is_in_young(oop p); // reserved part bool is_in_young(oop p); // reserved part
bool is_in_old(oop p); // reserved part bool is_in_old(oop p); // reserved part

View file

@ -291,12 +291,6 @@ class CollectedHeap : public CHeapObj<mtInternal> {
return p == NULL || is_in_closed_subset(p); return p == NULL || is_in_closed_subset(p);
} }
#ifdef ASSERT
// Returns true if "p" is in the part of the
// heap being collected.
virtual bool is_in_partial_collection(const void *p) = 0;
#endif
// An object is scavengable if its location may move during a scavenge. // An object is scavengable if its location may move during a scavenge.
// (A scavenge is a GC which is not a full GC.) // (A scavenge is a GC which is not a full GC.)
virtual bool is_scavengable(const void *p) = 0; virtual bool is_scavengable(const void *p) = 0;

View file

@ -572,7 +572,7 @@ void GenCollectedHeap::set_n_termination(uint t) {
class AssertNonScavengableClosure: public OopClosure { class AssertNonScavengableClosure: public OopClosure {
public: public:
virtual void do_oop(oop* p) { virtual void do_oop(oop* p) {
assert(!Universe::heap()->is_in_partial_collection(*p), assert(!GenCollectedHeap::heap()->is_in_partial_collection(*p),
"Referent should not be scavengable."); } "Referent should not be scavengable."); }
virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); } virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
}; };

View file

@ -215,7 +215,7 @@ public:
bool is_in_young(oop p); bool is_in_young(oop p);
#ifdef ASSERT #ifdef ASSERT
virtual bool is_in_partial_collection(const void* p); bool is_in_partial_collection(const void* p);
#endif #endif
virtual bool is_scavengable(const void* addr) { virtual bool is_scavengable(const void* addr) {