annotate src/hotspot/share/gc/epsilon/epsilonHeap.hpp @ 56354:4b9449c330fb

Fix non-PCH build
author shade
date Mon, 26 Mar 2018 17:27:47 +0200
parents ebb84e128ed3
children b09629f4b243
rev   line source
shade@55767 1 /*
shade@56350 2 * Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
shade@55767 3 *
shade@55767 4 * This code is free software; you can redistribute it and/or modify it
shade@55767 5 * under the terms of the GNU General Public License version 2 only, as
shade@55767 6 * published by the Free Software Foundation.
shade@55767 7 *
shade@55767 8 * This code is distributed in the hope that it will be useful, but WITHOUT
shade@55767 9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
shade@55767 10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
shade@55767 11 * version 2 for more details (a copy is included in the LICENSE file that
shade@55767 12 * accompanied this code).
shade@55767 13 *
shade@55767 14 * You should have received a copy of the GNU General Public License version
shade@55767 15 * 2 along with this work; if not, write to the Free Software Foundation,
shade@55767 16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
shade@55767 17 *
shade@55767 18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
shade@55767 19 * or visit www.oracle.com if you need additional information or have any
shade@55767 20 * questions.
shade@55767 21 *
shade@55767 22 */
shade@55767 23
shade@55767 24 #ifndef SHARE_VM_GC_EPSILON_COLLECTEDHEAP_HPP
shade@55767 25 #define SHARE_VM_GC_EPSILON_COLLECTEDHEAP_HPP
shade@55767 26
shade@55767 27 #include "gc/shared/collectedHeap.hpp"
shade@56354 28 #include "gc/shared/softRefPolicy.hpp"
shade@55767 29 #include "gc/shared/space.hpp"
shade@55975 30 #include "services/memoryManager.hpp"
shade@55767 31 #include "gc/epsilon/epsilonCollectorPolicy.hpp"
shade@55767 32 #include "gc/epsilon/epsilonMonitoringSupport.hpp"
shade@55767 33 #include "gc/epsilon/epsilonBarrierSet.hpp"
shade@55767 34 #include "gc/epsilon/epsilon_globals.hpp"
shade@55767 35
shade@55939 36 class EpsilonHeap : public CollectedHeap {
shade@55767 37 private:
shade@55767 38 EpsilonCollectorPolicy* _policy;
shade@56276 39 SoftRefPolicy _soft_ref_policy;
shade@55767 40 EpsilonMonitoringSupport* _monitoring_support;
shade@55975 41 MemoryPool* _pool;
shade@55975 42 GCMemoryManager _memory_manager;
shade@55767 43 ContiguousSpace* _space;
shade@55767 44 VirtualSpace _virtual_space;
shade@55767 45 size_t _max_tlab_size;
shade@55767 46 size_t _last_counter_update;
shade@55979 47 size_t _last_heap_print;
shade@55979 48 size_t _step_counter_update;
shade@55979 49 size_t _step_heap_print;
shade@55767 50 public:
shade@55975 51 EpsilonHeap(EpsilonCollectorPolicy* p) :
shade@55975 52 _policy(p),
shade@55975 53 _memory_manager("Epsilon Heap", "") {};
shade@55767 54
shade@55767 55 virtual Name kind() const {
shade@55939 56 return CollectedHeap::EpsilonHeap;
shade@55767 57 }
shade@55767 58
shade@56352 59 virtual const char* name() const {
shade@56352 60 return "Epsilon";
shade@55767 61 }
shade@55767 62
shade@55767 63 virtual jint initialize();
shade@55767 64
shade@55974 65 virtual void post_initialize();
shade@55974 66
shade@55974 67 virtual void initialize_serviceability();
shade@55974 68 virtual GrowableArray<GCMemoryManager*> memory_managers();
shade@55974 69 virtual GrowableArray<MemoryPool*> memory_pools();
shade@55767 70
shade@55939 71 static EpsilonHeap* heap();
shade@55767 72
shade@55767 73 virtual size_t capacity() const { return _virtual_space.committed_size(); }
shade@55767 74 virtual size_t used() const { return _space->used(); }
shade@55767 75 virtual size_t max_capacity() const { return _virtual_space.reserved_size(); }
shade@55767 76
shade@55767 77 virtual bool is_maximal_no_gc() const {
shade@55767 78 // No GC is going to happen, unless we are at capacity.
shade@55767 79 // At which point we will fail anyway.
shade@55767 80 return used() == capacity();
shade@55767 81 }
shade@55767 82
shade@56352 83 virtual bool is_in(const void* p) const { return _space->is_in(p); }
shade@55767 84
shade@55767 85 virtual bool is_scavengable(oop obj) {
shade@56352 86 // No GC is going to happen, therefore no objects ever move.
shade@55767 87 return false;
shade@55767 88 }
shade@55767 89
shade@55767 90 HeapWord* allocate_work(size_t size);
shade@56352 91 virtual HeapWord* mem_allocate(size_t size, bool* gc_overhead_limit_was_exceeded);
shade@55767 92 virtual HeapWord* allocate_new_tlab(size_t size);
shade@55767 93
shade@55767 94 // TLAB allocations
shade@55767 95 virtual bool supports_tlab_allocation() const { return UseTLAB; }
shade@56352 96 virtual size_t tlab_capacity(Thread* thr) const { return capacity(); }
shade@56352 97 virtual size_t tlab_used(Thread* thr) const { return used(); }
shade@55767 98 virtual size_t max_tlab_size() const { return _max_tlab_size; }
shade@56352 99 virtual size_t unsafe_max_tlab_alloc(Thread* thr) const;
shade@55767 100
shade@55767 101 virtual void collect(GCCause::Cause cause);
shade@55767 102 virtual void do_full_collection(bool clear_all_soft_refs);
shade@55767 103
shade@56352 104 virtual AdaptiveSizePolicy* size_policy() {
shade@55767 105 // No such thing for Epsilon
shade@55767 106 return NULL;
shade@55767 107 }
shade@55767 108
shade@56352 109 virtual CollectorPolicy* collector_policy() const {
shade@55767 110 return _policy;
shade@55767 111 }
shade@55767 112
shade@56276 113 virtual SoftRefPolicy* soft_ref_policy() {
shade@56276 114 return &_soft_ref_policy;
shade@56276 115 }
shade@56276 116
shade@56352 117 virtual void object_iterate(ObjectClosure* cl) {
shade@55767 118 safe_object_iterate(cl);
shade@55767 119 }
shade@55767 120
shade@56352 121 virtual void safe_object_iterate(ObjectClosure* cl);
shade@55767 122
shade@56352 123 virtual HeapWord* block_start(const void* addr) const {
shade@56352 124 // No support for block parsing.
shade@55767 125 return NULL;
shade@55767 126 }
shade@55767 127
shade@56352 128 virtual size_t block_size(const HeapWord* addr) const {
shade@56352 129 // No support for block parsing.
shade@55767 130 return 0;
shade@55767 131 }
shade@55767 132
shade@56352 133 virtual bool block_is_obj(const HeapWord* addr) const {
shade@56352 134 // No support for block parsing.
shade@55767 135 return false;
shade@55767 136 }
shade@55767 137
shade@55767 138 virtual jlong millis_since_last_gc() {
shade@55767 139 // Report time since the VM start
shade@55767 140 return os::elapsed_counter() / NANOSECS_PER_MILLISEC;
shade@55767 141 }
shade@55767 142
shade@56352 143 virtual void print_gc_threads_on(outputStream* st) const {
shade@56352 144 // No GC threads.
shade@56352 145 }
shade@56352 146
shade@56352 147 virtual void gc_threads_do(ThreadClosure* tc) const {
shade@56352 148 // No GC threads.
shade@56352 149 }
shade@56352 150
shade@56352 151 virtual void print_on(outputStream* st) const;
shade@56352 152 virtual void print_tracing_info() const;
shade@56352 153
shade@55767 154 virtual void prepare_for_verify() {
shade@55767 155 // No heap verification.
shade@55767 156 }
shade@55767 157
shade@55767 158 virtual void verify(VerifyOption option) {
shade@56352 159 // No heap verification.
shade@55767 160 }
shade@55767 161
shade@55767 162 };
shade@55767 163
shade@55767 164 #endif // SHARE_VM_GC_EPSILON_COLLECTEDHEAP_HPP