6778647: snap(), snap_policy() should be renamed setup(), setup_policy()
Summary: Renamed Reference{Policy,Pocessor} methods from snap{,_policy}() to setup{,_policy}()
Reviewed-by: apetrusenko
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Mon Dec 01 23:25:24 2008 -0800
@@ -1961,7 +1961,7 @@
ref_processor()->set_enqueuing_is_done(false);
ref_processor()->enable_discovery();
- ref_processor()->snap_policy(clear_all_soft_refs);
+ ref_processor()->setup_policy(clear_all_soft_refs);
// If an asynchronous collection finishes, the _modUnionTable is
// all clear. If we are assuming the collection from an asynchronous
// collection, clear the _modUnionTable.
@@ -2386,7 +2386,7 @@
}
// Snapshot the soft reference policy to be used in this collection cycle.
- ref_processor()->snap_policy(clear_all_soft_refs);
+ ref_processor()->setup_policy(clear_all_soft_refs);
bool init_mark_was_synchronous = false; // until proven otherwise
while (_collectorState != Idling) {
@@ -5683,7 +5683,7 @@
assert(rp->span().equals(_span), "Spans should be equal");
assert(!rp->enqueuing_is_done(), "Enqueuing should not be complete");
// Process weak references.
- rp->snap_policy(clear_all_soft_refs);
+ rp->setup_policy(clear_all_soft_refs);
verify_work_stacks_empty();
CMSKeepAliveClosure cmsKeepAliveClosure(this, _span, &_markBitMap,
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Mon Dec 01 23:25:24 2008 -0800
@@ -811,7 +811,7 @@
ReferenceProcessor* rp = g1h->ref_processor();
rp->verify_no_references_recorded();
rp->enable_discovery(); // enable ("weak") refs discovery
- rp->snap_policy(false); // snapshot the soft ref policy to be used in this cycle
+ rp->setup_policy(false); // snapshot the soft ref policy to be used in this cycle
SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
satb_mq_set.set_process_completed_threshold(G1SATBProcessCompletedThreshold);
@@ -1834,7 +1834,7 @@
ReferenceProcessor* rp = g1h->ref_processor();
// Process weak references.
- rp->snap_policy(clear_all_soft_refs);
+ rp->setup_policy(clear_all_soft_refs);
assert(_markStack.isEmpty(), "mark stack should be empty");
G1CMIsAliveClosure g1IsAliveClosure (g1h);
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Mon Dec 01 23:25:24 2008 -0800
@@ -891,7 +891,7 @@
ReferenceProcessorIsAliveMutator rp_is_alive_null(ref_processor(), NULL);
ref_processor()->enable_discovery();
- ref_processor()->snap_policy(clear_all_soft_refs);
+ ref_processor()->setup_policy(clear_all_soft_refs);
// Do collection work
{
--- a/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Mon Dec 01 23:25:24 2008 -0800
@@ -35,7 +35,7 @@
assert(GenMarkSweep::ref_processor() == NULL, "no stomping");
assert(rp != NULL, "should be non-NULL");
GenMarkSweep::_ref_processor = rp;
- rp->snap_policy(clear_all_softrefs);
+ rp->setup_policy(clear_all_softrefs);
// When collecting the permanent generation methodOops may be moving,
// so we either have to flush all bcp data or convert it into bci.
@@ -123,7 +123,7 @@
// Process reference objects found during marking
ReferenceProcessor* rp = GenMarkSweep::ref_processor();
- rp->snap_policy(clear_all_softrefs);
+ rp->setup_policy(clear_all_softrefs);
rp->process_discovered_references(&GenMarkSweep::is_alive,
&GenMarkSweep::keep_alive,
&GenMarkSweep::follow_stack_closure,
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Mon Dec 01 23:25:24 2008 -0800
@@ -773,7 +773,7 @@
set_promo_failure_scan_stack_closure(&scan_without_gc_barrier);
EvacuateFollowersClosureGeneral evacuate_followers(gch, _level,
&scan_without_gc_barrier, &scan_with_gc_barrier);
- rp->snap_policy(clear_all_soft_refs);
+ rp->setup_policy(clear_all_soft_refs);
if (rp->processing_is_mt()) {
ParNewRefProcTaskExecutor task_executor(*this, thread_state_set);
rp->process_discovered_references(&is_alive, &keep_alive,
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp Mon Dec 01 23:25:24 2008 -0800
@@ -172,7 +172,7 @@
COMPILER2_PRESENT(DerivedPointerTable::clear());
ref_processor()->enable_discovery();
- ref_processor()->snap_policy(clear_all_softrefs);
+ ref_processor()->setup_policy(clear_all_softrefs);
mark_sweep_phase1(clear_all_softrefs);
@@ -518,7 +518,7 @@
// Process reference objects found during marking
{
- ref_processor()->snap_policy(clear_all_softrefs);
+ ref_processor()->setup_policy(clear_all_softrefs);
ref_processor()->process_discovered_references(
is_alive_closure(), mark_and_push_closure(), follow_stack_closure(), NULL);
}
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Mon Dec 01 23:25:24 2008 -0800
@@ -1578,7 +1578,7 @@
COMPILER2_PRESENT(DerivedPointerTable::clear());
ref_processor()->enable_discovery();
- ref_processor()->snap_policy(maximum_heap_compaction);
+ ref_processor()->setup_policy(maximum_heap_compaction);
bool marked_for_unloading = false;
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp Mon Dec 01 23:25:24 2008 -0800
@@ -330,7 +330,7 @@
COMPILER2_PRESENT(DerivedPointerTable::clear());
reference_processor()->enable_discovery();
- reference_processor()->snap_policy(false);
+ reference_processor()->setup_policy(false);
// We track how much was promoted to the next generation for
// the AdaptiveSizePolicy.
@@ -395,7 +395,7 @@
// Process reference objects discovered during scavenge
{
- reference_processor()->snap_policy(false); // not always_clear
+ reference_processor()->setup_policy(false); // not always_clear
PSKeepAliveClosure keep_alive(promotion_manager);
PSEvacuateFollowersClosure evac_followers(promotion_manager);
if (reference_processor()->processing_is_mt()) {
--- a/hotspot/src/share/vm/memory/defNewGeneration.cpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp Mon Dec 01 23:25:24 2008 -0800
@@ -567,7 +567,7 @@
FastKeepAliveClosure keep_alive(this, &scan_weak_ref);
ReferenceProcessor* rp = ref_processor();
- rp->snap_policy(clear_all_soft_refs);
+ rp->setup_policy(clear_all_soft_refs);
rp->process_discovered_references(&is_alive, &keep_alive, &evacuate_followers,
NULL);
if (!promotion_failed()) {
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp Mon Dec 01 23:25:24 2008 -0800
@@ -525,7 +525,7 @@
if (rp->discovery_is_atomic()) {
rp->verify_no_references_recorded();
rp->enable_discovery();
- rp->snap_policy(clear_all_soft_refs);
+ rp->setup_policy(clear_all_soft_refs);
} else {
// collect() below will enable discovery as appropriate
}
--- a/hotspot/src/share/vm/memory/genMarkSweep.cpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/memory/genMarkSweep.cpp Mon Dec 01 23:25:24 2008 -0800
@@ -33,7 +33,7 @@
assert(ref_processor() == NULL, "no stomping");
assert(rp != NULL, "should be non-NULL");
_ref_processor = rp;
- rp->snap_policy(clear_all_softrefs);
+ rp->setup_policy(clear_all_softrefs);
TraceTime t1("Full GC", PrintGC && !PrintGCDetails, true, gclog_or_tty);
@@ -246,7 +246,7 @@
// Process reference objects found during marking
{
- ref_processor()->snap_policy(clear_all_softrefs);
+ ref_processor()->setup_policy(clear_all_softrefs);
ref_processor()->process_discovered_references(
&is_alive, &keep_alive, &follow_stack_closure, NULL);
}
--- a/hotspot/src/share/vm/memory/referencePolicy.cpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/memory/referencePolicy.cpp Mon Dec 01 23:25:24 2008 -0800
@@ -26,11 +26,11 @@
# include "incls/_referencePolicy.cpp.incl"
LRUCurrentHeapPolicy::LRUCurrentHeapPolicy() {
- snap();
+ setup();
}
// Capture state (of-the-VM) information needed to evaluate the policy
-void LRUCurrentHeapPolicy::snap() {
+void LRUCurrentHeapPolicy::setup() {
_max_interval = (Universe::get_heap_free_at_last_gc() / M) * SoftRefLRUPolicyMSPerMB;
assert(_max_interval >= 0,"Sanity check");
}
@@ -52,11 +52,11 @@
/////////////////////// MaxHeap //////////////////////
LRUMaxHeapPolicy::LRUMaxHeapPolicy() {
- snap();
+ setup();
}
// Capture state (of-the-VM) information needed to evaluate the policy
-void LRUMaxHeapPolicy::snap() {
+void LRUMaxHeapPolicy::setup() {
size_t max_heap = MaxHeapSize;
max_heap -= Universe::get_heap_used_at_last_gc();
max_heap /= M;
--- a/hotspot/src/share/vm/memory/referencePolicy.hpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/memory/referencePolicy.hpp Mon Dec 01 23:25:24 2008 -0800
@@ -30,7 +30,7 @@
public:
virtual bool should_clear_reference(oop p) { ShouldNotReachHere(); return true; }
// Capture state (of-the-VM) information needed to evaluate the policy
- virtual void snap() { /* do nothing */ }
+ virtual void setup() { /* do nothing */ }
};
class NeverClearPolicy : public ReferencePolicy {
@@ -51,7 +51,7 @@
LRUCurrentHeapPolicy();
// Capture state (of-the-VM) information needed to evaluate the policy
- void snap();
+ void setup();
bool should_clear_reference(oop p);
};
@@ -63,6 +63,6 @@
LRUMaxHeapPolicy();
// Capture state (of-the-VM) information needed to evaluate the policy
- void snap();
+ void setup();
bool should_clear_reference(oop p);
};
--- a/hotspot/src/share/vm/memory/referenceProcessor.cpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/memory/referenceProcessor.cpp Mon Dec 01 23:25:24 2008 -0800
@@ -115,7 +115,7 @@
vm_exit_during_initialization("Could not allocate ReferenceProcessor object");
}
rp->set_is_alive_non_header(is_alive_non_header);
- rp->snap_policy(false /* default soft ref policy */);
+ rp->setup_policy(false /* default soft ref policy */);
return rp;
}
--- a/hotspot/src/share/vm/memory/referenceProcessor.hpp Wed Nov 26 09:24:57 2008 -0800
+++ b/hotspot/src/share/vm/memory/referenceProcessor.hpp Mon Dec 01 23:25:24 2008 -0800
@@ -98,10 +98,10 @@
DiscoveredList* discovered_soft_refs() { return _discoveredSoftRefs; }
static oop sentinel_ref() { return _sentinelRef; }
static oop* adr_sentinel_ref() { return &_sentinelRef; }
- ReferencePolicy* snap_policy(bool always_clear) {
+ ReferencePolicy* setup_policy(bool always_clear) {
_current_soft_ref_policy = always_clear ?
_always_clear_soft_ref_policy : _default_soft_ref_policy;
- _current_soft_ref_policy->snap(); // snapshot the policy threshold
+ _current_soft_ref_policy->setup(); // snapshot the policy threshold
return _current_soft_ref_policy;
}