mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 01:24:33 +02:00
8252245: Remove ScanClosure
Reviewed-by: pliden, sjohanss
This commit is contained in:
parent
26b48999df
commit
f0acabc64b
6 changed files with 4 additions and 59 deletions
|
@ -105,12 +105,6 @@ void DefNewGeneration::FastEvacuateFollowersClosure::do_void() {
|
|||
guarantee(_heap->young_gen()->promo_failure_scan_is_complete(), "Failed to finish scan");
|
||||
}
|
||||
|
||||
ScanClosure::ScanClosure(DefNewGeneration* g, bool gc_barrier) :
|
||||
OopsInClassLoaderDataOrGenClosure(g), _g(g), _gc_barrier(gc_barrier)
|
||||
{
|
||||
_boundary = _g->reserved().end();
|
||||
}
|
||||
|
||||
FastScanClosure::FastScanClosure(DefNewGeneration* g, bool gc_barrier) :
|
||||
OopsInClassLoaderDataOrGenClosure(g), _g(g), _gc_barrier(gc_barrier)
|
||||
{
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "utilities/stack.hpp"
|
||||
|
||||
class ContiguousSpace;
|
||||
class ScanClosure;
|
||||
class STWGCTimer;
|
||||
class CSpaceCounters;
|
||||
class ScanWeakRefClosure;
|
||||
|
|
|
@ -102,27 +102,10 @@ class OopsInClassLoaderDataOrGenClosure: public BasicOopsInGenClosure {
|
|||
|
||||
#if INCLUDE_SERIALGC
|
||||
|
||||
// Closure for scanning DefNewGeneration.
|
||||
//
|
||||
// This closure will perform barrier store calls for ALL
|
||||
// pointers in scanned oops.
|
||||
class ScanClosure: public OopsInClassLoaderDataOrGenClosure {
|
||||
private:
|
||||
DefNewGeneration* _g;
|
||||
HeapWord* _boundary;
|
||||
bool _gc_barrier;
|
||||
template <class T> inline void do_oop_work(T* p);
|
||||
public:
|
||||
ScanClosure(DefNewGeneration* g, bool gc_barrier);
|
||||
virtual void do_oop(oop* p);
|
||||
virtual void do_oop(narrowOop* p);
|
||||
};
|
||||
|
||||
// Closure for scanning DefNewGeneration.
|
||||
//
|
||||
// This closure only performs barrier store calls on
|
||||
// pointers into the DefNewGeneration. This is less
|
||||
// precise, but faster, than a ScanClosure
|
||||
// pointers into the DefNewGeneration.
|
||||
class FastScanClosure: public OopsInClassLoaderDataOrGenClosure {
|
||||
protected:
|
||||
DefNewGeneration* _g;
|
||||
|
@ -168,9 +151,8 @@ class FilteringClosure: public OopIterateClosure {
|
|||
#if INCLUDE_SERIALGC
|
||||
|
||||
// Closure for scanning DefNewGeneration's weak references.
|
||||
// NOTE: very much like ScanClosure but not derived from
|
||||
// OopsInGenClosure -- weak references are processed all
|
||||
// at once, with no notion of which generation they were in.
|
||||
// -- weak references are processed all at once,
|
||||
// with no notion of which generation they were in.
|
||||
class ScanWeakRefClosure: public OopClosure {
|
||||
protected:
|
||||
DefNewGeneration* _g;
|
||||
|
|
|
@ -74,34 +74,6 @@ inline void OopsInClassLoaderDataOrGenClosure::do_cld_barrier() {
|
|||
|
||||
#if INCLUDE_SERIALGC
|
||||
|
||||
// NOTE! Any changes made here should also be made
|
||||
// in FastScanClosure::do_oop_work()
|
||||
template <class T> inline void ScanClosure::do_oop_work(T* p) {
|
||||
T heap_oop = RawAccess<>::oop_load(p);
|
||||
// Should we copy the obj?
|
||||
if (!CompressedOops::is_null(heap_oop)) {
|
||||
oop obj = CompressedOops::decode_not_null(heap_oop);
|
||||
if (cast_from_oop<HeapWord*>(obj) < _boundary) {
|
||||
assert(!_g->to()->is_in_reserved(obj), "Scanning field twice?");
|
||||
oop new_obj = obj->is_forwarded() ? obj->forwardee()
|
||||
: _g->copy_to_survivor_space(obj);
|
||||
RawAccess<IS_NOT_NULL>::oop_store(p, new_obj);
|
||||
}
|
||||
|
||||
if (is_scanning_a_cld()) {
|
||||
do_cld_barrier();
|
||||
} else if (_gc_barrier) {
|
||||
// Now call parent closure
|
||||
do_barrier(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline void ScanClosure::do_oop(oop* p) { ScanClosure::do_oop_work(p); }
|
||||
inline void ScanClosure::do_oop(narrowOop* p) { ScanClosure::do_oop_work(p); }
|
||||
|
||||
// NOTE! Any changes made here should also be made
|
||||
// in ScanClosure::do_oop_work()
|
||||
template <class T> inline void FastScanClosure::do_oop_work(T* p) {
|
||||
T heap_oop = RawAccess<>::oop_load(p);
|
||||
// Should we copy the obj?
|
||||
|
@ -142,7 +114,7 @@ inline void FilteringClosure::do_oop(narrowOop* p) { FilteringClosure::do_oop_wo
|
|||
|
||||
#if INCLUDE_SERIALGC
|
||||
|
||||
// Note similarity to ScanClosure; the difference is that
|
||||
// Note similarity to FastScanClosure; the difference is that
|
||||
// the barrier set is taken care of outside this closure.
|
||||
template <class T> inline void ScanWeakRefClosure::do_oop_work(T* p) {
|
||||
oop obj = RawAccess<IS_NOT_NULL>::oop_load(p);
|
||||
|
|
|
@ -57,7 +57,6 @@ class ContiguousSpace;
|
|||
class CompactPoint;
|
||||
class OopsInGenClosure;
|
||||
class OopClosure;
|
||||
class ScanClosure;
|
||||
class FastScanClosure;
|
||||
class GenCollectedHeap;
|
||||
class GCStats;
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
|
||||
// Forward declarations.
|
||||
class OopClosure;
|
||||
class ScanClosure;
|
||||
class FastScanClosure;
|
||||
class FilteringClosure;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue