aoqi@0: /* aoqi@0: * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: * aoqi@0: */ aoqi@0: aoqi@0: #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_EVACUATIONINFO_HPP aoqi@0: #define SHARE_VM_GC_IMPLEMENTATION_SHARED_EVACUATIONINFO_HPP aoqi@0: aoqi@0: #include "memory/allocation.hpp" aoqi@0: aoqi@0: class EvacuationInfo : public StackObj { aoqi@0: uint _collectionset_regions; aoqi@0: uint _allocation_regions; aoqi@0: size_t _collectionset_used_before; aoqi@0: size_t _collectionset_used_after; aoqi@0: size_t _alloc_regions_used_before; aoqi@0: size_t _bytes_copied; aoqi@0: uint _regions_freed; aoqi@0: aoqi@0: public: aoqi@0: EvacuationInfo() : _collectionset_regions(0), _allocation_regions(0), _collectionset_used_before(0), aoqi@0: _collectionset_used_after(0), _alloc_regions_used_before(0), aoqi@0: _bytes_copied(0), _regions_freed(0) { } aoqi@0: aoqi@0: void set_collectionset_regions(uint collectionset_regions) { aoqi@0: _collectionset_regions = collectionset_regions; aoqi@0: } aoqi@0: aoqi@0: void set_allocation_regions(uint allocation_regions) { aoqi@0: _allocation_regions = allocation_regions; aoqi@0: } aoqi@0: aoqi@0: void set_collectionset_used_before(size_t used) { aoqi@0: _collectionset_used_before = used; aoqi@0: } aoqi@0: aoqi@0: void increment_collectionset_used_after(size_t used) { aoqi@0: _collectionset_used_after += used; aoqi@0: } aoqi@0: aoqi@0: void set_alloc_regions_used_before(size_t used) { aoqi@0: _alloc_regions_used_before = used; aoqi@0: } aoqi@0: aoqi@0: void set_bytes_copied(size_t copied) { aoqi@0: _bytes_copied = copied; aoqi@0: } aoqi@0: aoqi@0: void set_regions_freed(uint freed) { aoqi@0: _regions_freed += freed; aoqi@0: } aoqi@0: aoqi@0: uint collectionset_regions() { return _collectionset_regions; } aoqi@0: uint allocation_regions() { return _allocation_regions; } aoqi@0: size_t collectionset_used_before() { return _collectionset_used_before; } aoqi@0: size_t collectionset_used_after() { return _collectionset_used_after; } aoqi@0: size_t alloc_regions_used_before() { return _alloc_regions_used_before; } aoqi@0: size_t bytes_copied() { return _bytes_copied; } aoqi@0: uint regions_freed() { return _regions_freed; } aoqi@0: }; aoqi@0: aoqi@0: #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_EVACUATIONINFO_HPP