--- old/src/hotspot/share/gc/shared/genCollectedHeap.hpp 2017-10-18 14:02:31.871429492 +0200 +++ new/src/hotspot/share/gc/shared/genCollectedHeap.hpp 2017-10-18 14:02:31.408428360 +0200 @@ -161,10 +161,10 @@ // The generational collector policy. GenCollectorPolicy* gen_policy() const { return _gen_policy; } - CollectorPolicy* collector_policy() const { return gen_policy(); } + virtual CollectorPolicy* collector_policy() const { return gen_policy(); } // Adaptive size policy - AdaptiveSizePolicy* size_policy() { + virtual AdaptiveSizePolicy* size_policy() { return gen_policy()->size_policy(); } @@ -217,7 +217,7 @@ bool is_in_partial_collection(const void* p); #endif - bool is_scavengable(oop obj) { + virtual bool is_scavengable(oop obj) { return is_in_young(obj); } @@ -245,32 +245,32 @@ // address "addr". We say "blocks" instead of "object" since some heaps // may not pack objects densely; a chunk may either be an object or a // non-object. - HeapWord* block_start(const void* addr) const; + virtual HeapWord* block_start(const void* addr) const; // Requires "addr" to be the start of a chunk, and returns its size. // "addr + size" is required to be the start of a new chunk, or the end // of the active area of the heap. Assumes (and verifies in non-product // builds) that addr is in the allocated part of the heap and is // the start of a chunk. - size_t block_size(const HeapWord* addr) const; + virtual size_t block_size(const HeapWord* addr) const; // Requires "addr" to be the start of a block, and returns "TRUE" iff // the block is an object. Assumes (and verifies in non-product // builds) that addr is in the allocated part of the heap and is // the start of a chunk. - bool block_is_obj(const HeapWord* addr) const; + virtual bool block_is_obj(const HeapWord* addr) const; // Section on TLAB's. - bool supports_tlab_allocation() const; - size_t tlab_capacity(Thread* thr) const; - size_t tlab_used(Thread* thr) const; - size_t unsafe_max_tlab_alloc(Thread* thr) const; - HeapWord* allocate_new_tlab(size_t size); + virtual bool supports_tlab_allocation() const; + virtual size_t tlab_capacity(Thread* thr) const; + virtual size_t tlab_used(Thread* thr) const; + virtual size_t unsafe_max_tlab_alloc(Thread* thr) const; + virtual HeapWord* allocate_new_tlab(size_t size); // Can a compiler initialize a new object without store barriers? // This permission only extends from the creation of a new object // via a TLAB up to the first subsequent safepoint. - bool can_elide_tlab_store_barriers() const { + virtual bool can_elide_tlab_store_barriers() const { return true; } @@ -279,7 +279,7 @@ // objects therein. This applies to DefNew+Tenured and ParNew+CMS // only and may need to be re-examined in case other // kinds of collectors are implemented in the future. - bool can_elide_initializing_store_barrier(oop new_obj) { + virtual bool can_elide_initializing_store_barrier(oop new_obj) { return is_in_young(new_obj); } @@ -295,11 +295,11 @@ void release_scratch(); // Ensure parsability: override - void ensure_parsability(bool retire_tlabs); + virtual void ensure_parsability(bool retire_tlabs); // Time in ms since the longest time a collector ran in // in any generation. - jlong millis_since_last_gc(); + virtual jlong millis_since_last_gc(); // Total number of full collections completed. unsigned int total_full_collections_completed() { @@ -333,10 +333,10 @@ void verify(VerifyOption option); // Override. - void print_on(outputStream* st) const; + virtual void print_on(outputStream* st) const; virtual void print_gc_threads_on(outputStream* st) const; virtual void gc_threads_do(ThreadClosure* tc) const; - void print_tracing_info() const; + virtual void print_tracing_info() const; void print_heap_change(size_t young_prev_used, size_t old_prev_used) const; @@ -356,7 +356,7 @@ // Return "true" if all generations have reached the // maximal committed limit that they can reach, without a garbage // collection. - bool is_maximal_no_gc() const; + virtual bool is_maximal_no_gc() const; // This function returns the CardTableRS object that allows us to scan // generations in a fully generational heap.