This commit is contained in:
Erik Helin 2016-02-05 18:37:18 +01:00
commit 99653fda01
17 changed files with 361 additions and 361 deletions

View File

@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@ -43,7 +43,7 @@
SurrogateLockerThread*
ConcurrentMarkThread::_slt = NULL;
ConcurrentMarkThread::ConcurrentMarkThread(ConcurrentMark* cm) :
ConcurrentMarkThread::ConcurrentMarkThread(G1ConcurrentMark* cm) :
ConcurrentGCThread(),
_cm(cm),
_state(Idle),
@ -56,10 +56,10 @@ ConcurrentMarkThread::ConcurrentMarkThread(ConcurrentMark* cm) :
class CMCheckpointRootsFinalClosure: public VoidClosure {
ConcurrentMark* _cm;
G1ConcurrentMark* _cm;
public:
CMCheckpointRootsFinalClosure(ConcurrentMark* cm) :
CMCheckpointRootsFinalClosure(G1ConcurrentMark* cm) :
_cm(cm) {}
void do_void(){
@ -68,10 +68,10 @@ public:
};
class CMCleanUp: public VoidClosure {
ConcurrentMark* _cm;
G1ConcurrentMark* _cm;
public:
CMCleanUp(ConcurrentMark* cm) :
CMCleanUp(G1ConcurrentMark* cm) :
_cm(cm) {}
void do_void(){
@ -92,10 +92,10 @@ void ConcurrentMarkThread::delay_to_keep_mmu(G1CollectorPolicy* g1_policy, bool
}
class GCConcPhaseTimer : StackObj {
ConcurrentMark* _cm;
G1ConcurrentMark* _cm;
public:
GCConcPhaseTimer(ConcurrentMark* cm, const char* title) : _cm(cm) {
GCConcPhaseTimer(G1ConcurrentMark* cm, const char* title) : _cm(cm) {
_cm->register_concurrent_phase_start(title);
}

View File

@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,10 +27,10 @@
#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.
class ConcurrentMark;
class G1ConcurrentMark;
class G1CollectorPolicy;
class ConcurrentMarkThread: public ConcurrentGCThread {
@ -45,7 +45,7 @@ class ConcurrentMarkThread: public ConcurrentGCThread {
virtual void run();
private:
ConcurrentMark* _cm;
G1ConcurrentMark* _cm;
enum State {
Idle,
@ -65,7 +65,7 @@ class ConcurrentMarkThread: public ConcurrentGCThread {
public:
// Constructor
ConcurrentMarkThread(ConcurrentMark* cm);
ConcurrentMarkThread(G1ConcurrentMark* cm);
static void makeSurrogateLockerThread(TRAPS);
static SurrogateLockerThread* slt() { return _slt; }
@ -75,7 +75,7 @@ class ConcurrentMarkThread: public ConcurrentGCThread {
// Marking virtual time so far this thread and concurrent marking tasks.
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; }
bool idle() { return _state == Idle; }

View File

@ -25,8 +25,8 @@
#ifndef 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/g1ConcurrentMark.hpp"
// Total virtual time so far.
inline double ConcurrentMarkThread::vtime_accum() {

View File

@ -1417,13 +1417,13 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc,
// Clear the previous marking bitmap, if needed for bitmap verification.
// 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.
// 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 prev bitmap.
if (G1VerifyBitmaps) {
((CMBitMap*) concurrent_mark()->prevMarkBitMap())->clearAll();
((G1CMBitMap*) concurrent_mark()->prevMarkBitMap())->clearAll();
}
_verifier->check_bitmaps("Full GC End");
@ -1924,11 +1924,11 @@ jint G1CollectedHeap::initialize() {
G1CardCounts::compute_size(g1_rs.size() / HeapWordSize),
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 =
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 =
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);
g1_barrier_set()->initialize(cardtable_storage);
@ -1960,11 +1960,11 @@ jint G1CollectedHeap::initialize() {
_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.)
_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()) {
vm_shutdown_during_initialization("Could not create/initialize ConcurrentMark");
vm_shutdown_during_initialization("Could not create/initialize G1ConcurrentMark");
return JNI_ENOMEM;
}
_cmThread = _cm->cmThread();
@ -4992,7 +4992,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure {
G1CollectedHeap* g1h = G1CollectedHeap::heap();
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 main additional check (in addition to having a reference from the roots

View File

@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@ -25,11 +25,11 @@
#ifndef 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/g1AllocationContext.hpp"
#include "gc/g1/g1BiasedArray.hpp"
#include "gc/g1/g1CollectorState.hpp"
#include "gc/g1/g1ConcurrentMark.hpp"
#include "gc/g1/g1HRPrinter.hpp"
#include "gc/g1/g1InCSetState.hpp"
#include "gc/g1/g1MonitoringSupport.hpp"
@ -68,7 +68,7 @@ class Space;
class G1CollectorPolicy;
class G1RemSet;
class HeapRegionRemSetIterator;
class ConcurrentMark;
class G1ConcurrentMark;
class ConcurrentMarkThread;
class ConcurrentG1Refine;
class ConcurrentGCTimer;
@ -771,7 +771,7 @@ protected:
void abandon_collection_set(HeapRegion* cs_head);
// The concurrent marker (and the thread it runs in.)
ConcurrentMark* _cm;
G1ConcurrentMark* _cm;
ConcurrentMarkThread* _cmThread;
// The concurrent refiner.
@ -1380,7 +1380,7 @@ public:
inline bool is_obj_ill(const oop obj) const;
ConcurrentMark* concurrent_mark() const { return _cm; }
G1ConcurrentMark* concurrent_mark() const { return _cm; }
// Refinement

View File

@ -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.
*
* 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
#define SHARE_VM_GC_G1_G1COLLECTEDHEAP_INLINE_HPP
#include "gc/g1/concurrentMark.hpp"
#include "gc/g1/g1CollectedHeap.hpp"
#include "gc/g1/g1CollectorPolicy.hpp"
#include "gc/g1/g1CollectorState.hpp"
#include "gc/g1/g1ConcurrentMark.hpp"
#include "gc/g1/g1SATBCardTableModRefBS.hpp"
#include "gc/g1/heapRegionManager.inline.hpp"
#include "gc/g1/heapRegionSet.inline.hpp"

View File

@ -24,10 +24,10 @@
#include "precompiled.hpp"
#include "gc/g1/concurrentG1Refine.hpp"
#include "gc/g1/concurrentMark.hpp"
#include "gc/g1/concurrentMarkThread.inline.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1CollectorPolicy.hpp"
#include "gc/g1/g1ConcurrentMark.hpp"
#include "gc/g1/g1IHOPControl.hpp"
#include "gc/g1/g1GCPhaseTimes.hpp"
#include "gc/g1/heapRegion.inline.hpp"

View File

@ -22,8 +22,8 @@
*
*/
#ifndef SHARE_VM_GC_G1_CONCURRENTMARK_HPP
#define SHARE_VM_GC_G1_CONCURRENTMARK_HPP
#ifndef SHARE_VM_GC_G1_G1CONCURRENTMARK_HPP
#define SHARE_VM_GC_G1_G1CONCURRENTMARK_HPP
#include "classfile/javaClasses.hpp"
#include "gc/g1/g1RegionToSpaceMapper.hpp"
@ -31,11 +31,11 @@
#include "gc/shared/taskqueue.hpp"
class G1CollectedHeap;
class CMBitMap;
class CMTask;
class ConcurrentMark;
typedef GenericTaskQueue<oop, mtGC> CMTaskQueue;
typedef GenericTaskQueueSet<CMTaskQueue, mtGC> CMTaskQueueSet;
class G1CMBitMap;
class G1CMTask;
class G1ConcurrentMark;
typedef GenericTaskQueue<oop, mtGC> G1CMTaskQueue;
typedef GenericTaskQueueSet<G1CMTaskQueue, mtGC> G1CMTaskQueueSet;
// Closure used by CM during concurrent reference discovery
// 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
// class, with one bit per (1<<_shifter) HeapWords.
class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
class G1CMBitMapRO VALUE_OBJ_CLASS_SPEC {
protected:
HeapWord* _bmStartWord; // base address of range covered by map
size_t _bmWordSize; // map size (in #HeapWords covered)
@ -63,7 +63,7 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
public:
// constructor
CMBitMapRO(int shifter);
G1CMBitMapRO(int shifter);
// inquiries
HeapWord* startWord() const { return _bmStartWord; }
@ -104,20 +104,20 @@ class CMBitMapRO VALUE_OBJ_CLASS_SPEC {
NOT_PRODUCT(bool covers(MemRegion rs) const;)
};
class CMBitMapMappingChangedListener : public G1MappingChangedListener {
class G1CMBitMapMappingChangedListener : public G1MappingChangedListener {
private:
CMBitMap* _bm;
G1CMBitMap* _bm;
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);
};
class CMBitMap : public CMBitMapRO {
class G1CMBitMap : public G1CMBitMapRO {
private:
CMBitMapMappingChangedListener _listener;
G1CMBitMapMappingChangedListener _listener;
public:
static size_t compute_size(size_t heap_size);
@ -129,7 +129,7 @@ class CMBitMap : public CMBitMapRO {
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.
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.
class CMMarkStack VALUE_OBJ_CLASS_SPEC {
class G1CMMarkStack VALUE_OBJ_CLASS_SPEC {
VirtualSpace _virtual_space; // Underlying backing store for actual stack
ConcurrentMark* _cm;
G1ConcurrentMark* _cm;
oop* _base; // bottom of stack
jint _index; // one more than last occupied index
jint _capacity; // max #elements
@ -158,8 +158,8 @@ class CMMarkStack VALUE_OBJ_CLASS_SPEC {
bool _should_expand;
public:
CMMarkStack(ConcurrentMark* cm);
~CMMarkStack();
G1CMMarkStack(G1ConcurrentMark* cm);
~G1CMMarkStack();
bool allocate(size_t capacity);
@ -220,19 +220,19 @@ class YoungList;
// Currently, we only support root region scanning once (at the start
// of the marking cycle) and the root regions are all the survivor
// regions populated during the initial-mark pause.
class CMRootRegions VALUE_OBJ_CLASS_SPEC {
class G1CMRootRegions VALUE_OBJ_CLASS_SPEC {
private:
YoungList* _young_list;
ConcurrentMark* _cm;
G1ConcurrentMark* _cm;
volatile bool _scan_in_progress;
volatile bool _should_abort;
HeapRegion* volatile _next_survivor;
public:
CMRootRegions();
G1CMRootRegions();
// 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.
void prepare_for_scan();
@ -260,19 +260,19 @@ public:
class ConcurrentMarkThread;
class ConcurrentMark: public CHeapObj<mtGC> {
friend class CMMarkStack;
class G1ConcurrentMark: public CHeapObj<mtGC> {
friend class ConcurrentMarkThread;
friend class CMTask;
friend class CMBitMapClosure;
friend class CMRemarkTask;
friend class CMConcurrentMarkingTask;
friend class G1ParNoteEndTask;
friend class CalcLiveObjectsClosure;
friend class G1CMRefProcTaskProxy;
friend class G1CMRefProcTaskExecutor;
friend class G1CMKeepAliveAndDrainClosure;
friend class G1CMDrainMarkingStackClosure;
friend class G1CMBitMapClosure;
friend class G1CMConcurrentMarkingTask;
friend class G1CMMarkStack;
friend class G1CMRemarkTask;
friend class G1CMTask;
protected:
ConcurrentMarkThread* _cmThread; // The thread doing the work
@ -290,10 +290,10 @@ protected:
FreeRegionList _cleanup_list;
// Concurrent marking support structures
CMBitMap _markBitMap1;
CMBitMap _markBitMap2;
CMBitMapRO* _prevMarkBitMap; // Completed mark bitmap
CMBitMap* _nextMarkBitMap; // Under-construction mark bitmap
G1CMBitMap _markBitMap1;
G1CMBitMap _markBitMap2;
G1CMBitMapRO* _prevMarkBitMap; // Completed mark bitmap
G1CMBitMap* _nextMarkBitMap; // Under-construction mark bitmap
BitMap _region_bm;
BitMap _card_bm;
@ -303,10 +303,10 @@ protected:
HeapWord* _heap_end;
// Root region tracking and claiming
CMRootRegions _root_regions;
G1CMRootRegions _root_regions;
// 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,
// always points to the end of the
// last claimed region
@ -314,8 +314,8 @@ protected:
// Marking tasks
uint _max_worker_id;// Maximum worker id
uint _active_tasks; // Task num currently active
CMTask** _tasks; // Task queue array (max_worker_id len)
CMTaskQueueSet* _task_queues; // Task queue set
G1CMTask** _tasks; // Task queue array (max_worker_id len)
G1CMTaskQueueSet* _task_queues; // Task queue set
ParallelTaskTerminator _terminator; // For termination
// Two sync barriers that are used to synchronize tasks when an
@ -430,21 +430,21 @@ protected:
bool out_of_regions() { return _finger >= _heap_end; }
// Returns the task with the given id
CMTask* task(int id) {
G1CMTask* task(int id) {
assert(0 <= id && id < (int) _active_tasks,
"task id not within active bounds");
return _tasks[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,
"task queue id not within active bounds");
return (CMTaskQueue*) _task_queues->queue(id);
return (G1CMTaskQueue*) _task_queues->queue(id);
}
// 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
// indicate that the global stack has overflown
@ -502,7 +502,7 @@ public:
bool mark_stack_overflow() { return _markStack.overflow(); }
bool mark_stack_empty() { return _markStack.isEmpty(); }
CMRootRegions* root_regions() { return &_root_regions; }
G1CMRootRegions* root_regions() { return &_root_regions; }
bool 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
bool try_stealing(uint worker_id, int* hash_seed, oop& obj);
ConcurrentMark(G1CollectedHeap* g1h,
G1RegionToSpaceMapper* prev_bitmap_storage,
G1RegionToSpaceMapper* next_bitmap_storage);
~ConcurrentMark();
G1ConcurrentMark(G1CollectedHeap* g1h,
G1RegionToSpaceMapper* prev_bitmap_storage,
G1RegionToSpaceMapper* next_bitmap_storage);
~G1ConcurrentMark();
ConcurrentMarkThread* cmThread() { return _cmThread; }
CMBitMapRO* prevMarkBitMap() const { return _prevMarkBitMap; }
CMBitMap* nextMarkBitMap() const { return _nextMarkBitMap; }
G1CMBitMapRO* prevMarkBitMap() const { return _prevMarkBitMap; }
G1CMBitMap* nextMarkBitMap() const { return _nextMarkBitMap; }
// 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
@ -728,7 +728,7 @@ protected:
};
// A class representing a marking task.
class CMTask : public TerminatorTerminator {
class G1CMTask : public TerminatorTerminator {
private:
enum PrivateConstants {
// the regular clock call is called once the scanned words reaches
@ -746,13 +746,13 @@ private:
uint _worker_id;
G1CollectedHeap* _g1h;
ConcurrentMark* _cm;
CMBitMap* _nextMarkBitMap;
G1ConcurrentMark* _cm;
G1CMBitMap* _nextMarkBitMap;
// the task queue of this task
CMTaskQueue* _task_queue;
G1CMTaskQueue* _task_queue;
private:
// the task queue set---needed for stealing
CMTaskQueueSet* _task_queues;
G1CMTaskQueueSet* _task_queues;
// indicates whether the task has been claimed---this is only for
// debugging purposes
bool _claimed;
@ -869,7 +869,7 @@ private:
public:
// It resets the task; it should be called right at the beginning of
// a marking phase.
void reset(CMBitMap* _nextMarkBitMap);
void reset(G1CMBitMap* _nextMarkBitMap);
// it clears all the fields that correspond to a claimed region.
void clear_region_fields();
@ -956,12 +956,12 @@ public:
_finger = new_finger;
}
CMTask(uint worker_id,
ConcurrentMark *cm,
size_t* marked_bytes,
BitMap* card_bm,
CMTaskQueue* task_queue,
CMTaskQueueSet* task_queues);
G1CMTask(uint worker_id,
G1ConcurrentMark *cm,
size_t* marked_bytes,
BitMap* card_bm,
G1CMTaskQueue* task_queue,
G1CMTaskQueueSet* task_queues);
// it prints statistics associated with this task
void print_stats();
@ -1021,4 +1021,4 @@ public:
~G1PrintRegionLivenessInfoClosure();
};
#endif // SHARE_VM_GC_G1_CONCURRENTMARK_HPP
#endif // SHARE_VM_GC_G1_G1CONCURRENTMARK_HPP

View File

@ -22,19 +22,19 @@
*
*/
#ifndef SHARE_VM_GC_G1_CONCURRENTMARK_INLINE_HPP
#define SHARE_VM_GC_G1_CONCURRENTMARK_INLINE_HPP
#ifndef SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP
#define SHARE_VM_GC_G1_G1CONCURRENTMARK_INLINE_HPP
#include "gc/g1/concurrentMark.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ConcurrentMark.hpp"
#include "gc/shared/taskqueue.inline.hpp"
// Utility routine to set an exclusive range of cards on the given
// card liveness bitmap
inline void ConcurrentMark::set_card_bitmap_range(BitMap* card_bm,
BitMap::idx_t start_idx,
BitMap::idx_t end_idx,
bool is_par) {
inline void G1ConcurrentMark::set_card_bitmap_range(BitMap* card_bm,
BitMap::idx_t start_idx,
BitMap::idx_t end_idx,
bool is_par) {
// Set the exclusive bit range [start_idx, end_idx).
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
// 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
// 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
@ -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
// counting data structures.
inline void ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr,
size_t* marked_bytes_array,
BitMap* task_card_bm) {
inline void G1ConcurrentMark::count_region(MemRegion mr, HeapRegion* hr,
size_t* marked_bytes_array,
BitMap* task_card_bm) {
G1CollectedHeap* g1h = _g1h;
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.
inline void ConcurrentMark::count_object(oop obj,
HeapRegion* hr,
size_t* marked_bytes_array,
BitMap* task_card_bm,
size_t word_size) {
inline void G1ConcurrentMark::count_object(oop obj,
HeapRegion* hr,
size_t* marked_bytes_array,
BitMap* task_card_bm,
size_t word_size) {
assert(!hr->is_continues_humongous(), "Cannot enter count_object with continues humongous");
if (!hr->is_starts_humongous()) {
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
// the object in the given task/worker counting structures.
inline bool ConcurrentMark::par_mark_and_count(oop obj,
HeapRegion* hr,
size_t* marked_bytes_array,
BitMap* task_card_bm) {
inline bool G1ConcurrentMark::par_mark_and_count(oop obj,
HeapRegion* hr,
size_t* marked_bytes_array,
BitMap* task_card_bm) {
if (_nextMarkBitMap->parMark((HeapWord*)obj)) {
// Update the task specific count data for the object.
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
// the object in the task/worker counting structures for the
// given worker id.
inline bool ConcurrentMark::par_mark_and_count(oop obj,
size_t word_size,
HeapRegion* hr,
uint worker_id) {
inline bool G1ConcurrentMark::par_mark_and_count(oop obj,
size_t word_size,
HeapRegion* hr,
uint worker_id) {
if (_nextMarkBitMap->parMark((HeapWord*)obj)) {
size_t* marked_bytes_array = count_marked_bytes_array_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;
}
inline bool CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
inline bool G1CMBitMapRO::iterate(BitMapClosure* cl, MemRegion mr) {
HeapWord* start_addr = MAX2(startWord(), mr.start());
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
HeapWord* CMBitMapRO::nextObject(HeapWord* addr) {
HeapWord* G1CMBitMapRO::nextObject(HeapWord* addr) {
oop obj = (oop) addr;
HeapWord* res = addr + obj->size();
assert(offsetToHeapWord(heapWordToOffset(res)) == res, "sanity");
@ -201,17 +201,17 @@ HeapWord* CMBitMapRO::nextObject(HeapWord* addr) {
" corresponding to " PTR_FORMAT " (%u)", \
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);
_bm.set_bit(heapWordToOffset(addr));
}
inline void CMBitMap::clear(HeapWord* addr) {
inline void G1CMBitMap::clear(HeapWord* addr) {
check_mark(addr);
_bm.clear_bit(heapWordToOffset(addr));
}
inline bool CMBitMap::parMark(HeapWord* addr) {
inline bool G1CMBitMap::parMark(HeapWord* addr) {
check_mark(addr);
return _bm.par_set_bit(heapWordToOffset(addr));
}
@ -219,7 +219,7 @@ inline bool CMBitMap::parMark(HeapWord* addr) {
#undef check_mark
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);
for (int i = 0; i < _index; ++i) {
fn(_base[i]);
@ -227,9 +227,9 @@ inline void CMMarkStack::iterate(Fn fn) {
}
// 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;
assert(_g1h->is_in_g1_reserved(objAddr), "invariant");
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
// 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
@ -281,7 +281,7 @@ inline bool CMTask::is_below_finger(oop obj, HeapWord* global_finger) const {
}
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(_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)) {
// 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();
// 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();
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");
// Note we are overriding the read-only view of the prev map here, via
// 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");
HeapWord* addr = (HeapWord*)p;
assert(addr >= _prevMarkBitMap->startWord() ||
@ -370,8 +370,8 @@ bool ConcurrentMark::isPrevMarked(oop p) const {
return _prevMarkBitMap->isMarked(addr);
}
inline void ConcurrentMark::grayRoot(oop obj, size_t word_size,
uint worker_id, HeapRegion* hr) {
inline void G1ConcurrentMark::grayRoot(oop obj, size_t word_size,
uint worker_id, HeapRegion* hr) {
assert(obj != NULL, "pre-condition");
HeapWord* addr = (HeapWord*) obj;
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

View File

@ -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.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,10 +23,10 @@
*/
#include "precompiled.hpp"
#include "gc/g1/concurrentMark.inline.hpp"
#include "gc/g1/dirtyCardQueue.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1CollectorState.hpp"
#include "gc/g1/g1ConcurrentMark.inline.hpp"
#include "gc/g1/g1EvacFailure.hpp"
#include "gc/g1/g1HeapVerifier.hpp"
#include "gc/g1/g1OopClosures.inline.hpp"
@ -62,7 +62,7 @@ public:
class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
private:
G1CollectedHeap* _g1;
ConcurrentMark* _cm;
G1ConcurrentMark* _cm;
HeapRegion* _hr;
size_t _marked_bytes;
OopsInHeapRegionClosure *_update_rset_cl;

View File

@ -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.
*
* This code is free software; you can redistribute it and/or modify it

View File

@ -591,7 +591,7 @@ void G1HeapVerifier::verify_dirty_young_regions() {
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) {
guarantee(tams <= 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) {
CMBitMapRO* prev_bitmap = _g1h->concurrent_mark()->prevMarkBitMap();
CMBitMapRO* next_bitmap = (CMBitMapRO*) _g1h->concurrent_mark()->nextMarkBitMap();
G1CMBitMapRO* prev_bitmap = _g1h->concurrent_mark()->prevMarkBitMap();
G1CMBitMapRO* next_bitmap = (G1CMBitMapRO*) _g1h->concurrent_mark()->nextMarkBitMap();
HeapWord* bottom = hr->bottom();
HeapWord* ptams = hr->prev_top_at_mark_start();

View File

@ -82,7 +82,7 @@ public:
// range [from,limit). If it does, print an error message and return
// false. Otherwise, just return true. bitmap_name should be "prev"
// 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);
// Verify that the prev / next bitmap range [tams,end) for the given

View File

@ -31,12 +31,12 @@
class HeapRegion;
class G1CollectedHeap;
class G1RemSet;
class ConcurrentMark;
class G1ConcurrentMark;
class DirtyCardToOopClosure;
class CMBitMap;
class CMMarkStack;
class G1CMBitMap;
class G1CMMarkStack;
class G1ParScanThreadState;
class CMTask;
class G1CMTask;
class ReferenceProcessor;
// A class that scans oops in a given heap region (much as OopsInGenClosure
@ -92,7 +92,7 @@ protected:
G1ParScanThreadState* _par_scan_state;
uint _worker_id; // Cache value from par_scan_state.
Klass* _scanned_klass;
ConcurrentMark* _cm;
G1ConcurrentMark* _cm;
// 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
@ -170,12 +170,12 @@ public:
// Closure for iterating over object fields during concurrent marking
class G1CMOopClosure : public MetadataAwareOopClosure {
protected:
ConcurrentMark* _cm;
G1ConcurrentMark* _cm;
private:
G1CollectedHeap* _g1h;
CMTask* _task;
G1CMTask* _task;
public:
G1CMOopClosure(G1CollectedHeap* g1h, ConcurrentMark* cm, CMTask* task);
G1CMOopClosure(G1CollectedHeap* g1h, G1ConcurrentMark* cm, G1CMTask* task);
template <class T> void do_oop_nv(T* p);
virtual void do_oop( oop* p) { do_oop_nv(p); }
virtual void do_oop(narrowOop* p) { do_oop_nv(p); }
@ -185,10 +185,10 @@ public:
class G1RootRegionScanClosure : public MetadataAwareOopClosure {
private:
G1CollectedHeap* _g1h;
ConcurrentMark* _cm;
G1ConcurrentMark* _cm;
uint _worker_id;
public:
G1RootRegionScanClosure(G1CollectedHeap* g1h, ConcurrentMark* cm,
G1RootRegionScanClosure(G1CollectedHeap* g1h, G1ConcurrentMark* cm,
uint worker_id) :
_g1h(g1h), _cm(cm), _worker_id(worker_id) { }
template <class T> void do_oop_nv(T* p);

View File

@ -25,8 +25,8 @@
#ifndef 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/g1ConcurrentMark.inline.hpp"
#include "gc/g1/g1OopClosures.hpp"
#include "gc/g1/g1ParScanThreadState.inline.hpp"
#include "gc/g1/g1RemSet.hpp"

View File

@ -51,9 +51,9 @@
#include "utilities/exceptions.hpp"
#include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
#include "gc/g1/concurrentMark.hpp"
#include "gc/g1/concurrentMarkThread.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1ConcurrentMark.hpp"
#include "gc/g1/heapRegionRemSet.hpp"
#include "gc/parallel/parallelScavengeHeap.inline.hpp"
#include "gc/parallel/adjoiningGenerations.hpp"