< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahCollectionSet.hpp

Print this page
*** 1,7 ***
--- 1,8 ---
  /*
   * Copyright (c) 2016, 2020, Red Hat, Inc. All rights reserved.
+  * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * 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.

*** 41,14 ***
--- 42,36 ---
    // Bias cset map's base address for fast test if an oop is in cset
    char* const           _biased_cset_map;
  
    ShenandoahHeap* const _heap;
  
+   bool                  _has_old_regions;
    size_t                _garbage;
    size_t                _used;
+   size_t                _live;
    size_t                _region_count;
  
+   size_t                _young_bytes_to_evacuate;
+   size_t                _young_bytes_to_promote;
+   size_t                _old_bytes_to_evacuate;
+ 
+   size_t                _young_region_count;
+   size_t                _old_region_count;
+ 
+   // How many bytes of old garbage are present in a mixed collection set?
+   size_t                _old_garbage;
+ 
+   // Points to array identifying which tenure-age regions have been preselected
+   // for inclusion in collection set. This field is only valid during brief
+   // spans of time while collection set is being constructed.
+   bool*                 _preselected_regions;
+ 
+   // When a region having memory available to be allocated is added to the collection set, the region's available memory
+   // should be subtracted from what's available.
+   size_t                _young_available_bytes_collected;
+   size_t                _old_available_bytes_collected;
+ 
    shenandoah_padding(0);
    volatile size_t       _current_index;
    shenandoah_padding(1);
  
  public:

*** 75,12 ***
    inline bool is_in(oop obj)                 const;
    inline bool is_in_loc(void* loc)           const;
  
    void print_on(outputStream* out) const;
  
!   size_t used()      const { return _used; }
!   size_t garbage()   const { return _garbage;   }
    void clear();
  
  private:
    char* map_address() const {
      return _cset_map;
--- 98,40 ---
    inline bool is_in(oop obj)                 const;
    inline bool is_in_loc(void* loc)           const;
  
    void print_on(outputStream* out) const;
  
!   // This represents total amount of work to be performed by evacuation, including evacuations to young, to old,
!   // and promotions from young to old.  This equals get_young_bytes_reserved_for_evacuation() plus
+   // get_old_bytes_reserved_for_evacuation().
+   // TODO: Seems unused.
+   inline size_t get_bytes_reserved_for_evacuation();
+ 
+   // It is not known how many of these bytes will be promoted.
+   inline size_t get_young_bytes_reserved_for_evacuation();
+   inline size_t get_old_bytes_reserved_for_evacuation();
+ 
+   inline size_t get_young_bytes_to_be_promoted();
+ 
+   size_t get_young_available_bytes_collected() { return _young_available_bytes_collected; }
+ 
+   size_t get_old_available_bytes_collected() { return _old_available_bytes_collected; }
+ 
+   inline size_t get_old_region_count();
+   inline size_t get_young_region_count();
+ 
+   inline size_t get_old_garbage();
+ 
+   void establish_preselected(bool *preselected) { _preselected_regions = preselected; }
+   void abandon_preselected() { _preselected_regions = nullptr; }
+   bool is_preselected(size_t region_idx) { return (_preselected_regions != nullptr) && _preselected_regions[region_idx]; }
+ 
+   bool has_old_regions() const { return _has_old_regions; }
+   size_t used()          const { return _used; }
+   size_t live()          const { return _live; }
+   size_t garbage()       const { return _garbage; }
+ 
    void clear();
  
  private:
    char* map_address() const {
      return _cset_map;
< prev index next >