Rename EpsilonCollectedHeap to EpsilonHeap.
--- a/src/hotspot/share/gc/epsilon/epsilonArguments.cpp Thu Nov 30 18:43:41 2017 +0100
+++ b/src/hotspot/share/gc/epsilon/epsilonArguments.cpp Thu Nov 30 18:51:47 2017 +0100
@@ -24,7 +24,7 @@
#include "precompiled.hpp"
#include "gc/epsilon/epsilonArguments.hpp"
-#include "gc/epsilon/epsilonCollectedHeap.hpp"
+#include "gc/epsilon/epsilonHeap.hpp"
#include "gc/epsilon/epsilonCollectorPolicy.hpp"
#include "gc/shared/gcArguments.inline.hpp"
#include "runtime/globals.hpp"
@@ -54,5 +54,5 @@
}
CollectedHeap* EpsilonArguments::create_heap() {
- return create_heap_with_policy<EpsilonCollectedHeap, EpsilonCollectorPolicy>();
+ return create_heap_with_policy<EpsilonHeap, EpsilonCollectorPolicy>();
}
--- a/src/hotspot/share/gc/epsilon/epsilonCollectedHeap.cpp Thu Nov 30 18:43:41 2017 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-/*
- * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#include "precompiled.hpp"
-#include "oops/oop.hpp"
-#include "oops/oop.inline.hpp"
-#include "gc/epsilon/epsilonCollectedHeap.hpp"
-
-jint EpsilonCollectedHeap::initialize() {
- CollectedHeap::pre_initialize();
-
- size_t init_byte_size = _policy->initial_heap_byte_size();
- size_t max_byte_size = _policy->max_heap_byte_size();
- size_t align = _policy->heap_alignment();
-
- ReservedSpace heap_rs = Universe::reserve_heap(max_byte_size, align);
- _virtual_space.initialize(heap_rs, init_byte_size);
-
- MemRegion committed_region((HeapWord*)_virtual_space.low(), (HeapWord*)_virtual_space.high());
- MemRegion reserved_region((HeapWord*)_virtual_space.low_boundary(), (HeapWord*)_virtual_space.high_boundary());
-
- initialize_reserved_region(reserved_region.start(), reserved_region.end());
-
- _space = new ContiguousSpace();
- _space->initialize(committed_region, true, true);
-
- EpsilonBarrierSet* bs = new EpsilonBarrierSet();
- set_barrier_set(bs);
-
- _max_tlab_size = MIN2(CollectedHeap::max_tlab_size(), EpsilonMaxTLABSize / HeapWordSize);
-
- _monitoring_support = new EpsilonMonitoringSupport(this);
- _last_counter_update = 0;
-
- if (init_byte_size != max_byte_size) {
- log_info(gc)("Initialized with " SIZE_FORMAT "M heap, resizeable to up to " SIZE_FORMAT "M heap with " SIZE_FORMAT "M steps",
- init_byte_size / M, max_byte_size / M, EpsilonMinHeapExpand / M);
- } else {
- log_info(gc)("Initialized with " SIZE_FORMAT "M non-resizeable heap", init_byte_size / M);
- }
- if (UseTLAB) {
- log_info(gc)("Using TLAB allocation; min: " SIZE_FORMAT "K, max: " SIZE_FORMAT "K",
- ThreadLocalAllocBuffer::min_size()*HeapWordSize / K,
- _max_tlab_size*HeapWordSize / K);
- } else {
- log_info(gc)("Not using TLAB allocation");
- }
-
- return JNI_OK;
-}
-
-size_t EpsilonCollectedHeap::unsafe_max_tlab_alloc(Thread *thr) const {
- // This is the only way we can control TLAB sizes without having safepoints.
- // Implement exponential expansion within [MinTLABSize; _max_tlab_size], based
- // on previously "used" TLAB size.
-
- size_t size = MIN2(_max_tlab_size * HeapWordSize, MAX2(MinTLABSize, thr->tlab().used() * HeapWordSize * 2));
-
- if (log_is_enabled(Trace, gc)) {
- ResourceMark rm;
- log_trace(gc)(
- "Selecting TLAB size for \"%s\" (Desired: " SIZE_FORMAT "K, Used: " SIZE_FORMAT "K) -> " SIZE_FORMAT "K",
- Thread::current()->name(),
- thr->tlab().desired_size() * HeapWordSize / K,
- thr->tlab().used() * HeapWordSize / K,
- size / K);
- }
-
- return size;
-}
-
-EpsilonCollectedHeap* EpsilonCollectedHeap::heap() {
- CollectedHeap* heap = Universe::heap();
- assert(heap != NULL, "Uninitialized access to EpsilonCollectedHeap::heap()");
- assert(heap->kind() == CollectedHeap::EpsilonCollectedHeap, "Not a EpsilonCollectedHeap");
- return (EpsilonCollectedHeap*)heap;
-}
-
-HeapWord* EpsilonCollectedHeap::allocate_work(size_t size) {
- HeapWord* res = _space->par_allocate(size);
-
- while (res == NULL) {
- // Allocation failed, attempt expansion, and retry:
- MutexLockerEx ml(Heap_lock);
- if (!_virtual_space.expand_by(MAX2(size, EpsilonMinHeapExpand))) {
- return NULL;
- }
- _space->set_end((HeapWord *) _virtual_space.high());
- res = _space->par_allocate(size);
- }
-
- size_t used = _space->used();
- if (used - _last_counter_update >= 1024 * 1024) {
- _last_counter_update = used;
- _monitoring_support->update_counters();
- }
- return res;
-}
-
-HeapWord* EpsilonCollectedHeap::allocate_new_tlab(size_t size) {
- return allocate_work(size);
-}
-
-HeapWord* EpsilonCollectedHeap::mem_allocate(size_t size, bool *gc_overhead_limit_was_exceeded) {
- *gc_overhead_limit_was_exceeded = false;
- return allocate_work(size);
-}
-
-void EpsilonCollectedHeap::collect(GCCause::Cause cause) {
- log_info(gc)("GC was triggered with cause \"%s\". Ignoring.", GCCause::to_string(cause));
- _monitoring_support->update_counters();
-}
-
-void EpsilonCollectedHeap::do_full_collection(bool clear_all_soft_refs) {
- log_info(gc)("Full GC was triggered with cause \"%s\". Ignoring.", GCCause::to_string(gc_cause()));
- _monitoring_support->update_counters();
-}
-
-void EpsilonCollectedHeap::safe_object_iterate(ObjectClosure *cl) {
- _space->safe_object_iterate(cl);
-}
-
-void EpsilonCollectedHeap::print_on(outputStream *st) const {
- st->print_cr("Epsilon Heap");
-
- // Cast away constness:
- ((VirtualSpace)_virtual_space).print_on(st);
-
- st->print_cr("Allocation space:");
- _space->print_on(st);
-}
-
-void EpsilonCollectedHeap::print_tracing_info() const {
- Log(gc) log;
- size_t allocated_kb = used() / K;
- log.info("Total allocated: " SIZE_FORMAT " KB",
- allocated_kb);
- log.info("Average allocation rate: " SIZE_FORMAT " KB/sec",
- allocated_kb * NANOSECS_PER_SEC / os::elapsed_counter());
-}
--- a/src/hotspot/share/gc/epsilon/epsilonCollectedHeap.hpp Thu Nov 30 18:43:41 2017 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-/*
- * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-#ifndef SHARE_VM_GC_EPSILON_COLLECTEDHEAP_HPP
-#define SHARE_VM_GC_EPSILON_COLLECTEDHEAP_HPP
-
-#include "gc/shared/collectedHeap.hpp"
-#include "gc/shared/space.hpp"
-#include "gc/epsilon/epsilonCollectorPolicy.hpp"
-#include "gc/epsilon/epsilonMonitoringSupport.hpp"
-#include "gc/epsilon/epsilonBarrierSet.hpp"
-#include "gc/epsilon/epsilon_globals.hpp"
-
-class EpsilonCollectedHeap : public CollectedHeap {
-private:
- EpsilonCollectorPolicy* _policy;
- EpsilonMonitoringSupport* _monitoring_support;
- ContiguousSpace* _space;
- VirtualSpace _virtual_space;
- size_t _max_tlab_size;
- size_t _last_counter_update;
-public:
- EpsilonCollectedHeap(EpsilonCollectorPolicy* p) : _policy(p) {};
-
- virtual Name kind() const {
- return CollectedHeap::EpsilonCollectedHeap;
- }
-
- virtual const char *name() const {
- return "Epsilon GC";
- }
-
- virtual jint initialize();
-
- virtual void post_initialize() {}
-
- static EpsilonCollectedHeap* heap();
-
- virtual size_t capacity() const { return _virtual_space.committed_size(); }
- virtual size_t used() const { return _space->used(); }
- virtual size_t max_capacity() const { return _virtual_space.reserved_size(); }
-
- virtual bool is_maximal_no_gc() const {
- // No GC is going to happen, unless we are at capacity.
- // At which point we will fail anyway.
- return used() == capacity();
- }
-
- virtual bool is_in(const void *p) const { return _space->is_in(p); }
-
- virtual bool is_scavengable(oop obj) {
- // Epsilon does not move objects, no objects are scavengable.
- return false;
- }
-
- HeapWord* allocate_work(size_t size);
- virtual HeapWord* mem_allocate(size_t size, bool *gc_overhead_limit_was_exceeded);
- virtual HeapWord* allocate_new_tlab(size_t size);
-
- // TLAB allocations
- virtual bool supports_tlab_allocation() const { return UseTLAB; }
- virtual size_t tlab_capacity(Thread *thr) const { return capacity(); }
- virtual size_t tlab_used(Thread *thr) const { return used(); }
- virtual size_t max_tlab_size() const { return _max_tlab_size; }
- virtual size_t unsafe_max_tlab_alloc(Thread *thr) const;
-
- virtual bool can_elide_tlab_store_barriers() const {
- // No store barriers for Epsilon, allow elision
- return true;
- }
-
- virtual bool can_elide_initializing_store_barrier(oop new_obj) {
- // No card marks for Epsilon, can elide them all.
- return true;
- }
-
- virtual bool card_mark_must_follow_store() const {
- // No card marks for Epsilon.
- return false;
- }
-
- virtual void collect(GCCause::Cause cause);
- virtual void do_full_collection(bool clear_all_soft_refs);
-
- virtual AdaptiveSizePolicy *size_policy() {
- // No such thing for Epsilon
- return NULL;
- }
-
- virtual CollectorPolicy *collector_policy() const {
- return _policy;
- }
-
- virtual void object_iterate(ObjectClosure *cl) {
- safe_object_iterate(cl);
- }
-
- virtual void safe_object_iterate(ObjectClosure *cl);
-
- virtual HeapWord* block_start(const void *addr) const {
- // Epsilon does not support block parsing.
- return NULL;
- }
-
- virtual size_t block_size(const HeapWord *addr) const {
- // Epsilon does not support block parsing.
- return 0;
- }
-
- virtual bool block_is_obj(const HeapWord *addr) const {
- // Epsilon does not support block parsing.
- return false;
- }
-
- virtual jlong millis_since_last_gc() {
- // Report time since the VM start
- return os::elapsed_counter() / NANOSECS_PER_MILLISEC;
- }
-
- virtual void prepare_for_verify() {
- // No heap verification.
- }
-
- virtual void print_gc_threads_on(outputStream *st) const {
- // No GC threads.
- }
-
- virtual void gc_threads_do(ThreadClosure *tc) const {
- // No GC threads.
- }
-
- virtual void print_on(outputStream *st) const;
- virtual void print_tracing_info() const;
-
- virtual void verify(VerifyOption option) {
- // No heap verification for Epsilon.
- }
-
-};
-
-#endif // SHARE_VM_GC_EPSILON_COLLECTEDHEAP_HPP
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/epsilon/epsilonHeap.cpp Thu Nov 30 18:51:47 2017 +0100
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "gc/epsilon/epsilonHeap.hpp"
+
+jint EpsilonHeap::initialize() {
+ CollectedHeap::pre_initialize();
+
+ size_t init_byte_size = _policy->initial_heap_byte_size();
+ size_t max_byte_size = _policy->max_heap_byte_size();
+ size_t align = _policy->heap_alignment();
+
+ ReservedSpace heap_rs = Universe::reserve_heap(max_byte_size, align);
+ _virtual_space.initialize(heap_rs, init_byte_size);
+
+ MemRegion committed_region((HeapWord*)_virtual_space.low(), (HeapWord*)_virtual_space.high());
+ MemRegion reserved_region((HeapWord*)_virtual_space.low_boundary(), (HeapWord*)_virtual_space.high_boundary());
+
+ initialize_reserved_region(reserved_region.start(), reserved_region.end());
+
+ _space = new ContiguousSpace();
+ _space->initialize(committed_region, true, true);
+
+ EpsilonBarrierSet* bs = new EpsilonBarrierSet();
+ set_barrier_set(bs);
+
+ _max_tlab_size = MIN2(CollectedHeap::max_tlab_size(), EpsilonMaxTLABSize / HeapWordSize);
+
+ _monitoring_support = new EpsilonMonitoringSupport(this);
+ _last_counter_update = 0;
+
+ if (init_byte_size != max_byte_size) {
+ log_info(gc)("Initialized with " SIZE_FORMAT "M heap, resizeable to up to " SIZE_FORMAT "M heap with " SIZE_FORMAT "M steps",
+ init_byte_size / M, max_byte_size / M, EpsilonMinHeapExpand / M);
+ } else {
+ log_info(gc)("Initialized with " SIZE_FORMAT "M non-resizeable heap", init_byte_size / M);
+ }
+ if (UseTLAB) {
+ log_info(gc)("Using TLAB allocation; min: " SIZE_FORMAT "K, max: " SIZE_FORMAT "K",
+ ThreadLocalAllocBuffer::min_size()*HeapWordSize / K,
+ _max_tlab_size*HeapWordSize / K);
+ } else {
+ log_info(gc)("Not using TLAB allocation");
+ }
+
+ return JNI_OK;
+}
+
+size_t EpsilonHeap::unsafe_max_tlab_alloc(Thread *thr) const {
+ // This is the only way we can control TLAB sizes without having safepoints.
+ // Implement exponential expansion within [MinTLABSize; _max_tlab_size], based
+ // on previously "used" TLAB size.
+
+ size_t size = MIN2(_max_tlab_size * HeapWordSize, MAX2(MinTLABSize, thr->tlab().used() * HeapWordSize * 2));
+
+ if (log_is_enabled(Trace, gc)) {
+ ResourceMark rm;
+ log_trace(gc)(
+ "Selecting TLAB size for \"%s\" (Desired: " SIZE_FORMAT "K, Used: " SIZE_FORMAT "K) -> " SIZE_FORMAT "K",
+ Thread::current()->name(),
+ thr->tlab().desired_size() * HeapWordSize / K,
+ thr->tlab().used() * HeapWordSize / K,
+ size / K);
+ }
+
+ return size;
+}
+
+EpsilonHeap* EpsilonHeap::heap() {
+ CollectedHeap* heap = Universe::heap();
+ assert(heap != NULL, "Uninitialized access to EpsilonHeap::heap()");
+ assert(heap->kind() == CollectedHeap::EpsilonHeap, "Not a EpsilonHeap");
+ return (EpsilonHeap*)heap;
+}
+
+HeapWord* EpsilonHeap::allocate_work(size_t size) {
+ HeapWord* res = _space->par_allocate(size);
+
+ while (res == NULL) {
+ // Allocation failed, attempt expansion, and retry:
+ MutexLockerEx ml(Heap_lock);
+ if (!_virtual_space.expand_by(MAX2(size, EpsilonMinHeapExpand))) {
+ return NULL;
+ }
+ _space->set_end((HeapWord *) _virtual_space.high());
+ res = _space->par_allocate(size);
+ }
+
+ size_t used = _space->used();
+ if (used - _last_counter_update >= 1024 * 1024) {
+ _last_counter_update = used;
+ _monitoring_support->update_counters();
+ }
+ return res;
+}
+
+HeapWord* EpsilonHeap::allocate_new_tlab(size_t size) {
+ return allocate_work(size);
+}
+
+HeapWord* EpsilonHeap::mem_allocate(size_t size, bool *gc_overhead_limit_was_exceeded) {
+ *gc_overhead_limit_was_exceeded = false;
+ return allocate_work(size);
+}
+
+void EpsilonHeap::collect(GCCause::Cause cause) {
+ log_info(gc)("GC was triggered with cause \"%s\". Ignoring.", GCCause::to_string(cause));
+ _monitoring_support->update_counters();
+}
+
+void EpsilonHeap::do_full_collection(bool clear_all_soft_refs) {
+ log_info(gc)("Full GC was triggered with cause \"%s\". Ignoring.", GCCause::to_string(gc_cause()));
+ _monitoring_support->update_counters();
+}
+
+void EpsilonHeap::safe_object_iterate(ObjectClosure *cl) {
+ _space->safe_object_iterate(cl);
+}
+
+void EpsilonHeap::print_on(outputStream *st) const {
+ st->print_cr("Epsilon Heap");
+
+ // Cast away constness:
+ ((VirtualSpace)_virtual_space).print_on(st);
+
+ st->print_cr("Allocation space:");
+ _space->print_on(st);
+}
+
+void EpsilonHeap::print_tracing_info() const {
+ Log(gc) log;
+ size_t allocated_kb = used() / K;
+ log.info("Total allocated: " SIZE_FORMAT " KB",
+ allocated_kb);
+ log.info("Average allocation rate: " SIZE_FORMAT " KB/sec",
+ allocated_kb * NANOSECS_PER_SEC / os::elapsed_counter());
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/hotspot/share/gc/epsilon/epsilonHeap.hpp Thu Nov 30 18:51:47 2017 +0100
@@ -0,0 +1,161 @@
+/*
+ * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_GC_EPSILON_COLLECTEDHEAP_HPP
+#define SHARE_VM_GC_EPSILON_COLLECTEDHEAP_HPP
+
+#include "gc/shared/collectedHeap.hpp"
+#include "gc/shared/space.hpp"
+#include "gc/epsilon/epsilonCollectorPolicy.hpp"
+#include "gc/epsilon/epsilonMonitoringSupport.hpp"
+#include "gc/epsilon/epsilonBarrierSet.hpp"
+#include "gc/epsilon/epsilon_globals.hpp"
+
+class EpsilonHeap : public CollectedHeap {
+private:
+ EpsilonCollectorPolicy* _policy;
+ EpsilonMonitoringSupport* _monitoring_support;
+ ContiguousSpace* _space;
+ VirtualSpace _virtual_space;
+ size_t _max_tlab_size;
+ size_t _last_counter_update;
+public:
+ EpsilonHeap(EpsilonCollectorPolicy* p) : _policy(p) {};
+
+ virtual Name kind() const {
+ return CollectedHeap::EpsilonHeap;
+ }
+
+ virtual const char *name() const {
+ return "Epsilon GC";
+ }
+
+ virtual jint initialize();
+
+ virtual void post_initialize() {}
+
+ static EpsilonHeap* heap();
+
+ virtual size_t capacity() const { return _virtual_space.committed_size(); }
+ virtual size_t used() const { return _space->used(); }
+ virtual size_t max_capacity() const { return _virtual_space.reserved_size(); }
+
+ virtual bool is_maximal_no_gc() const {
+ // No GC is going to happen, unless we are at capacity.
+ // At which point we will fail anyway.
+ return used() == capacity();
+ }
+
+ virtual bool is_in(const void *p) const { return _space->is_in(p); }
+
+ virtual bool is_scavengable(oop obj) {
+ // Epsilon does not move objects, no objects are scavengable.
+ return false;
+ }
+
+ HeapWord* allocate_work(size_t size);
+ virtual HeapWord* mem_allocate(size_t size, bool *gc_overhead_limit_was_exceeded);
+ virtual HeapWord* allocate_new_tlab(size_t size);
+
+ // TLAB allocations
+ virtual bool supports_tlab_allocation() const { return UseTLAB; }
+ virtual size_t tlab_capacity(Thread *thr) const { return capacity(); }
+ virtual size_t tlab_used(Thread *thr) const { return used(); }
+ virtual size_t max_tlab_size() const { return _max_tlab_size; }
+ virtual size_t unsafe_max_tlab_alloc(Thread *thr) const;
+
+ virtual bool can_elide_tlab_store_barriers() const {
+ // No store barriers for Epsilon, allow elision
+ return true;
+ }
+
+ virtual bool can_elide_initializing_store_barrier(oop new_obj) {
+ // No card marks for Epsilon, can elide them all.
+ return true;
+ }
+
+ virtual bool card_mark_must_follow_store() const {
+ // No card marks for Epsilon.
+ return false;
+ }
+
+ virtual void collect(GCCause::Cause cause);
+ virtual void do_full_collection(bool clear_all_soft_refs);
+
+ virtual AdaptiveSizePolicy *size_policy() {
+ // No such thing for Epsilon
+ return NULL;
+ }
+
+ virtual CollectorPolicy *collector_policy() const {
+ return _policy;
+ }
+
+ virtual void object_iterate(ObjectClosure *cl) {
+ safe_object_iterate(cl);
+ }
+
+ virtual void safe_object_iterate(ObjectClosure *cl);
+
+ virtual HeapWord* block_start(const void *addr) const {
+ // Epsilon does not support block parsing.
+ return NULL;
+ }
+
+ virtual size_t block_size(const HeapWord *addr) const {
+ // Epsilon does not support block parsing.
+ return 0;
+ }
+
+ virtual bool block_is_obj(const HeapWord *addr) const {
+ // Epsilon does not support block parsing.
+ return false;
+ }
+
+ virtual jlong millis_since_last_gc() {
+ // Report time since the VM start
+ return os::elapsed_counter() / NANOSECS_PER_MILLISEC;
+ }
+
+ virtual void prepare_for_verify() {
+ // No heap verification.
+ }
+
+ virtual void print_gc_threads_on(outputStream *st) const {
+ // No GC threads.
+ }
+
+ virtual void gc_threads_do(ThreadClosure *tc) const {
+ // No GC threads.
+ }
+
+ virtual void print_on(outputStream *st) const;
+ virtual void print_tracing_info() const;
+
+ virtual void verify(VerifyOption option) {
+ // No heap verification for Epsilon.
+ }
+
+};
+
+#endif // SHARE_VM_GC_EPSILON_COLLECTEDHEAP_HPP
--- a/src/hotspot/share/gc/epsilon/epsilonMonitoringSupport.cpp Thu Nov 30 18:43:41 2017 +0100
+++ b/src/hotspot/share/gc/epsilon/epsilonMonitoringSupport.cpp Thu Nov 30 18:51:47 2017 +0100
@@ -25,7 +25,7 @@
#include "services/memoryService.hpp"
#include "gc/shared/generationCounters.hpp"
#include "gc/epsilon/epsilonMonitoringSupport.hpp"
-#include "gc/epsilon/epsilonCollectedHeap.hpp"
+#include "gc/epsilon/epsilonHeap.hpp"
class EpsilonSpaceCounters: public CHeapObj<mtGC> {
friend class VMStructs;
@@ -94,9 +94,9 @@
class EpsilonGenerationCounters : public GenerationCounters {
private:
- EpsilonCollectedHeap* _heap;
+ EpsilonHeap* _heap;
public:
- EpsilonGenerationCounters(EpsilonCollectedHeap* heap) :
+ EpsilonGenerationCounters(EpsilonHeap* heap) :
GenerationCounters("Heap", 1, 1, 0, heap->max_capacity(), heap->capacity()),
_heap(heap)
{};
@@ -106,7 +106,7 @@
}
};
-EpsilonMonitoringSupport::EpsilonMonitoringSupport(EpsilonCollectedHeap* heap) {
+EpsilonMonitoringSupport::EpsilonMonitoringSupport(EpsilonHeap* heap) {
// We report young gen as unused.
_young_counters = new EpsilonYoungGenerationCounters();
_heap_counters = new EpsilonGenerationCounters(heap);
@@ -117,7 +117,7 @@
MemoryService::track_memory_usage();
if (UsePerfData) {
- EpsilonCollectedHeap* heap = EpsilonCollectedHeap::heap();
+ EpsilonHeap* heap = EpsilonHeap::heap();
size_t used = heap->used();
size_t capacity = heap->capacity();
_heap_counters->update_all();
--- a/src/hotspot/share/gc/epsilon/epsilonMonitoringSupport.hpp Thu Nov 30 18:43:41 2017 +0100
+++ b/src/hotspot/share/gc/epsilon/epsilonMonitoringSupport.hpp Thu Nov 30 18:51:47 2017 +0100
@@ -28,7 +28,7 @@
class GenerationCounters;
class EpsilonSpaceCounters;
-class EpsilonCollectedHeap;
+class EpsilonHeap;
class EpsilonMonitoringSupport : public CHeapObj<mtGC> {
private:
@@ -37,7 +37,7 @@
EpsilonSpaceCounters* _space_counters;
public:
- EpsilonMonitoringSupport(EpsilonCollectedHeap* heap);
+ EpsilonMonitoringSupport(EpsilonHeap* heap);
void update_counters();
};
--- a/src/hotspot/share/gc/shared/collectedHeap.hpp Thu Nov 30 18:43:41 2017 +0100
+++ b/src/hotspot/share/gc/shared/collectedHeap.hpp Thu Nov 30 18:51:47 2017 +0100
@@ -198,7 +198,7 @@
ParallelScavengeHeap,
G1CollectedHeap,
CMSHeap,
- EpsilonCollectedHeap,
+ EpsilonHeap,
};
static inline size_t filler_array_max_size() {
--- a/src/hotspot/share/services/epsilonMemoryPool.cpp Thu Nov 30 18:43:41 2017 +0100
+++ b/src/hotspot/share/services/epsilonMemoryPool.cpp Thu Nov 30 18:51:47 2017 +0100
@@ -23,7 +23,7 @@
*/
#include "precompiled.hpp"
-#include "gc/epsilon/epsilonCollectedHeap.hpp"
+#include "gc/epsilon/epsilonHeap.hpp"
#include "services/epsilonMemoryPool.hpp"
EpsilonDummyMemoryPool::EpsilonDummyMemoryPool() :
@@ -33,7 +33,7 @@
0,
false /* support_usage_threshold */) {}
-EpsilonMemoryPool::EpsilonMemoryPool(EpsilonCollectedHeap* heap) :
+EpsilonMemoryPool::EpsilonMemoryPool(EpsilonHeap* heap) :
_heap(heap),
CollectedMemoryPool("Epsilon Heap",
MemoryPool::Heap,
--- a/src/hotspot/share/services/epsilonMemoryPool.hpp Thu Nov 30 18:43:41 2017 +0100
+++ b/src/hotspot/share/services/epsilonMemoryPool.hpp Thu Nov 30 18:51:47 2017 +0100
@@ -26,7 +26,7 @@
#include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
-#include "gc/epsilon/epsilonCollectedHeap.hpp"
+#include "gc/epsilon/epsilonHeap.hpp"
#include "services/memoryPool.hpp"
#include "services/memoryUsage.hpp"
#endif // INCLUDE_ALL_GCS
@@ -42,10 +42,10 @@
class EpsilonMemoryPool : public CollectedMemoryPool {
private:
const static size_t _undefined_max = (size_t) -1;
- EpsilonCollectedHeap* _heap;
+ EpsilonHeap* _heap;
public:
- EpsilonMemoryPool(EpsilonCollectedHeap* heap);
+ EpsilonMemoryPool(EpsilonHeap* heap);
size_t committed_in_bytes() {
return _heap->capacity();
--- a/src/hotspot/share/services/memoryService.cpp Thu Nov 30 18:43:41 2017 +0100
+++ b/src/hotspot/share/services/memoryService.cpp Thu Nov 30 18:51:47 2017 +0100
@@ -101,8 +101,8 @@
add_g1_heap_info(G1CollectedHeap::heap());
break;
}
- case CollectedHeap::EpsilonCollectedHeap : {
- add_epsilon_heap_info(EpsilonCollectedHeap::heap());
+ case CollectedHeap::EpsilonHeap : {
+ add_epsilon_heap_info(EpsilonHeap::heap());
break;
}
#endif // INCLUDE_ALL_GCS
@@ -195,7 +195,7 @@
add_g1OldGen_memory_pool(g1h, _major_gc_manager);
}
-void MemoryService::add_epsilon_heap_info(EpsilonCollectedHeap* eh) {
+void MemoryService::add_epsilon_heap_info(EpsilonHeap* eh) {
assert(UseEpsilonGC, "sanity");
_minor_gc_manager = MemoryManager::get_epsilon_memory_manager();
--- a/src/hotspot/share/services/memoryService.hpp Thu Nov 30 18:43:41 2017 +0100
+++ b/src/hotspot/share/services/memoryService.hpp Thu Nov 30 18:51:47 2017 +0100
@@ -47,7 +47,7 @@
class GenCollectedHeap;
class ParallelScavengeHeap;
class G1CollectedHeap;
-class EpsilonCollectedHeap;
+class EpsilonHeap;
// VM Monitoring and Management Support
@@ -117,7 +117,7 @@
static void add_gen_collected_heap_info(GenCollectedHeap* heap);
static void add_parallel_scavenge_heap_info(ParallelScavengeHeap* heap);
static void add_g1_heap_info(G1CollectedHeap* g1h);
- static void add_epsilon_heap_info(EpsilonCollectedHeap* eh);
+ static void add_epsilon_heap_info(EpsilonHeap* eh);
public:
static void set_universe_heap(CollectedHeap* heap);