43 // ========= <--- low_boundary for H, high_boundary for L
44 // | |
45 // | |
46 // | |
47 // --------- <--- high for L
48 // | |
49 // | L |
50 // | |
51 // | |
52 // | |
53 // +-------+ <--- low_boundary for L
54 //
55 // Each virtual space in the AdjoiningVirtualSpaces grows and shrink
56 // within its reserved region (between the low_boundary and the
57 // boundary) independently. If L want to grow above its high_boundary,
58 // then the high_boundary of L and the low_boundary of H must be
59 // moved up consistently. AdjoiningVirtualSpaces provide the
60 // interfaces for moving the this boundary.
61
62 class AdjoiningVirtualSpaces : public CHeapObj<mtGC> {
63 // space at the high end and the low end, respectively
64 PSVirtualSpace* _high;
65 PSVirtualSpace* _low;
66
67 protected:
68 // The reserved space spanned by the two spaces.
69 ReservedSpace _reserved_space;
70
71 // The minimum byte size for the low space. It will not
72 // be shrunk below this value.
73 size_t _min_low_byte_size;
74 // Same for the high space
75 size_t _min_high_byte_size;
76
77 const size_t _alignment;
78
79 public:
80 // Allocates two virtual spaces that will be located at the
81 // high and low ends. Does no initialization.
82 AdjoiningVirtualSpaces(ReservedSpace rs,
83 size_t min_low_byte_size,
84 size_t min_high_byte_size,
85 size_t alignment);
86
87 // accessors
91 size_t min_low_byte_size() { return _min_low_byte_size; }
92 size_t min_high_byte_size() { return _min_high_byte_size; }
93 size_t alignment() const { return _alignment; }
94
95 // move boundary between the two spaces up
96 virtual bool adjust_boundary_up(size_t size_in_bytes);
97 // and down
98 virtual bool adjust_boundary_down(size_t size_in_bytes);
99
100 // Maximum byte size for the high space.
101 size_t high_byte_size_limit() {
102 return _reserved_space.size() - _min_low_byte_size;
103 }
104 // Maximum byte size for the low space.
105 size_t low_byte_size_limit() {
106 return _reserved_space.size() - _min_high_byte_size;
107 }
108
109 // Sets the boundaries for the virtual spaces and commits and
110 // initial size;
111 void initialize(size_t max_low_byte_size,
112 size_t init_low_byte_size,
113 size_t init_high_byte_size);
114 };
115 #endif // SHARE_VM_GC_PARALLEL_ADJOININGVIRTUALSPACES_HPP
|
43 // ========= <--- low_boundary for H, high_boundary for L
44 // | |
45 // | |
46 // | |
47 // --------- <--- high for L
48 // | |
49 // | L |
50 // | |
51 // | |
52 // | |
53 // +-------+ <--- low_boundary for L
54 //
55 // Each virtual space in the AdjoiningVirtualSpaces grows and shrink
56 // within its reserved region (between the low_boundary and the
57 // boundary) independently. If L want to grow above its high_boundary,
58 // then the high_boundary of L and the low_boundary of H must be
59 // moved up consistently. AdjoiningVirtualSpaces provide the
60 // interfaces for moving the this boundary.
61
62 class AdjoiningVirtualSpaces : public CHeapObj<mtGC> {
63 protected:
64 // space at the high end and the low end, respectively
65 PSVirtualSpace* _high;
66 PSVirtualSpace* _low;
67
68 // The reserved space spanned by the two spaces.
69 ReservedSpace _reserved_space;
70
71 // The minimum byte size for the low space. It will not
72 // be shrunk below this value.
73 size_t _min_low_byte_size;
74 // Same for the high space
75 size_t _min_high_byte_size;
76
77 const size_t _alignment;
78
79 public:
80 // Allocates two virtual spaces that will be located at the
81 // high and low ends. Does no initialization.
82 AdjoiningVirtualSpaces(ReservedSpace rs,
83 size_t min_low_byte_size,
84 size_t min_high_byte_size,
85 size_t alignment);
86
87 // accessors
91 size_t min_low_byte_size() { return _min_low_byte_size; }
92 size_t min_high_byte_size() { return _min_high_byte_size; }
93 size_t alignment() const { return _alignment; }
94
95 // move boundary between the two spaces up
96 virtual bool adjust_boundary_up(size_t size_in_bytes);
97 // and down
98 virtual bool adjust_boundary_down(size_t size_in_bytes);
99
100 // Maximum byte size for the high space.
101 size_t high_byte_size_limit() {
102 return _reserved_space.size() - _min_low_byte_size;
103 }
104 // Maximum byte size for the low space.
105 size_t low_byte_size_limit() {
106 return _reserved_space.size() - _min_high_byte_size;
107 }
108
109 // Sets the boundaries for the virtual spaces and commits and
110 // initial size;
111 virtual void initialize(size_t max_low_byte_size,
112 size_t init_low_byte_size,
113 size_t init_high_byte_size);
114 };
115 #endif // SHARE_VM_GC_PARALLEL_ADJOININGVIRTUALSPACES_HPP
|