14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_G1_G1REGIONTOSPACEMAPPER_HPP
26 #define SHARE_VM_GC_G1_G1REGIONTOSPACEMAPPER_HPP
27
28 #include "gc/g1/g1PageBasedVirtualSpace.hpp"
29 #include "memory/allocation.hpp"
30 #include "utilities/debug.hpp"
31
32 class WorkGang;
33
34 class G1MappingChangedListener VALUE_OBJ_CLASS_SPEC {
35 public:
36 // Fired after commit of the memory, i.e. the memory this listener is registered
37 // for can be accessed.
38 // Zero_filled indicates that the memory can be considered as filled with zero bytes
39 // when called.
40 virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled) = 0;
41 };
42
43 // Maps region based commit/uncommit requests to the underlying page sized virtual
44 // space.
45 class G1RegionToSpaceMapper : public CHeapObj<mtGC> {
46 private:
47 G1MappingChangedListener* _listener;
48 protected:
49 // Backing storage.
50 G1PageBasedVirtualSpace _storage;
51
52 size_t _region_granularity;
53 // Mapping management
54 CHeapBitMap _commit_map;
|
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_G1_G1REGIONTOSPACEMAPPER_HPP
26 #define SHARE_VM_GC_G1_G1REGIONTOSPACEMAPPER_HPP
27
28 #include "gc/g1/g1PageBasedVirtualSpace.hpp"
29 #include "memory/allocation.hpp"
30 #include "utilities/debug.hpp"
31
32 class WorkGang;
33
34 class G1MappingChangedListener {
35 public:
36 // Fired after commit of the memory, i.e. the memory this listener is registered
37 // for can be accessed.
38 // Zero_filled indicates that the memory can be considered as filled with zero bytes
39 // when called.
40 virtual void on_commit(uint start_idx, size_t num_regions, bool zero_filled) = 0;
41 };
42
43 // Maps region based commit/uncommit requests to the underlying page sized virtual
44 // space.
45 class G1RegionToSpaceMapper : public CHeapObj<mtGC> {
46 private:
47 G1MappingChangedListener* _listener;
48 protected:
49 // Backing storage.
50 G1PageBasedVirtualSpace _storage;
51
52 size_t _region_granularity;
53 // Mapping management
54 CHeapBitMap _commit_map;
|