Merge
This commit is contained in:
commit
99653fda01
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2016, 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
|
||||||
@ -43,7 +43,7 @@
|
|||||||
SurrogateLockerThread*
|
SurrogateLockerThread*
|
||||||
ConcurrentMarkThread::_slt = NULL;
|
ConcurrentMarkThread::_slt = NULL;
|
||||||
|
|
||||||
ConcurrentMarkThread::ConcurrentMarkThread(ConcurrentMark* cm) :
|
ConcurrentMarkThread::ConcurrentMarkThread(G1ConcurrentMark* cm) :
|
||||||
ConcurrentGCThread(),
|
ConcurrentGCThread(),
|
||||||
_cm(cm),
|
_cm(cm),
|
||||||
_state(Idle),
|
_state(Idle),
|
||||||
@ -56,10 +56,10 @@ ConcurrentMarkThread::ConcurrentMarkThread(ConcurrentMark* cm) :
|
|||||||
|
|
||||||
class CMCheckpointRootsFinalClosure: public VoidClosure {
|
class CMCheckpointRootsFinalClosure: public VoidClosure {
|
||||||
|
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CMCheckpointRootsFinalClosure(ConcurrentMark* cm) :
|
CMCheckpointRootsFinalClosure(G1ConcurrentMark* cm) :
|
||||||
_cm(cm) {}
|
_cm(cm) {}
|
||||||
|
|
||||||
void do_void(){
|
void do_void(){
|
||||||
@ -68,10 +68,10 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
class CMCleanUp: public VoidClosure {
|
class CMCleanUp: public VoidClosure {
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CMCleanUp(ConcurrentMark* cm) :
|
CMCleanUp(G1ConcurrentMark* cm) :
|
||||||
_cm(cm) {}
|
_cm(cm) {}
|
||||||
|
|
||||||
void do_void(){
|
void do_void(){
|
||||||
@ -92,10 +92,10 @@ void ConcurrentMarkThread::delay_to_keep_mmu(G1CollectorPolicy* g1_policy, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
class GCConcPhaseTimer : StackObj {
|
class GCConcPhaseTimer : StackObj {
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GCConcPhaseTimer(ConcurrentMark* cm, const char* title) : _cm(cm) {
|
GCConcPhaseTimer(G1ConcurrentMark* cm, const char* title) : _cm(cm) {
|
||||||
_cm->register_concurrent_phase_start(title);
|
_cm->register_concurrent_phase_start(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2016, 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
|
||||||
@ -27,10 +27,10 @@
|
|||||||
|
|
||||||
#include "gc/shared/concurrentGCThread.hpp"
|
#include "gc/shared/concurrentGCThread.hpp"
|
||||||
|
|
||||||
// The Concurrent Mark GC Thread triggers the parallel CMConcurrentMarkingTasks
|
// The Concurrent Mark GC Thread triggers the parallel G1CMConcurrentMarkingTasks
|
||||||
// as well as handling various marking cleanup.
|
// as well as handling various marking cleanup.
|
||||||
|
|
||||||
class ConcurrentMark;
|
class G1ConcurrentMark;
|
||||||
class G1CollectorPolicy;
|
class G1CollectorPolicy;
|
||||||
|
|
||||||
class ConcurrentMarkThread: public ConcurrentGCThread {
|
class ConcurrentMarkThread: public ConcurrentGCThread {
|
||||||
@ -45,7 +45,7 @@ class ConcurrentMarkThread: public ConcurrentGCThread {
|
|||||||
virtual void run();
|
virtual void run();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
Idle,
|
Idle,
|
||||||
@ -65,7 +65,7 @@ class ConcurrentMarkThread: public ConcurrentGCThread {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
ConcurrentMarkThread(ConcurrentMark* cm);
|
ConcurrentMarkThread(G1ConcurrentMark* cm);
|
||||||
|
|
||||||
static void makeSurrogateLockerThread(TRAPS);
|
static void makeSurrogateLockerThread(TRAPS);
|
||||||
static SurrogateLockerThread* slt() { return _slt; }
|
static SurrogateLockerThread* slt() { return _slt; }
|
||||||
@ -75,7 +75,7 @@ class ConcurrentMarkThread: public ConcurrentGCThread {
|
|||||||
// Marking virtual time so far this thread and concurrent marking tasks.
|
// Marking virtual time so far this thread and concurrent marking tasks.
|
||||||
double vtime_mark_accum();
|
double vtime_mark_accum();
|
||||||
|
|
||||||
ConcurrentMark* cm() { return _cm; }
|
G1ConcurrentMark* cm() { return _cm; }
|
||||||
|
|
||||||
void set_idle() { assert(_state != Started, "must not be starting a new cycle"); _state = Idle; }
|
void set_idle() { assert(_state != Started, "must not be starting a new cycle"); _state = Idle; }
|
||||||
bool idle() { return _state == Idle; }
|
bool idle() { return _state == Idle; }
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
#ifndef SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_INLINE_HPP
|
#ifndef SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_INLINE_HPP
|
||||||
#define SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_INLINE_HPP
|
#define SHARE_VM_GC_G1_CONCURRENTMARKTHREAD_INLINE_HPP
|
||||||
|
|
||||||
#include "gc/g1/concurrentMark.hpp"
|
|
||||||
#include "gc/g1/concurrentMarkThread.hpp"
|
#include "gc/g1/concurrentMarkThread.hpp"
|
||||||
|
#include "gc/g1/g1ConcurrentMark.hpp"
|
||||||
|
|
||||||
// Total virtual time so far.
|
// Total virtual time so far.
|
||||||
inline double ConcurrentMarkThread::vtime_accum() {
|
inline double ConcurrentMarkThread::vtime_accum() {
|
||||||
|
@ -1417,13 +1417,13 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc,
|
|||||||
|
|
||||||
// Clear the previous marking bitmap, if needed for bitmap verification.
|
// Clear the previous marking bitmap, if needed for bitmap verification.
|
||||||
// Note we cannot do this when we clear the next marking bitmap in
|
// Note we cannot do this when we clear the next marking bitmap in
|
||||||
// ConcurrentMark::abort() above since VerifyDuringGC verifies the
|
// G1ConcurrentMark::abort() above since VerifyDuringGC verifies the
|
||||||
// objects marked during a full GC against the previous bitmap.
|
// objects marked during a full GC against the previous bitmap.
|
||||||
// But we need to clear it before calling check_bitmaps below since
|
// But we need to clear it before calling check_bitmaps below since
|
||||||
// the full GC has compacted objects and updated TAMS but not updated
|
// the full GC has compacted objects and updated TAMS but not updated
|
||||||
// the prev bitmap.
|
// the prev bitmap.
|
||||||
if (G1VerifyBitmaps) {
|
if (G1VerifyBitmaps) {
|
||||||
((CMBitMap*) concurrent_mark()->prevMarkBitMap())->clearAll();
|
((G1CMBitMap*) concurrent_mark()->prevMarkBitMap())->clearAll();
|
||||||
}
|
}
|
||||||
_verifier->check_bitmaps("Full GC End");
|
_verifier->check_bitmaps("Full GC End");
|
||||||
|
|
||||||
@ -1924,11 +1924,11 @@ jint G1CollectedHeap::initialize() {
|
|||||||
G1CardCounts::compute_size(g1_rs.size() / HeapWordSize),
|
G1CardCounts::compute_size(g1_rs.size() / HeapWordSize),
|
||||||
G1CardCounts::heap_map_factor());
|
G1CardCounts::heap_map_factor());
|
||||||
|
|
||||||
size_t bitmap_size = CMBitMap::compute_size(g1_rs.size());
|
size_t bitmap_size = G1CMBitMap::compute_size(g1_rs.size());
|
||||||
G1RegionToSpaceMapper* prev_bitmap_storage =
|
G1RegionToSpaceMapper* prev_bitmap_storage =
|
||||||
create_aux_memory_mapper("Prev Bitmap", bitmap_size, CMBitMap::heap_map_factor());
|
create_aux_memory_mapper("Prev Bitmap", bitmap_size, G1CMBitMap::heap_map_factor());
|
||||||
G1RegionToSpaceMapper* next_bitmap_storage =
|
G1RegionToSpaceMapper* next_bitmap_storage =
|
||||||
create_aux_memory_mapper("Next Bitmap", bitmap_size, CMBitMap::heap_map_factor());
|
create_aux_memory_mapper("Next Bitmap", bitmap_size, G1CMBitMap::heap_map_factor());
|
||||||
|
|
||||||
_hrm.initialize(heap_storage, prev_bitmap_storage, next_bitmap_storage, bot_storage, cardtable_storage, card_counts_storage);
|
_hrm.initialize(heap_storage, prev_bitmap_storage, next_bitmap_storage, bot_storage, cardtable_storage, card_counts_storage);
|
||||||
g1_barrier_set()->initialize(cardtable_storage);
|
g1_barrier_set()->initialize(cardtable_storage);
|
||||||
@ -1960,11 +1960,11 @@ jint G1CollectedHeap::initialize() {
|
|||||||
_humongous_reclaim_candidates.initialize(start, end, granularity);
|
_humongous_reclaim_candidates.initialize(start, end, granularity);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the ConcurrentMark data structure and thread.
|
// Create the G1ConcurrentMark data structure and thread.
|
||||||
// (Must do this late, so that "max_regions" is defined.)
|
// (Must do this late, so that "max_regions" is defined.)
|
||||||
_cm = new ConcurrentMark(this, prev_bitmap_storage, next_bitmap_storage);
|
_cm = new G1ConcurrentMark(this, prev_bitmap_storage, next_bitmap_storage);
|
||||||
if (_cm == NULL || !_cm->completed_initialization()) {
|
if (_cm == NULL || !_cm->completed_initialization()) {
|
||||||
vm_shutdown_during_initialization("Could not create/initialize ConcurrentMark");
|
vm_shutdown_during_initialization("Could not create/initialize G1ConcurrentMark");
|
||||||
return JNI_ENOMEM;
|
return JNI_ENOMEM;
|
||||||
}
|
}
|
||||||
_cmThread = _cm->cmThread();
|
_cmThread = _cm->cmThread();
|
||||||
@ -4992,7 +4992,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure {
|
|||||||
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
G1CollectedHeap* g1h = G1CollectedHeap::heap();
|
||||||
|
|
||||||
oop obj = (oop)r->bottom();
|
oop obj = (oop)r->bottom();
|
||||||
CMBitMap* next_bitmap = g1h->concurrent_mark()->nextMarkBitMap();
|
G1CMBitMap* next_bitmap = g1h->concurrent_mark()->nextMarkBitMap();
|
||||||
|
|
||||||
// The following checks whether the humongous object is live are sufficient.
|
// The following checks whether the humongous object is live are sufficient.
|
||||||
// The main additional check (in addition to having a reference from the roots
|
// The main additional check (in addition to having a reference from the roots
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2016, 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
|
||||||
@ -25,11 +25,11 @@
|
|||||||
#ifndef SHARE_VM_GC_G1_G1COLLECTEDHEAP_HPP
|
#ifndef SHARE_VM_GC_G1_G1COLLECTEDHEAP_HPP
|
||||||
#define SHARE_VM_GC_G1_G1COLLECTEDHEAP_HPP
|
#define SHARE_VM_GC_G1_G1COLLECTEDHEAP_HPP
|
||||||
|
|
||||||
#include "gc/g1/concurrentMark.hpp"
|
|
||||||
#include "gc/g1/evacuationInfo.hpp"
|
#include "gc/g1/evacuationInfo.hpp"
|
||||||
#include "gc/g1/g1AllocationContext.hpp"
|
#include "gc/g1/g1AllocationContext.hpp"
|
||||||
#include "gc/g1/g1BiasedArray.hpp"
|
#include "gc/g1/g1BiasedArray.hpp"
|
||||||
#include "gc/g1/g1CollectorState.hpp"
|
#include "gc/g1/g1CollectorState.hpp"
|
||||||
|
#include "gc/g1/g1ConcurrentMark.hpp"
|
||||||
#include "gc/g1/g1HRPrinter.hpp"
|
#include "gc/g1/g1HRPrinter.hpp"
|
||||||
#include "gc/g1/g1InCSetState.hpp"
|
#include "gc/g1/g1InCSetState.hpp"
|
||||||
#include "gc/g1/g1MonitoringSupport.hpp"
|
#include "gc/g1/g1MonitoringSupport.hpp"
|
||||||
@ -68,7 +68,7 @@ class Space;
|
|||||||
class G1CollectorPolicy;
|
class G1CollectorPolicy;
|
||||||
class G1RemSet;
|
class G1RemSet;
|
||||||
class HeapRegionRemSetIterator;
|
class HeapRegionRemSetIterator;
|
||||||
class ConcurrentMark;
|
class G1ConcurrentMark;
|
||||||
class ConcurrentMarkThread;
|
class ConcurrentMarkThread;
|
||||||
class ConcurrentG1Refine;
|
class ConcurrentG1Refine;
|
||||||
class ConcurrentGCTimer;
|
class ConcurrentGCTimer;
|
||||||
@ -771,7 +771,7 @@ protected:
|
|||||||
void abandon_collection_set(HeapRegion* cs_head);
|
void abandon_collection_set(HeapRegion* cs_head);
|
||||||
|
|
||||||
// The concurrent marker (and the thread it runs in.)
|
// The concurrent marker (and the thread it runs in.)
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
ConcurrentMarkThread* _cmThread;
|
ConcurrentMarkThread* _cmThread;
|
||||||
|
|
||||||
// The concurrent refiner.
|
// The concurrent refiner.
|
||||||
@ -1380,7 +1380,7 @@ public:
|
|||||||
|
|
||||||
inline bool is_obj_ill(const oop obj) const;
|
inline bool is_obj_ill(const oop obj) const;
|
||||||
|
|
||||||
ConcurrentMark* concurrent_mark() const { return _cm; }
|
G1ConcurrentMark* concurrent_mark() const { return _cm; }
|
||||||
|
|
||||||
// Refinement
|
// Refinement
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2016, 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
|
||||||
@ -25,10 +25,10 @@
|
|||||||
#ifndef SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
|
#ifndef SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
|
||||||
#define SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
|
#define SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
|
||||||
|
|
||||||
#include "gc/g1/concurrentMark.hpp"
|
|
||||||
#include "gc/g1/g1CollectedHeap.hpp"
|
#include "gc/g1/g1CollectedHeap.hpp"
|
||||||
#include "gc/g1/g1CollectorPolicy.hpp"
|
#include "gc/g1/g1CollectorPolicy.hpp"
|
||||||
#include "gc/g1/g1CollectorState.hpp"
|
#include "gc/g1/g1CollectorState.hpp"
|
||||||
|
#include "gc/g1/g1ConcurrentMark.hpp"
|
||||||
#include "gc/g1/g1SATBCardTableModRefBS.hpp"
|
#include "gc/g1/g1SATBCardTableModRefBS.hpp"
|
||||||
#include "gc/g1/heapRegionManager.inline.hpp"
|
#include "gc/g1/heapRegionManager.inline.hpp"
|
||||||
#include "gc/g1/heapRegionSet.inline.hpp"
|
#include "gc/g1/heapRegionSet.inline.hpp"
|
||||||
|
@ -24,10 +24,10 @@
|
|||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "gc/g1/concurrentG1Refine.hpp"
|
#include "gc/g1/concurrentG1Refine.hpp"
|
||||||
#include "gc/g1/concurrentMark.hpp"
|
|
||||||
#include "gc/g1/concurrentMarkThread.inline.hpp"
|
#include "gc/g1/concurrentMarkThread.inline.hpp"
|
||||||
#include "gc/g1/g1CollectedHeap.inline.hpp"
|
#include "gc/g1/g1CollectedHeap.inline.hpp"
|
||||||
#include "gc/g1/g1CollectorPolicy.hpp"
|
#include "gc/g1/g1CollectorPolicy.hpp"
|
||||||
|
#include "gc/g1/g1ConcurrentMark.hpp"
|
||||||
#include "gc/g1/g1IHOPControl.hpp"
|
#include "gc/g1/g1IHOPControl.hpp"
|
||||||
#include "gc/g1/g1GCPhaseTimes.hpp"
|
#include "gc/g1/g1GCPhaseTimes.hpp"
|
||||||
#include "gc/g1/heapRegion.inline.hpp"
|
#include "gc/g1/heapRegion.inline.hpp"
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -22,8 +22,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SHARE_VM_GC_G1_CONCURRENTMARK_HPP
|
#ifndef SHARE_VM_GC_G1_G1CONCURRENTMARK_HPP
|
||||||
#define SHARE_VM_GC_G1_CONCURRENTMARK_HPP
|
#define SHARE_VM_GC_G1_G1CONCURRENTMARK_HPP
|
||||||
|
|
||||||
#include "classfile/javaClasses.hpp"
|
#include "classfile/javaClasses.hpp"
|
||||||
#include "gc/g1/g1RegionToSpaceMapper.hpp"
|
#include "gc/g1/g1RegionToSpaceMapper.hpp"
|
||||||
@ -31,11 +31,11 @@
|
|||||||
#include "gc/shared/taskqueue.hpp"
|
#include "gc/shared/taskqueue.hpp"
|
||||||
|
|
||||||
class G1CollectedHeap;
|
class G1CollectedHeap;
|
||||||
class CMBitMap;
|
class G1CMBitMap;
|
||||||
class CMTask;
|
class G1CMTask;
|
||||||
class ConcurrentMark;
|
class G1ConcurrentMark;
|
||||||
typedef GenericTaskQueue<oop, mtGC> CMTaskQueue;
|
typedef GenericTaskQueue<oop, mtGC> G1CMTaskQueue;
|
||||||
typedef GenericTaskQueueSet<CMTaskQueue, mtGC> CMTaskQueueSet;
|
typedef GenericTaskQueueSet<G1CMTaskQueue, mtGC> G1CMTaskQueueSet;
|
||||||
|
|
||||||
// Closure used by CM during concurrent reference discovery
|
// Closure used by CM during concurrent reference discovery
|
||||||
// and reference processing (during remarking) to determine
|
// and reference processing (during remarking) to determine
|
||||||
@ -54,7 +54,7 @@ class G1CMIsAliveClosure: public BoolObjectClosure {
|
|||||||
// A generic CM bit map. This is essentially a wrapper around the BitMap
|
// A generic CM bit map. This is essentially a wrapper around the BitMap
|
||||||
// class, with one bit per (1<<_shifter) HeapWords.
|
// class, with one bit per (1<<_shifter) HeapWords.
|
||||||
|
|
||||||
class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
|
class G1CMBitMapRO VALUE_OBJ_CLASS_SPEC {
|
||||||
protected:
|
protected:
|
||||||
HeapWord* _bmStartWord; // base address of range covered by map
|
HeapWord* _bmStartWord; // base address of range covered by map
|
||||||
size_t _bmWordSize; // map size (in #HeapWords covered)
|
size_t _bmWordSize; // map size (in #HeapWords covered)
|
||||||
@ -63,7 +63,7 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// constructor
|
// constructor
|
||||||
CMBitMapRO(int shifter);
|
G1CMBitMapRO(int shifter);
|
||||||
|
|
||||||
// inquiries
|
// inquiries
|
||||||
HeapWord* startWord() const { return _bmStartWord; }
|
HeapWord* startWord() const { return _bmStartWord; }
|
||||||
@ -104,20 +104,20 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
|
|||||||
NOT_PRODUCT(bool covers(MemRegion rs) const;)
|
NOT_PRODUCT(bool covers(MemRegion rs) const;)
|
||||||
};
|
};
|
||||||
|
|
||||||
class CMBitMapMappingChangedListener : public G1MappingChangedListener {
|
class G1CMBitMapMappingChangedListener : public G1MappingChangedListener {
|
||||||
private:
|
private:
|
||||||
CMBitMap* _bm;
|
G1CMBitMap* _bm;
|
||||||
public:
|
public:
|
||||||
CMBitMapMappingChangedListener() : _bm(NULL) {}
|
G1CMBitMapMappingChangedListener() : _bm(NULL) {}
|
||||||
|
|
||||||
void set_bitmap(CMBitMap* bm) { _bm = bm; }
|
void set_bitmap(G1CMBitMap* bm) { _bm = bm; }
|
||||||
|
|
||||||
virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled);
|
virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CMBitMap : public CMBitMapRO {
|
class G1CMBitMap : public G1CMBitMapRO {
|
||||||
private:
|
private:
|
||||||
CMBitMapMappingChangedListener _listener;
|
G1CMBitMapMappingChangedListener _listener;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static size_t compute_size(size_t heap_size);
|
static size_t compute_size(size_t heap_size);
|
||||||
@ -129,7 +129,7 @@ class CMBitMap : public CMBitMapRO {
|
|||||||
return mark_distance();
|
return mark_distance();
|
||||||
}
|
}
|
||||||
|
|
||||||
CMBitMap() : CMBitMapRO(LogMinObjAlignment), _listener() { _listener.set_bitmap(this); }
|
G1CMBitMap() : G1CMBitMapRO(LogMinObjAlignment), _listener() { _listener.set_bitmap(this); }
|
||||||
|
|
||||||
// Initializes the underlying BitMap to cover the given area.
|
// Initializes the underlying BitMap to cover the given area.
|
||||||
void initialize(MemRegion heap, G1RegionToSpaceMapper* storage);
|
void initialize(MemRegion heap, G1RegionToSpaceMapper* storage);
|
||||||
@ -146,9 +146,9 @@ class CMBitMap : public CMBitMapRO {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Represents a marking stack used by ConcurrentMarking in the G1 collector.
|
// Represents a marking stack used by ConcurrentMarking in the G1 collector.
|
||||||
class CMMarkStack VALUE_OBJ_CLASS_SPEC {
|
class G1CMMarkStack VALUE_OBJ_CLASS_SPEC {
|
||||||
VirtualSpace _virtual_space; // Underlying backing store for actual stack
|
VirtualSpace _virtual_space; // Underlying backing store for actual stack
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
oop* _base; // bottom of stack
|
oop* _base; // bottom of stack
|
||||||
jint _index; // one more than last occupied index
|
jint _index; // one more than last occupied index
|
||||||
jint _capacity; // max #elements
|
jint _capacity; // max #elements
|
||||||
@ -158,8 +158,8 @@ class CMMarkStack VALUE_OBJ_CLASS_SPEC {
|
|||||||
bool _should_expand;
|
bool _should_expand;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CMMarkStack(ConcurrentMark* cm);
|
G1CMMarkStack(G1ConcurrentMark* cm);
|
||||||
~CMMarkStack();
|
~G1CMMarkStack();
|
||||||
|
|
||||||
bool allocate(size_t capacity);
|
bool allocate(size_t capacity);
|
||||||
|
|
||||||
@ -220,19 +220,19 @@ class YoungList;
|
|||||||
// Currently, we only support root region scanning once (at the start
|
// Currently, we only support root region scanning once (at the start
|
||||||
// of the marking cycle) and the root regions are all the survivor
|
// of the marking cycle) and the root regions are all the survivor
|
||||||
// regions populated during the initial-mark pause.
|
// regions populated during the initial-mark pause.
|
||||||
class CMRootRegions VALUE_OBJ_CLASS_SPEC {
|
class G1CMRootRegions VALUE_OBJ_CLASS_SPEC {
|
||||||
private:
|
private:
|
||||||
YoungList* _young_list;
|
YoungList* _young_list;
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
|
|
||||||
volatile bool _scan_in_progress;
|
volatile bool _scan_in_progress;
|
||||||
volatile bool _should_abort;
|
volatile bool _should_abort;
|
||||||
HeapRegion* volatile _next_survivor;
|
HeapRegion* volatile _next_survivor;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CMRootRegions();
|
G1CMRootRegions();
|
||||||
// We actually do most of the initialization in this method.
|
// We actually do most of the initialization in this method.
|
||||||
void init(G1CollectedHeap* g1h, ConcurrentMark* cm);
|
void init(G1CollectedHeap* g1h, G1ConcurrentMark* cm);
|
||||||
|
|
||||||
// Reset the claiming / scanning of the root regions.
|
// Reset the claiming / scanning of the root regions.
|
||||||
void prepare_for_scan();
|
void prepare_for_scan();
|
||||||
@ -260,19 +260,19 @@ public:
|
|||||||
|
|
||||||
class ConcurrentMarkThread;
|
class ConcurrentMarkThread;
|
||||||
|
|
||||||
class ConcurrentMark: public CHeapObj<mtGC> {
|
class G1ConcurrentMark: public CHeapObj<mtGC> {
|
||||||
friend class CMMarkStack;
|
|
||||||
friend class ConcurrentMarkThread;
|
friend class ConcurrentMarkThread;
|
||||||
friend class CMTask;
|
|
||||||
friend class CMBitMapClosure;
|
|
||||||
friend class CMRemarkTask;
|
|
||||||
friend class CMConcurrentMarkingTask;
|
|
||||||
friend class G1ParNoteEndTask;
|
friend class G1ParNoteEndTask;
|
||||||
friend class CalcLiveObjectsClosure;
|
friend class CalcLiveObjectsClosure;
|
||||||
friend class G1CMRefProcTaskProxy;
|
friend class G1CMRefProcTaskProxy;
|
||||||
friend class G1CMRefProcTaskExecutor;
|
friend class G1CMRefProcTaskExecutor;
|
||||||
friend class G1CMKeepAliveAndDrainClosure;
|
friend class G1CMKeepAliveAndDrainClosure;
|
||||||
friend class G1CMDrainMarkingStackClosure;
|
friend class G1CMDrainMarkingStackClosure;
|
||||||
|
friend class G1CMBitMapClosure;
|
||||||
|
friend class G1CMConcurrentMarkingTask;
|
||||||
|
friend class G1CMMarkStack;
|
||||||
|
friend class G1CMRemarkTask;
|
||||||
|
friend class G1CMTask;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ConcurrentMarkThread* _cmThread; // The thread doing the work
|
ConcurrentMarkThread* _cmThread; // The thread doing the work
|
||||||
@ -290,10 +290,10 @@ protected:
|
|||||||
FreeRegionList _cleanup_list;
|
FreeRegionList _cleanup_list;
|
||||||
|
|
||||||
// Concurrent marking support structures
|
// Concurrent marking support structures
|
||||||
CMBitMap _markBitMap1;
|
G1CMBitMap _markBitMap1;
|
||||||
CMBitMap _markBitMap2;
|
G1CMBitMap _markBitMap2;
|
||||||
CMBitMapRO* _prevMarkBitMap; // Completed mark bitmap
|
G1CMBitMapRO* _prevMarkBitMap; // Completed mark bitmap
|
||||||
CMBitMap* _nextMarkBitMap; // Under-construction mark bitmap
|
G1CMBitMap* _nextMarkBitMap; // Under-construction mark bitmap
|
||||||
|
|
||||||
BitMap _region_bm;
|
BitMap _region_bm;
|
||||||
BitMap _card_bm;
|
BitMap _card_bm;
|
||||||
@ -303,10 +303,10 @@ protected:
|
|||||||
HeapWord* _heap_end;
|
HeapWord* _heap_end;
|
||||||
|
|
||||||
// Root region tracking and claiming
|
// Root region tracking and claiming
|
||||||
CMRootRegions _root_regions;
|
G1CMRootRegions _root_regions;
|
||||||
|
|
||||||
// For gray objects
|
// For gray objects
|
||||||
CMMarkStack _markStack; // Grey objects behind global finger
|
G1CMMarkStack _markStack; // Grey objects behind global finger
|
||||||
HeapWord* volatile _finger; // The global finger, region aligned,
|
HeapWord* volatile _finger; // The global finger, region aligned,
|
||||||
// always points to the end of the
|
// always points to the end of the
|
||||||
// last claimed region
|
// last claimed region
|
||||||
@ -314,8 +314,8 @@ protected:
|
|||||||
// Marking tasks
|
// Marking tasks
|
||||||
uint _max_worker_id;// Maximum worker id
|
uint _max_worker_id;// Maximum worker id
|
||||||
uint _active_tasks; // Task num currently active
|
uint _active_tasks; // Task num currently active
|
||||||
CMTask** _tasks; // Task queue array (max_worker_id len)
|
G1CMTask** _tasks; // Task queue array (max_worker_id len)
|
||||||
CMTaskQueueSet* _task_queues; // Task queue set
|
G1CMTaskQueueSet* _task_queues; // Task queue set
|
||||||
ParallelTaskTerminator _terminator; // For termination
|
ParallelTaskTerminator _terminator; // For termination
|
||||||
|
|
||||||
// Two sync barriers that are used to synchronize tasks when an
|
// Two sync barriers that are used to synchronize tasks when an
|
||||||
@ -430,21 +430,21 @@ protected:
|
|||||||
bool out_of_regions() { return _finger >= _heap_end; }
|
bool out_of_regions() { return _finger >= _heap_end; }
|
||||||
|
|
||||||
// Returns the task with the given id
|
// Returns the task with the given id
|
||||||
CMTask* task(int id) {
|
G1CMTask* task(int id) {
|
||||||
assert(0 <= id && id < (int) _active_tasks,
|
assert(0 <= id && id < (int) _active_tasks,
|
||||||
"task id not within active bounds");
|
"task id not within active bounds");
|
||||||
return _tasks[id];
|
return _tasks[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the task queue with the given id
|
// Returns the task queue with the given id
|
||||||
CMTaskQueue* task_queue(int id) {
|
G1CMTaskQueue* task_queue(int id) {
|
||||||
assert(0 <= id && id < (int) _active_tasks,
|
assert(0 <= id && id < (int) _active_tasks,
|
||||||
"task queue id not within active bounds");
|
"task queue id not within active bounds");
|
||||||
return (CMTaskQueue*) _task_queues->queue(id);
|
return (G1CMTaskQueue*) _task_queues->queue(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the task queue set
|
// Returns the task queue set
|
||||||
CMTaskQueueSet* task_queues() { return _task_queues; }
|
G1CMTaskQueueSet* task_queues() { return _task_queues; }
|
||||||
|
|
||||||
// Access / manipulation of the overflow flag which is set to
|
// Access / manipulation of the overflow flag which is set to
|
||||||
// indicate that the global stack has overflown
|
// indicate that the global stack has overflown
|
||||||
@ -502,7 +502,7 @@ public:
|
|||||||
bool mark_stack_overflow() { return _markStack.overflow(); }
|
bool mark_stack_overflow() { return _markStack.overflow(); }
|
||||||
bool mark_stack_empty() { return _markStack.isEmpty(); }
|
bool mark_stack_empty() { return _markStack.isEmpty(); }
|
||||||
|
|
||||||
CMRootRegions* root_regions() { return &_root_regions; }
|
G1CMRootRegions* root_regions() { return &_root_regions; }
|
||||||
|
|
||||||
bool concurrent_marking_in_progress() {
|
bool concurrent_marking_in_progress() {
|
||||||
return _concurrent_marking_in_progress;
|
return _concurrent_marking_in_progress;
|
||||||
@ -531,15 +531,15 @@ public:
|
|||||||
// Attempts to steal an object from the task queues of other tasks
|
// Attempts to steal an object from the task queues of other tasks
|
||||||
bool try_stealing(uint worker_id, int* hash_seed, oop& obj);
|
bool try_stealing(uint worker_id, int* hash_seed, oop& obj);
|
||||||
|
|
||||||
ConcurrentMark(G1CollectedHeap* g1h,
|
G1ConcurrentMark(G1CollectedHeap* g1h,
|
||||||
G1RegionToSpaceMapper* prev_bitmap_storage,
|
G1RegionToSpaceMapper* prev_bitmap_storage,
|
||||||
G1RegionToSpaceMapper* next_bitmap_storage);
|
G1RegionToSpaceMapper* next_bitmap_storage);
|
||||||
~ConcurrentMark();
|
~G1ConcurrentMark();
|
||||||
|
|
||||||
ConcurrentMarkThread* cmThread() { return _cmThread; }
|
ConcurrentMarkThread* cmThread() { return _cmThread; }
|
||||||
|
|
||||||
CMBitMapRO* prevMarkBitMap() const { return _prevMarkBitMap; }
|
G1CMBitMapRO* prevMarkBitMap() const { return _prevMarkBitMap; }
|
||||||
CMBitMap* nextMarkBitMap() const { return _nextMarkBitMap; }
|
G1CMBitMap* nextMarkBitMap() const { return _nextMarkBitMap; }
|
||||||
|
|
||||||
// Returns the number of GC threads to be used in a concurrent
|
// Returns the number of GC threads to be used in a concurrent
|
||||||
// phase based on the number of GC threads being used in a STW
|
// phase based on the number of GC threads being used in a STW
|
||||||
@ -728,7 +728,7 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// A class representing a marking task.
|
// A class representing a marking task.
|
||||||
class CMTask : public TerminatorTerminator {
|
class G1CMTask : public TerminatorTerminator {
|
||||||
private:
|
private:
|
||||||
enum PrivateConstants {
|
enum PrivateConstants {
|
||||||
// the regular clock call is called once the scanned words reaches
|
// the regular clock call is called once the scanned words reaches
|
||||||
@ -746,13 +746,13 @@ private:
|
|||||||
|
|
||||||
uint _worker_id;
|
uint _worker_id;
|
||||||
G1CollectedHeap* _g1h;
|
G1CollectedHeap* _g1h;
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
CMBitMap* _nextMarkBitMap;
|
G1CMBitMap* _nextMarkBitMap;
|
||||||
// the task queue of this task
|
// the task queue of this task
|
||||||
CMTaskQueue* _task_queue;
|
G1CMTaskQueue* _task_queue;
|
||||||
private:
|
private:
|
||||||
// the task queue set---needed for stealing
|
// the task queue set---needed for stealing
|
||||||
CMTaskQueueSet* _task_queues;
|
G1CMTaskQueueSet* _task_queues;
|
||||||
// indicates whether the task has been claimed---this is only for
|
// indicates whether the task has been claimed---this is only for
|
||||||
// debugging purposes
|
// debugging purposes
|
||||||
bool _claimed;
|
bool _claimed;
|
||||||
@ -869,7 +869,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
// It resets the task; it should be called right at the beginning of
|
// It resets the task; it should be called right at the beginning of
|
||||||
// a marking phase.
|
// a marking phase.
|
||||||
void reset(CMBitMap* _nextMarkBitMap);
|
void reset(G1CMBitMap* _nextMarkBitMap);
|
||||||
// it clears all the fields that correspond to a claimed region.
|
// it clears all the fields that correspond to a claimed region.
|
||||||
void clear_region_fields();
|
void clear_region_fields();
|
||||||
|
|
||||||
@ -956,12 +956,12 @@ public:
|
|||||||
_finger = new_finger;
|
_finger = new_finger;
|
||||||
}
|
}
|
||||||
|
|
||||||
CMTask(uint worker_id,
|
G1CMTask(uint worker_id,
|
||||||
ConcurrentMark *cm,
|
G1ConcurrentMark *cm,
|
||||||
size_t* marked_bytes,
|
size_t* marked_bytes,
|
||||||
BitMap* card_bm,
|
BitMap* card_bm,
|
||||||
CMTaskQueue* task_queue,
|
G1CMTaskQueue* task_queue,
|
||||||
CMTaskQueueSet* task_queues);
|
G1CMTaskQueueSet* task_queues);
|
||||||
|
|
||||||
// it prints statistics associated with this task
|
// it prints statistics associated with this task
|
||||||
void print_stats();
|
void print_stats();
|
||||||
@ -1021,4 +1021,4 @@ public:
|
|||||||
~G1PrintRegionLivenessInfoClosure();
|
~G1PrintRegionLivenessInfoClosure();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SHARE_VM_GC_G1_CONCURRENTMARK_HPP
|
#endif // SHARE_VM_GC_G1_G1CONCURRENTMARK_HPP
|
@ -22,19 +22,19 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SHARE_VM_GC_G1_CONCURRENTMARK_INLINE_HPP
|
#ifndef SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP
|
||||||
#define SHARE_VM_GC_G1_CONCURRENTMARK_INLINE_HPP
|
#define SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP
|
||||||
|
|
||||||
#include "gc/g1/concurrentMark.hpp"
|
|
||||||
#include "gc/g1/g1CollectedHeap.inline.hpp"
|
#include "gc/g1/g1CollectedHeap.inline.hpp"
|
||||||
|
#include "gc/g1/g1ConcurrentMark.hpp"
|
||||||
#include "gc/shared/taskqueue.inline.hpp"
|
#include "gc/shared/taskqueue.inline.hpp"
|
||||||
|
|
||||||
// Utility routine to set an exclusive range of cards on the given
|
// Utility routine to set an exclusive range of cards on the given
|
||||||
// card liveness bitmap
|
// card liveness bitmap
|
||||||
inline void ConcurrentMark::set_card_bitmap_range(BitMap* card_bm,
|
inline void G1ConcurrentMark::set_card_bitmap_range(BitMap* card_bm,
|
||||||
BitMap::idx_t start_idx,
|
BitMap::idx_t start_idx,
|
||||||
BitMap::idx_t end_idx,
|
BitMap::idx_t end_idx,
|
||||||
bool is_par) {
|
bool is_par) {
|
||||||
|
|
||||||
// Set the exclusive bit range [start_idx, end_idx).
|
// Set the exclusive bit range [start_idx, end_idx).
|
||||||
assert((end_idx - start_idx) > 0, "at least one card");
|
assert((end_idx - start_idx) > 0, "at least one card");
|
||||||
@ -67,7 +67,7 @@ inline void ConcurrentMark::set_card_bitmap_range(BitMap* card_bm,
|
|||||||
|
|
||||||
// Returns the index in the liveness accounting card bitmap
|
// Returns the index in the liveness accounting card bitmap
|
||||||
// for the given address
|
// for the given address
|
||||||
inline BitMap::idx_t ConcurrentMark::card_bitmap_index_for(HeapWord* addr) {
|
inline BitMap::idx_t G1ConcurrentMark::card_bitmap_index_for(HeapWord* addr) {
|
||||||
// Below, the term "card num" means the result of shifting an address
|
// Below, the term "card num" means the result of shifting an address
|
||||||
// by the card shift -- address 0 corresponds to card number 0. One
|
// by the card shift -- address 0 corresponds to card number 0. One
|
||||||
// must subtract the card num of the bottom of the heap to obtain a
|
// must subtract the card num of the bottom of the heap to obtain a
|
||||||
@ -78,9 +78,9 @@ inline BitMap::idx_t ConcurrentMark::card_bitmap_index_for(HeapWord* addr) {
|
|||||||
|
|
||||||
// Counts the given memory region in the given task/worker
|
// Counts the given memory region in the given task/worker
|
||||||
// counting data structures.
|
// counting data structures.
|
||||||
inline void ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr,
|
inline void G1ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr,
|
||||||
size_t* marked_bytes_array,
|
size_t* marked_bytes_array,
|
||||||
BitMap* task_card_bm) {
|
BitMap* task_card_bm) {
|
||||||
G1CollectedHeap* g1h = _g1h;
|
G1CollectedHeap* g1h = _g1h;
|
||||||
CardTableModRefBS* ct_bs = g1h->g1_barrier_set();
|
CardTableModRefBS* ct_bs = g1h->g1_barrier_set();
|
||||||
|
|
||||||
@ -115,11 +115,11 @@ inline void ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Counts the given object in the given task/worker counting data structures.
|
// Counts the given object in the given task/worker counting data structures.
|
||||||
inline void ConcurrentMark::count_object(oop obj,
|
inline void G1ConcurrentMark::count_object(oop obj,
|
||||||
HeapRegion* hr,
|
HeapRegion* hr,
|
||||||
size_t* marked_bytes_array,
|
size_t* marked_bytes_array,
|
||||||
BitMap* task_card_bm,
|
BitMap* task_card_bm,
|
||||||
size_t word_size) {
|
size_t word_size) {
|
||||||
assert(!hr->is_continues_humongous(), "Cannot enter count_object with continues humongous");
|
assert(!hr->is_continues_humongous(), "Cannot enter count_object with continues humongous");
|
||||||
if (!hr->is_starts_humongous()) {
|
if (!hr->is_starts_humongous()) {
|
||||||
MemRegion mr((HeapWord*)obj, word_size);
|
MemRegion mr((HeapWord*)obj, word_size);
|
||||||
@ -135,10 +135,10 @@ inline void ConcurrentMark::count_object(oop obj,
|
|||||||
|
|
||||||
// Attempts to mark the given object and, if successful, counts
|
// Attempts to mark the given object and, if successful, counts
|
||||||
// the object in the given task/worker counting structures.
|
// the object in the given task/worker counting structures.
|
||||||
inline bool ConcurrentMark::par_mark_and_count(oop obj,
|
inline bool G1ConcurrentMark::par_mark_and_count(oop obj,
|
||||||
HeapRegion* hr,
|
HeapRegion* hr,
|
||||||
size_t* marked_bytes_array,
|
size_t* marked_bytes_array,
|
||||||
BitMap* task_card_bm) {
|
BitMap* task_card_bm) {
|
||||||
if (_nextMarkBitMap->parMark((HeapWord*)obj)) {
|
if (_nextMarkBitMap->parMark((HeapWord*)obj)) {
|
||||||
// Update the task specific count data for the object.
|
// Update the task specific count data for the object.
|
||||||
count_object(obj, hr, marked_bytes_array, task_card_bm, obj->size());
|
count_object(obj, hr, marked_bytes_array, task_card_bm, obj->size());
|
||||||
@ -150,10 +150,10 @@ inline bool ConcurrentMark::par_mark_and_count(oop obj,
|
|||||||
// Attempts to mark the given object and, if successful, counts
|
// Attempts to mark the given object and, if successful, counts
|
||||||
// the object in the task/worker counting structures for the
|
// the object in the task/worker counting structures for the
|
||||||
// given worker id.
|
// given worker id.
|
||||||
inline bool ConcurrentMark::par_mark_and_count(oop obj,
|
inline bool G1ConcurrentMark::par_mark_and_count(oop obj,
|
||||||
size_t word_size,
|
size_t word_size,
|
||||||
HeapRegion* hr,
|
HeapRegion* hr,
|
||||||
uint worker_id) {
|
uint worker_id) {
|
||||||
if (_nextMarkBitMap->parMark((HeapWord*)obj)) {
|
if (_nextMarkBitMap->parMark((HeapWord*)obj)) {
|
||||||
size_t* marked_bytes_array = count_marked_bytes_array_for(worker_id);
|
size_t* marked_bytes_array = count_marked_bytes_array_for(worker_id);
|
||||||
BitMap* task_card_bm = count_card_bitmap_for(worker_id);
|
BitMap* task_card_bm = count_card_bitmap_for(worker_id);
|
||||||
@ -163,7 +163,7 @@ inline bool ConcurrentMark::par_mark_and_count(oop obj,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
|
inline bool G1CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
|
||||||
HeapWord* start_addr = MAX2(startWord(), mr.start());
|
HeapWord* start_addr = MAX2(startWord(), mr.start());
|
||||||
HeapWord* end_addr = MIN2(endWord(), mr.end());
|
HeapWord* end_addr = MIN2(endWord(), mr.end());
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ inline bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The argument addr should be the start address of a valid object
|
// The argument addr should be the start address of a valid object
|
||||||
HeapWord* CMBitMapRO::nextObject(HeapWord* addr) {
|
HeapWord* G1CMBitMapRO::nextObject(HeapWord* addr) {
|
||||||
oop obj = (oop) addr;
|
oop obj = (oop) addr;
|
||||||
HeapWord* res = addr + obj->size();
|
HeapWord* res = addr + obj->size();
|
||||||
assert(offsetToHeapWord(heapWordToOffset(res)) == res, "sanity");
|
assert(offsetToHeapWord(heapWordToOffset(res)) == res, "sanity");
|
||||||
@ -201,17 +201,17 @@ HeapWord* CMBitMapRO::nextObject(HeapWord* addr) {
|
|||||||
" corresponding to " PTR_FORMAT " (%u)", \
|
" corresponding to " PTR_FORMAT " (%u)", \
|
||||||
p2i(this), p2i(addr), G1CollectedHeap::heap()->addr_to_region(addr));
|
p2i(this), p2i(addr), G1CollectedHeap::heap()->addr_to_region(addr));
|
||||||
|
|
||||||
inline void CMBitMap::mark(HeapWord* addr) {
|
inline void G1CMBitMap::mark(HeapWord* addr) {
|
||||||
check_mark(addr);
|
check_mark(addr);
|
||||||
_bm.set_bit(heapWordToOffset(addr));
|
_bm.set_bit(heapWordToOffset(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CMBitMap::clear(HeapWord* addr) {
|
inline void G1CMBitMap::clear(HeapWord* addr) {
|
||||||
check_mark(addr);
|
check_mark(addr);
|
||||||
_bm.clear_bit(heapWordToOffset(addr));
|
_bm.clear_bit(heapWordToOffset(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool CMBitMap::parMark(HeapWord* addr) {
|
inline bool G1CMBitMap::parMark(HeapWord* addr) {
|
||||||
check_mark(addr);
|
check_mark(addr);
|
||||||
return _bm.par_set_bit(heapWordToOffset(addr));
|
return _bm.par_set_bit(heapWordToOffset(addr));
|
||||||
}
|
}
|
||||||
@ -219,7 +219,7 @@ inline bool CMBitMap::parMark(HeapWord* addr) {
|
|||||||
#undef check_mark
|
#undef check_mark
|
||||||
|
|
||||||
template<typename Fn>
|
template<typename Fn>
|
||||||
inline void CMMarkStack::iterate(Fn fn) {
|
inline void G1CMMarkStack::iterate(Fn fn) {
|
||||||
assert(_saved_index == _index, "saved index: %d index: %d", _saved_index, _index);
|
assert(_saved_index == _index, "saved index: %d index: %d", _saved_index, _index);
|
||||||
for (int i = 0; i < _index; ++i) {
|
for (int i = 0; i < _index; ++i) {
|
||||||
fn(_base[i]);
|
fn(_base[i]);
|
||||||
@ -227,9 +227,9 @@ inline void CMMarkStack::iterate(Fn fn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// It scans an object and visits its children.
|
// It scans an object and visits its children.
|
||||||
inline void CMTask::scan_object(oop obj) { process_grey_object<true>(obj); }
|
inline void G1CMTask::scan_object(oop obj) { process_grey_object<true>(obj); }
|
||||||
|
|
||||||
inline void CMTask::push(oop obj) {
|
inline void G1CMTask::push(oop obj) {
|
||||||
HeapWord* objAddr = (HeapWord*) obj;
|
HeapWord* objAddr = (HeapWord*) obj;
|
||||||
assert(_g1h->is_in_g1_reserved(objAddr), "invariant");
|
assert(_g1h->is_in_g1_reserved(objAddr), "invariant");
|
||||||
assert(!_g1h->is_on_master_free_list(
|
assert(!_g1h->is_on_master_free_list(
|
||||||
@ -250,7 +250,7 @@ inline void CMTask::push(oop obj) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool CMTask::is_below_finger(oop obj, HeapWord* global_finger) const {
|
inline bool G1CMTask::is_below_finger(oop obj, HeapWord* global_finger) const {
|
||||||
// If obj is above the global finger, then the mark bitmap scan
|
// If obj is above the global finger, then the mark bitmap scan
|
||||||
// will find it later, and no push is needed. Similarly, if we have
|
// will find it later, and no push is needed. Similarly, if we have
|
||||||
// a current region and obj is between the local finger and the
|
// a current region and obj is between the local finger and the
|
||||||
@ -281,7 +281,7 @@ inline bool CMTask::is_below_finger(oop obj, HeapWord* global_finger) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<bool scan>
|
template<bool scan>
|
||||||
inline void CMTask::process_grey_object(oop obj) {
|
inline void G1CMTask::process_grey_object(oop obj) {
|
||||||
assert(scan || obj->is_typeArray(), "Skipping scan of grey non-typeArray");
|
assert(scan || obj->is_typeArray(), "Skipping scan of grey non-typeArray");
|
||||||
assert(_nextMarkBitMap->isMarked((HeapWord*) obj), "invariant");
|
assert(_nextMarkBitMap->isMarked((HeapWord*) obj), "invariant");
|
||||||
|
|
||||||
@ -296,10 +296,10 @@ inline void CMTask::process_grey_object(oop obj) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
inline void CMTask::make_reference_grey(oop obj, HeapRegion* hr) {
|
inline void G1CMTask::make_reference_grey(oop obj, HeapRegion* hr) {
|
||||||
if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) {
|
if (_cm->par_mark_and_count(obj, hr, _marked_bytes_array, _card_bm)) {
|
||||||
// No OrderAccess:store_load() is needed. It is implicit in the
|
// No OrderAccess:store_load() is needed. It is implicit in the
|
||||||
// CAS done in CMBitMap::parMark() call in the routine above.
|
// CAS done in G1CMBitMap::parMark() call in the routine above.
|
||||||
HeapWord* global_finger = _cm->finger();
|
HeapWord* global_finger = _cm->finger();
|
||||||
|
|
||||||
// We only need to push a newly grey object on the mark
|
// We only need to push a newly grey object on the mark
|
||||||
@ -335,7 +335,7 @@ inline void CMTask::make_reference_grey(oop obj, HeapRegion* hr) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CMTask::deal_with_reference(oop obj) {
|
inline void G1CMTask::deal_with_reference(oop obj) {
|
||||||
increment_refs_reached();
|
increment_refs_reached();
|
||||||
|
|
||||||
HeapWord* objAddr = (HeapWord*) obj;
|
HeapWord* objAddr = (HeapWord*) obj;
|
||||||
@ -354,14 +354,14 @@ inline void CMTask::deal_with_reference(oop obj) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void ConcurrentMark::markPrev(oop p) {
|
inline void G1ConcurrentMark::markPrev(oop p) {
|
||||||
assert(!_prevMarkBitMap->isMarked((HeapWord*) p), "sanity");
|
assert(!_prevMarkBitMap->isMarked((HeapWord*) p), "sanity");
|
||||||
// Note we are overriding the read-only view of the prev map here, via
|
// Note we are overriding the read-only view of the prev map here, via
|
||||||
// the cast.
|
// the cast.
|
||||||
((CMBitMap*)_prevMarkBitMap)->mark((HeapWord*) p);
|
((G1CMBitMap*)_prevMarkBitMap)->mark((HeapWord*) p);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConcurrentMark::isPrevMarked(oop p) const {
|
bool G1ConcurrentMark::isPrevMarked(oop p) const {
|
||||||
assert(p != NULL && p->is_oop(), "expected an oop");
|
assert(p != NULL && p->is_oop(), "expected an oop");
|
||||||
HeapWord* addr = (HeapWord*)p;
|
HeapWord* addr = (HeapWord*)p;
|
||||||
assert(addr >= _prevMarkBitMap->startWord() ||
|
assert(addr >= _prevMarkBitMap->startWord() ||
|
||||||
@ -370,8 +370,8 @@ bool ConcurrentMark::isPrevMarked(oop p) const {
|
|||||||
return _prevMarkBitMap->isMarked(addr);
|
return _prevMarkBitMap->isMarked(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void ConcurrentMark::grayRoot(oop obj, size_t word_size,
|
inline void G1ConcurrentMark::grayRoot(oop obj, size_t word_size,
|
||||||
uint worker_id, HeapRegion* hr) {
|
uint worker_id, HeapRegion* hr) {
|
||||||
assert(obj != NULL, "pre-condition");
|
assert(obj != NULL, "pre-condition");
|
||||||
HeapWord* addr = (HeapWord*) obj;
|
HeapWord* addr = (HeapWord*) obj;
|
||||||
if (hr == NULL) {
|
if (hr == NULL) {
|
||||||
@ -391,4 +391,4 @@ inline void ConcurrentMark::grayRoot(oop obj, size_t word_size,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // SHARE_VM_GC_G1_CONCURRENTMARK_INLINE_HPP
|
#endif // SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2012, 2016, 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
|
||||||
@ -23,10 +23,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precompiled.hpp"
|
#include "precompiled.hpp"
|
||||||
#include "gc/g1/concurrentMark.inline.hpp"
|
|
||||||
#include "gc/g1/dirtyCardQueue.hpp"
|
#include "gc/g1/dirtyCardQueue.hpp"
|
||||||
#include "gc/g1/g1CollectedHeap.inline.hpp"
|
#include "gc/g1/g1CollectedHeap.inline.hpp"
|
||||||
#include "gc/g1/g1CollectorState.hpp"
|
#include "gc/g1/g1CollectorState.hpp"
|
||||||
|
#include "gc/g1/g1ConcurrentMark.inline.hpp"
|
||||||
#include "gc/g1/g1EvacFailure.hpp"
|
#include "gc/g1/g1EvacFailure.hpp"
|
||||||
#include "gc/g1/g1HeapVerifier.hpp"
|
#include "gc/g1/g1HeapVerifier.hpp"
|
||||||
#include "gc/g1/g1OopClosures.inline.hpp"
|
#include "gc/g1/g1OopClosures.inline.hpp"
|
||||||
@ -62,7 +62,7 @@ public:
|
|||||||
class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
|
class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
|
||||||
private:
|
private:
|
||||||
G1CollectedHeap* _g1;
|
G1CollectedHeap* _g1;
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
HeapRegion* _hr;
|
HeapRegion* _hr;
|
||||||
size_t _marked_bytes;
|
size_t _marked_bytes;
|
||||||
OopsInHeapRegionClosure *_update_rset_cl;
|
OopsInHeapRegionClosure *_update_rset_cl;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2012, 2016, 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
|
||||||
|
@ -591,7 +591,7 @@ void G1HeapVerifier::verify_dirty_young_regions() {
|
|||||||
verify_dirty_young_list(_g1h->young_list()->first_region());
|
verify_dirty_young_list(_g1h->young_list()->first_region());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool G1HeapVerifier::verify_no_bits_over_tams(const char* bitmap_name, CMBitMapRO* bitmap,
|
bool G1HeapVerifier::verify_no_bits_over_tams(const char* bitmap_name, G1CMBitMapRO* bitmap,
|
||||||
HeapWord* tams, HeapWord* end) {
|
HeapWord* tams, HeapWord* end) {
|
||||||
guarantee(tams <= end,
|
guarantee(tams <= end,
|
||||||
"tams: " PTR_FORMAT " end: " PTR_FORMAT, p2i(tams), p2i(end));
|
"tams: " PTR_FORMAT " end: " PTR_FORMAT, p2i(tams), p2i(end));
|
||||||
@ -605,8 +605,8 @@ bool G1HeapVerifier::verify_no_bits_over_tams(const char* bitmap_name, CMBitMapR
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool G1HeapVerifier::verify_bitmaps(const char* caller, HeapRegion* hr) {
|
bool G1HeapVerifier::verify_bitmaps(const char* caller, HeapRegion* hr) {
|
||||||
CMBitMapRO* prev_bitmap = _g1h->concurrent_mark()->prevMarkBitMap();
|
G1CMBitMapRO* prev_bitmap = _g1h->concurrent_mark()->prevMarkBitMap();
|
||||||
CMBitMapRO* next_bitmap = (CMBitMapRO*) _g1h->concurrent_mark()->nextMarkBitMap();
|
G1CMBitMapRO* next_bitmap = (G1CMBitMapRO*) _g1h->concurrent_mark()->nextMarkBitMap();
|
||||||
|
|
||||||
HeapWord* bottom = hr->bottom();
|
HeapWord* bottom = hr->bottom();
|
||||||
HeapWord* ptams = hr->prev_top_at_mark_start();
|
HeapWord* ptams = hr->prev_top_at_mark_start();
|
||||||
|
@ -82,7 +82,7 @@ public:
|
|||||||
// range [from,limit). If it does, print an error message and return
|
// range [from,limit). If it does, print an error message and return
|
||||||
// false. Otherwise, just return true. bitmap_name should be "prev"
|
// false. Otherwise, just return true. bitmap_name should be "prev"
|
||||||
// or "next".
|
// or "next".
|
||||||
bool verify_no_bits_over_tams(const char* bitmap_name, CMBitMapRO* bitmap,
|
bool verify_no_bits_over_tams(const char* bitmap_name, G1CMBitMapRO* bitmap,
|
||||||
HeapWord* from, HeapWord* limit);
|
HeapWord* from, HeapWord* limit);
|
||||||
|
|
||||||
// Verify that the prev / next bitmap range [tams,end) for the given
|
// Verify that the prev / next bitmap range [tams,end) for the given
|
||||||
|
@ -31,12 +31,12 @@
|
|||||||
class HeapRegion;
|
class HeapRegion;
|
||||||
class G1CollectedHeap;
|
class G1CollectedHeap;
|
||||||
class G1RemSet;
|
class G1RemSet;
|
||||||
class ConcurrentMark;
|
class G1ConcurrentMark;
|
||||||
class DirtyCardToOopClosure;
|
class DirtyCardToOopClosure;
|
||||||
class CMBitMap;
|
class G1CMBitMap;
|
||||||
class CMMarkStack;
|
class G1CMMarkStack;
|
||||||
class G1ParScanThreadState;
|
class G1ParScanThreadState;
|
||||||
class CMTask;
|
class G1CMTask;
|
||||||
class ReferenceProcessor;
|
class ReferenceProcessor;
|
||||||
|
|
||||||
// A class that scans oops in a given heap region (much as OopsInGenClosure
|
// A class that scans oops in a given heap region (much as OopsInGenClosure
|
||||||
@ -92,7 +92,7 @@ protected:
|
|||||||
G1ParScanThreadState* _par_scan_state;
|
G1ParScanThreadState* _par_scan_state;
|
||||||
uint _worker_id; // Cache value from par_scan_state.
|
uint _worker_id; // Cache value from par_scan_state.
|
||||||
Klass* _scanned_klass;
|
Klass* _scanned_klass;
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
|
|
||||||
// Mark the object if it's not already marked. This is used to mark
|
// Mark the object if it's not already marked. This is used to mark
|
||||||
// objects pointed to by roots that are guaranteed not to move
|
// objects pointed to by roots that are guaranteed not to move
|
||||||
@ -170,12 +170,12 @@ public:
|
|||||||
// Closure for iterating over object fields during concurrent marking
|
// Closure for iterating over object fields during concurrent marking
|
||||||
class G1CMOopClosure : public MetadataAwareOopClosure {
|
class G1CMOopClosure : public MetadataAwareOopClosure {
|
||||||
protected:
|
protected:
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
private:
|
private:
|
||||||
G1CollectedHeap* _g1h;
|
G1CollectedHeap* _g1h;
|
||||||
CMTask* _task;
|
G1CMTask* _task;
|
||||||
public:
|
public:
|
||||||
G1CMOopClosure(G1CollectedHeap* g1h, ConcurrentMark* cm, CMTask* task);
|
G1CMOopClosure(G1CollectedHeap* g1h, G1ConcurrentMark* cm, G1CMTask* task);
|
||||||
template <class T> void do_oop_nv(T* p);
|
template <class T> void do_oop_nv(T* p);
|
||||||
virtual void do_oop( oop* p) { do_oop_nv(p); }
|
virtual void do_oop( oop* p) { do_oop_nv(p); }
|
||||||
virtual void do_oop(narrowOop* p) { do_oop_nv(p); }
|
virtual void do_oop(narrowOop* p) { do_oop_nv(p); }
|
||||||
@ -185,10 +185,10 @@ public:
|
|||||||
class G1RootRegionScanClosure : public MetadataAwareOopClosure {
|
class G1RootRegionScanClosure : public MetadataAwareOopClosure {
|
||||||
private:
|
private:
|
||||||
G1CollectedHeap* _g1h;
|
G1CollectedHeap* _g1h;
|
||||||
ConcurrentMark* _cm;
|
G1ConcurrentMark* _cm;
|
||||||
uint _worker_id;
|
uint _worker_id;
|
||||||
public:
|
public:
|
||||||
G1RootRegionScanClosure(G1CollectedHeap* g1h, ConcurrentMark* cm,
|
G1RootRegionScanClosure(G1CollectedHeap* g1h, G1ConcurrentMark* cm,
|
||||||
uint worker_id) :
|
uint worker_id) :
|
||||||
_g1h(g1h), _cm(cm), _worker_id(worker_id) { }
|
_g1h(g1h), _cm(cm), _worker_id(worker_id) { }
|
||||||
template <class T> void do_oop_nv(T* p);
|
template <class T> void do_oop_nv(T* p);
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
#ifndef SHARE_VM_GC_G1_G1OOPCLOSURES_INLINE_HPP
|
#ifndef SHARE_VM_GC_G1_G1OOPCLOSURES_INLINE_HPP
|
||||||
#define SHARE_VM_GC_G1_G1OOPCLOSURES_INLINE_HPP
|
#define SHARE_VM_GC_G1_G1OOPCLOSURES_INLINE_HPP
|
||||||
|
|
||||||
#include "gc/g1/concurrentMark.inline.hpp"
|
|
||||||
#include "gc/g1/g1CollectedHeap.hpp"
|
#include "gc/g1/g1CollectedHeap.hpp"
|
||||||
|
#include "gc/g1/g1ConcurrentMark.inline.hpp"
|
||||||
#include "gc/g1/g1OopClosures.hpp"
|
#include "gc/g1/g1OopClosures.hpp"
|
||||||
#include "gc/g1/g1ParScanThreadState.inline.hpp"
|
#include "gc/g1/g1ParScanThreadState.inline.hpp"
|
||||||
#include "gc/g1/g1RemSet.hpp"
|
#include "gc/g1/g1RemSet.hpp"
|
||||||
|
@ -51,9 +51,9 @@
|
|||||||
#include "utilities/exceptions.hpp"
|
#include "utilities/exceptions.hpp"
|
||||||
#include "utilities/macros.hpp"
|
#include "utilities/macros.hpp"
|
||||||
#if INCLUDE_ALL_GCS
|
#if INCLUDE_ALL_GCS
|
||||||
#include "gc/g1/concurrentMark.hpp"
|
|
||||||
#include "gc/g1/concurrentMarkThread.hpp"
|
#include "gc/g1/concurrentMarkThread.hpp"
|
||||||
#include "gc/g1/g1CollectedHeap.inline.hpp"
|
#include "gc/g1/g1CollectedHeap.inline.hpp"
|
||||||
|
#include "gc/g1/g1ConcurrentMark.hpp"
|
||||||
#include "gc/g1/heapRegionRemSet.hpp"
|
#include "gc/g1/heapRegionRemSet.hpp"
|
||||||
#include "gc/parallel/parallelScavengeHeap.inline.hpp"
|
#include "gc/parallel/parallelScavengeHeap.inline.hpp"
|
||||||
#include "gc/parallel/adjoiningGenerations.hpp"
|
#include "gc/parallel/adjoiningGenerations.hpp"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user