src/hotspot/share/gc/z/zHeap.hpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54834 39ba09047e19
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
    22  */
    22  */
    23 
    23 
    24 #ifndef SHARE_GC_Z_ZHEAP_HPP
    24 #ifndef SHARE_GC_Z_ZHEAP_HPP
    25 #define SHARE_GC_Z_ZHEAP_HPP
    25 #define SHARE_GC_Z_ZHEAP_HPP
    26 
    26 
    27 #include "gc/shared/gcTimer.hpp"
       
    28 #include "gc/z/zAllocationFlags.hpp"
    27 #include "gc/z/zAllocationFlags.hpp"
    29 #include "gc/z/zArray.hpp"
       
    30 #include "gc/z/zForwardingTable.hpp"
    28 #include "gc/z/zForwardingTable.hpp"
    31 #include "gc/z/zList.hpp"
       
    32 #include "gc/z/zLock.hpp"
       
    33 #include "gc/z/zMark.hpp"
    29 #include "gc/z/zMark.hpp"
    34 #include "gc/z/zObjectAllocator.hpp"
    30 #include "gc/z/zObjectAllocator.hpp"
    35 #include "gc/z/zPage.hpp"
    31 #include "gc/z/zPage.hpp"
    36 #include "gc/z/zPageAllocator.hpp"
    32 #include "gc/z/zPageAllocator.hpp"
    37 #include "gc/z/zPageTable.hpp"
    33 #include "gc/z/zPageTable.hpp"
    38 #include "gc/z/zReferenceProcessor.hpp"
    34 #include "gc/z/zReferenceProcessor.hpp"
    39 #include "gc/z/zRelocate.hpp"
    35 #include "gc/z/zRelocate.hpp"
    40 #include "gc/z/zRelocationSet.hpp"
    36 #include "gc/z/zRelocationSet.hpp"
    41 #include "gc/z/zRelocationSetSelector.hpp"
       
    42 #include "gc/z/zRootsIterator.hpp"
       
    43 #include "gc/z/zWeakRootsProcessor.hpp"
    37 #include "gc/z/zWeakRootsProcessor.hpp"
    44 #include "gc/z/zServiceability.hpp"
    38 #include "gc/z/zServiceability.hpp"
    45 #include "gc/z/zUnload.hpp"
    39 #include "gc/z/zUnload.hpp"
    46 #include "gc/z/zWorkers.hpp"
    40 #include "gc/z/zWorkers.hpp"
    47 #include "memory/allocation.hpp"
       
    48 
    41 
    49 class ZHeap {
    42 class ZHeap {
    50   friend class VMStructs;
    43   friend class VMStructs;
    51 
    44 
    52 private:
    45 private:
    87   bool is_initialized() const;
    80   bool is_initialized() const;
    88 
    81 
    89   // Heap metrics
    82   // Heap metrics
    90   size_t min_capacity() const;
    83   size_t min_capacity() const;
    91   size_t max_capacity() const;
    84   size_t max_capacity() const;
    92   size_t current_max_capacity() const;
    85   size_t soft_max_capacity() const;
    93   size_t capacity() const;
    86   size_t capacity() const;
    94   size_t max_reserve() const;
    87   size_t max_reserve() const;
    95   size_t used_high() const;
    88   size_t used_high() const;
    96   size_t used_low() const;
    89   size_t used_low() const;
    97   size_t used() const;
    90   size_t used() const;
   103   size_t tlab_used() const;
    96   size_t tlab_used() const;
   104   size_t max_tlab_size() const;
    97   size_t max_tlab_size() const;
   105   size_t unsafe_max_tlab_alloc() const;
    98   size_t unsafe_max_tlab_alloc() const;
   106 
    99 
   107   bool is_in(uintptr_t addr) const;
   100   bool is_in(uintptr_t addr) const;
   108   uint32_t hash_oop(oop obj) const;
   101   uint32_t hash_oop(uintptr_t addr) const;
   109 
       
   110   // Block
       
   111   uintptr_t block_start(uintptr_t addr) const;
       
   112   bool block_is_obj(uintptr_t addr) const;
       
   113 
   102 
   114   // Workers
   103   // Workers
   115   uint nconcurrent_worker_threads() const;
   104   uint nconcurrent_worker_threads() const;
   116   uint nconcurrent_no_boost_worker_threads() const;
   105   uint nconcurrent_no_boost_worker_threads() const;
   117   void set_boost_worker_threads(bool boost);
   106   void set_boost_worker_threads(bool boost);
   142   void check_out_of_memory();
   131   void check_out_of_memory();
   143 
   132 
   144   // Marking
   133   // Marking
   145   bool is_object_live(uintptr_t addr) const;
   134   bool is_object_live(uintptr_t addr) const;
   146   bool is_object_strongly_live(uintptr_t addr) const;
   135   bool is_object_strongly_live(uintptr_t addr) const;
   147   template <bool finalizable, bool publish> void mark_object(uintptr_t addr);
   136   template <bool follow, bool finalizable, bool publish> void mark_object(uintptr_t addr);
   148   void mark_start();
   137   void mark_start();
   149   void mark(bool initial);
   138   void mark(bool initial);
   150   void mark_flush_and_free(Thread* thread);
   139   void mark_flush_and_free(Thread* thread);
   151   bool mark_end();
   140   bool mark_end();
   152 
   141 
   159   uintptr_t relocate_object(uintptr_t addr);
   148   uintptr_t relocate_object(uintptr_t addr);
   160   uintptr_t remap_object(uintptr_t addr);
   149   uintptr_t remap_object(uintptr_t addr);
   161   void relocate();
   150   void relocate();
   162 
   151 
   163   // Iteration
   152   // Iteration
   164   void object_iterate(ObjectClosure* cl, bool visit_referents);
   153   void object_iterate(ObjectClosure* cl, bool visit_weaks);
   165 
   154 
   166   // Serviceability
   155   // Serviceability
   167   void serviceability_initialize();
   156   void serviceability_initialize();
   168   GCMemoryManager* serviceability_memory_manager();
   157   GCMemoryManager* serviceability_memory_manager();
   169   MemoryPool* serviceability_memory_pool();
   158   MemoryPool* serviceability_memory_pool();
   170   ZServiceabilityCounters* serviceability_counters();
   159   ZServiceabilityCounters* serviceability_counters();
   171 
   160 
   172   // Printing
   161   // Printing
   173   void print_on(outputStream* st) const;
   162   void print_on(outputStream* st) const;
   174   void print_extended_on(outputStream* st) const;
   163   void print_extended_on(outputStream* st) const;
       
   164   bool print_location(outputStream* st, uintptr_t addr) const;
   175 
   165 
   176   // Verification
   166   // Verification
   177   bool is_oop(oop object) const;
   167   bool is_oop(uintptr_t addr) const;
   178   void verify();
   168   void verify();
   179 };
   169 };
   180 
   170 
   181 #endif // SHARE_GC_Z_ZHEAP_HPP
   171 #endif // SHARE_GC_Z_ZHEAP_HPP