mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8064947: Clean up BarrierSet ctor/dtor
Make abstract base call contructors protected and require a "kind" argument. Reviewed-by: jmasa, jwilhelm
This commit is contained in:
parent
71a6555ee3
commit
3bd08574dc
7 changed files with 32 additions and 31 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -32,11 +32,8 @@
|
||||||
#include "runtime/orderAccess.inline.hpp"
|
#include "runtime/orderAccess.inline.hpp"
|
||||||
#include "runtime/thread.inline.hpp"
|
#include "runtime/thread.inline.hpp"
|
||||||
|
|
||||||
G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap) :
|
G1SATBCardTableModRefBS::G1SATBCardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind) :
|
||||||
CardTableModRefBS(whole_heap)
|
CardTableModRefBS(whole_heap, kind) { }
|
||||||
{
|
|
||||||
_kind = G1SATBCT;
|
|
||||||
}
|
|
||||||
|
|
||||||
void G1SATBCardTableModRefBS::enqueue(oop pre_val) {
|
void G1SATBCardTableModRefBS::enqueue(oop pre_val) {
|
||||||
// Nulls should have been already filtered.
|
// Nulls should have been already filtered.
|
||||||
|
@ -132,11 +129,10 @@ void G1SATBCardTableLoggingModRefBSChangedListener::on_commit(uint start_idx, si
|
||||||
|
|
||||||
G1SATBCardTableLoggingModRefBS::
|
G1SATBCardTableLoggingModRefBS::
|
||||||
G1SATBCardTableLoggingModRefBS(MemRegion whole_heap) :
|
G1SATBCardTableLoggingModRefBS(MemRegion whole_heap) :
|
||||||
G1SATBCardTableModRefBS(whole_heap),
|
G1SATBCardTableModRefBS(whole_heap, BarrierSet::G1SATBCTLogging),
|
||||||
_dcqs(JavaThread::dirty_card_queue_set()),
|
_dcqs(JavaThread::dirty_card_queue_set()),
|
||||||
_listener()
|
_listener()
|
||||||
{
|
{
|
||||||
_kind = G1SATBCTLogging;
|
|
||||||
_listener.set_card_table(this);
|
_listener.set_card_table(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -43,6 +43,9 @@ protected:
|
||||||
g1_young_gen = CT_MR_BS_last_reserved << 1
|
g1_young_gen = CT_MR_BS_last_reserved << 1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
G1SATBCardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind);
|
||||||
|
~G1SATBCardTableModRefBS() { }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static int g1_young_card_val() { return g1_young_gen; }
|
static int g1_young_card_val() { return g1_young_gen; }
|
||||||
|
|
||||||
|
@ -50,8 +53,6 @@ public:
|
||||||
// pre-marking object graph.
|
// pre-marking object graph.
|
||||||
static void enqueue(oop pre_val);
|
static void enqueue(oop pre_val);
|
||||||
|
|
||||||
G1SATBCardTableModRefBS(MemRegion whole_heap);
|
|
||||||
|
|
||||||
bool is_a(BarrierSet::Name bsn) {
|
bool is_a(BarrierSet::Name bsn) {
|
||||||
return bsn == BarrierSet::G1SATBCT || CardTableModRefBS::is_a(bsn);
|
return bsn == BarrierSet::G1SATBCT || CardTableModRefBS::is_a(bsn);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -54,7 +54,7 @@ class CardTableExtension : public CardTableModRefBS {
|
||||||
};
|
};
|
||||||
|
|
||||||
CardTableExtension(MemRegion whole_heap) :
|
CardTableExtension(MemRegion whole_heap) :
|
||||||
CardTableModRefBS(whole_heap) { }
|
CardTableModRefBS(whole_heap, BarrierSet::CardTableModRef) { }
|
||||||
|
|
||||||
// Too risky for the 4/10/02 putback
|
// Too risky for the 4/10/02 putback
|
||||||
// BarrierSet::Name kind() { return BarrierSet::CardTableExtension; }
|
// BarrierSet::Name kind() { return BarrierSet::CardTableExtension; }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -40,8 +40,7 @@ public:
|
||||||
CardTableExtension,
|
CardTableExtension,
|
||||||
G1SATBCT,
|
G1SATBCT,
|
||||||
G1SATBCTLogging,
|
G1SATBCTLogging,
|
||||||
Other,
|
Other
|
||||||
Uninit
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Flags {
|
enum Flags {
|
||||||
|
@ -57,9 +56,11 @@ protected:
|
||||||
static const int _max_covered_regions = 2;
|
static const int _max_covered_regions = 2;
|
||||||
Name _kind;
|
Name _kind;
|
||||||
|
|
||||||
|
BarrierSet(Name kind) : _kind(kind) { }
|
||||||
|
~BarrierSet() { }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
BarrierSet() { _kind = Uninit; }
|
|
||||||
// To get around prohibition on RTTI.
|
// To get around prohibition on RTTI.
|
||||||
BarrierSet::Name kind() { return _kind; }
|
BarrierSet::Name kind() { return _kind; }
|
||||||
virtual bool is_a(BarrierSet::Name bsn) = 0;
|
virtual bool is_a(BarrierSet::Name bsn) = 0;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -53,8 +53,8 @@ size_t CardTableModRefBS::compute_byte_map_size()
|
||||||
return align_size_up(_guard_index + 1, MAX2(_page_size, granularity));
|
return align_size_up(_guard_index + 1, MAX2(_page_size, granularity));
|
||||||
}
|
}
|
||||||
|
|
||||||
CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap) :
|
CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind) :
|
||||||
ModRefBarrierSet(),
|
ModRefBarrierSet(kind),
|
||||||
_whole_heap(whole_heap),
|
_whole_heap(whole_heap),
|
||||||
_guard_index(0),
|
_guard_index(0),
|
||||||
_guard_region(),
|
_guard_region(),
|
||||||
|
@ -72,8 +72,6 @@ CardTableModRefBS::CardTableModRefBS(MemRegion whole_heap) :
|
||||||
_lowest_non_clean_base_chunk_index(NULL),
|
_lowest_non_clean_base_chunk_index(NULL),
|
||||||
_last_LNC_resizing_collection(NULL)
|
_last_LNC_resizing_collection(NULL)
|
||||||
{
|
{
|
||||||
_kind = BarrierSet::CardTableModRef;
|
|
||||||
|
|
||||||
assert((uintptr_t(_whole_heap.start()) & (card_size - 1)) == 0, "heap must start at card boundary");
|
assert((uintptr_t(_whole_heap.start()) & (card_size - 1)) == 0, "heap must start at card boundary");
|
||||||
assert((uintptr_t(_whole_heap.end()) & (card_size - 1)) == 0, "heap must end at card boundary");
|
assert((uintptr_t(_whole_heap.end()) & (card_size - 1)) == 0, "heap must end at card boundary");
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -284,20 +284,22 @@ public:
|
||||||
return bsn == BarrierSet::CardTableModRef || ModRefBarrierSet::is_a(bsn);
|
return bsn == BarrierSet::CardTableModRef || ModRefBarrierSet::is_a(bsn);
|
||||||
}
|
}
|
||||||
|
|
||||||
CardTableModRefBS(MemRegion whole_heap);
|
|
||||||
~CardTableModRefBS();
|
|
||||||
|
|
||||||
virtual void initialize();
|
virtual void initialize();
|
||||||
|
|
||||||
// *** Barrier set functions.
|
// *** Barrier set functions.
|
||||||
|
|
||||||
bool has_write_ref_pre_barrier() { return false; }
|
bool has_write_ref_pre_barrier() { return false; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
CardTableModRefBS(MemRegion whole_heap, BarrierSet::Name kind);
|
||||||
|
~CardTableModRefBS();
|
||||||
|
|
||||||
// Record a reference update. Note that these versions are precise!
|
// Record a reference update. Note that these versions are precise!
|
||||||
// The scanning code has to handle the fact that the write barrier may be
|
// The scanning code has to handle the fact that the write barrier may be
|
||||||
// either precise or imprecise. We make non-virtual inline variants of
|
// either precise or imprecise. We make non-virtual inline variants of
|
||||||
// these functions here for performance.
|
// these functions here for performance.
|
||||||
protected:
|
|
||||||
void write_ref_field_work(oop obj, size_t offset, oop newVal);
|
void write_ref_field_work(oop obj, size_t offset, oop newVal);
|
||||||
virtual void write_ref_field_work(void* field, oop newVal, bool release = false);
|
virtual void write_ref_field_work(void* field, oop newVal, bool release = false);
|
||||||
public:
|
public:
|
||||||
|
@ -478,7 +480,7 @@ protected:
|
||||||
bool card_may_have_been_dirty(jbyte cv);
|
bool card_may_have_been_dirty(jbyte cv);
|
||||||
public:
|
public:
|
||||||
CardTableModRefBSForCTRS(MemRegion whole_heap) :
|
CardTableModRefBSForCTRS(MemRegion whole_heap) :
|
||||||
CardTableModRefBS(whole_heap) {}
|
CardTableModRefBS(whole_heap, BarrierSet::CardTableModRef) {}
|
||||||
|
|
||||||
void set_CTRS(CardTableRS* rs) { _rs = rs; }
|
void set_CTRS(CardTableRS* rs) { _rs = rs; }
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -37,8 +37,6 @@ class Generation;
|
||||||
class ModRefBarrierSet: public BarrierSet {
|
class ModRefBarrierSet: public BarrierSet {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
ModRefBarrierSet() { _kind = BarrierSet::ModRef; }
|
|
||||||
|
|
||||||
bool is_a(BarrierSet::Name bsn) {
|
bool is_a(BarrierSet::Name bsn) {
|
||||||
return bsn == BarrierSet::ModRef;
|
return bsn == BarrierSet::ModRef;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +57,12 @@ public:
|
||||||
|
|
||||||
void read_ref_field(void* field) {}
|
void read_ref_field(void* field) {}
|
||||||
void read_prim_field(HeapWord* field, size_t bytes) {}
|
void read_prim_field(HeapWord* field, size_t bytes) {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
ModRefBarrierSet(BarrierSet::Name kind) : BarrierSet(kind) { }
|
||||||
|
~ModRefBarrierSet() { }
|
||||||
|
|
||||||
virtual void write_ref_field_work(void* field, oop new_val, bool release = false) = 0;
|
virtual void write_ref_field_work(void* field, oop new_val, bool release = false) = 0;
|
||||||
public:
|
public:
|
||||||
void write_prim_field(HeapWord* field, size_t bytes,
|
void write_prim_field(HeapWord* field, size_t bytes,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue