< prev index next >

src/share/vm/gc/parallel/mutableSpace.hpp

Print this page
rev 11970 : [mq]: base_volatiles


  34 // be only partially full, and the query methods that go with such
  35 // an assumption. MutableSpace is also responsible for minimizing the
  36 // page allocation time by having the memory pretouched (with
  37 // AlwaysPretouch) and for optimizing page placement on NUMA systems
  38 // by make the underlying region interleaved (with UseNUMA).
  39 //
  40 // Invariant: (ImmutableSpace +) bottom() <= top() <= end()
  41 // top() is inclusive and end() is exclusive.
  42 
  43 class MutableSpaceMangler;
  44 
  45 class MutableSpace: public ImmutableSpace {
  46   friend class VMStructs;
  47 
  48   // Helper for mangling unused space in debug builds
  49   MutableSpaceMangler* _mangler;
  50   // The last region which page had been setup to be interleaved.
  51   MemRegion _last_setup_region;
  52   size_t _alignment;
  53  protected:
  54   HeapWord* _top;
  55 
  56   MutableSpaceMangler* mangler() { return _mangler; }
  57 
  58   void numa_setup_pages(MemRegion mr, bool clear_space);
  59   void pretouch_pages(MemRegion mr);
  60 
  61   void set_last_setup_region(MemRegion mr) { _last_setup_region = mr;   }
  62   MemRegion last_setup_region() const      { return _last_setup_region; }
  63 
  64  public:
  65   virtual ~MutableSpace();
  66   MutableSpace(size_t page_size);
  67 
  68   // Accessors
  69   HeapWord* top() const                    { return _top;    }
  70   virtual void set_top(HeapWord* value)    { _top = value;   }
  71 
  72   HeapWord** top_addr()                    { return &_top; }
  73   HeapWord** end_addr()                    { return &_end; }
  74 
  75   virtual void set_bottom(HeapWord* value) { _bottom = value; }
  76   virtual void set_end(HeapWord* value)    { _end = value; }
  77 
  78   size_t alignment()                       { return _alignment; }
  79 
  80   // Returns a subregion containing all objects in this space.
  81   MemRegion used_region() { return MemRegion(bottom(), top()); }
  82 
  83   static const bool SetupPages = true;
  84   static const bool DontSetupPages = false;
  85 
  86   // Initialization
  87   virtual void initialize(MemRegion mr,
  88                           bool clear_space,
  89                           bool mangle_space,
  90                           bool setup_pages = SetupPages);
  91 
  92   virtual void clear(bool mangle_space);




  34 // be only partially full, and the query methods that go with such
  35 // an assumption. MutableSpace is also responsible for minimizing the
  36 // page allocation time by having the memory pretouched (with
  37 // AlwaysPretouch) and for optimizing page placement on NUMA systems
  38 // by make the underlying region interleaved (with UseNUMA).
  39 //
  40 // Invariant: (ImmutableSpace +) bottom() <= top() <= end()
  41 // top() is inclusive and end() is exclusive.
  42 
  43 class MutableSpaceMangler;
  44 
  45 class MutableSpace: public ImmutableSpace {
  46   friend class VMStructs;
  47 
  48   // Helper for mangling unused space in debug builds
  49   MutableSpaceMangler* _mangler;
  50   // The last region which page had been setup to be interleaved.
  51   MemRegion _last_setup_region;
  52   size_t _alignment;
  53  protected:
  54   HeapWord* volatile _top;
  55 
  56   MutableSpaceMangler* mangler() { return _mangler; }
  57 
  58   void numa_setup_pages(MemRegion mr, bool clear_space);
  59   void pretouch_pages(MemRegion mr);
  60 
  61   void set_last_setup_region(MemRegion mr) { _last_setup_region = mr;   }
  62   MemRegion last_setup_region() const      { return _last_setup_region; }
  63 
  64  public:
  65   virtual ~MutableSpace();
  66   MutableSpace(size_t page_size);
  67 
  68   // Accessors
  69   HeapWord* top() const                    { return _top;    }
  70   virtual void set_top(HeapWord* value)    { _top = value;   }
  71 
  72   HeapWord* volatile* top_addr()                    { return &_top; }
  73   HeapWord** end_addr()                    { return &_end; }
  74 
  75   virtual void set_bottom(HeapWord* value) { _bottom = value; }
  76   virtual void set_end(HeapWord* value)    { _end = value; }
  77 
  78   size_t alignment()                       { return _alignment; }
  79 
  80   // Returns a subregion containing all objects in this space.
  81   MemRegion used_region() { return MemRegion(bottom(), top()); }
  82 
  83   static const bool SetupPages = true;
  84   static const bool DontSetupPages = false;
  85 
  86   // Initialization
  87   virtual void initialize(MemRegion mr,
  88                           bool clear_space,
  89                           bool mangle_space,
  90                           bool setup_pages = SetupPages);
  91 
  92   virtual void clear(bool mangle_space);


< prev index next >