5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 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 // Classes in support of keeping track of promotions into a non-Contiguous 26 // space, in this case a CompactibleFreeListSpace. 27 28 // Forward declarations 29 class CompactibleFreeListSpace; 30 class BlkClosure; 31 class BlkClosureCareful; 32 class UpwardsObjectClosure; 33 class ObjectClosureCareful; 34 class Klass; 35 36 class LinearAllocBlock VALUE_OBJ_CLASS_SPEC { 37 public: 38 LinearAllocBlock() : _ptr(0), _word_size(0), _refillSize(0), 39 _allocation_size_limit(0) {} 40 void set(HeapWord* ptr, size_t word_size, size_t refill_size, 41 size_t allocation_size_limit) { 42 _ptr = ptr; 43 _word_size = word_size; 44 _refillSize = refill_size; 629 CFLS_LAB(CompactibleFreeListSpace* cfls); 630 631 // Allocate and return a block of the given size, or else return NULL. 632 HeapWord* alloc(size_t word_sz); 633 634 // Return any unused portions of the buffer to the global pool. 635 void retire(int tid); 636 637 // Dynamic OldPLABSize sizing 638 static void compute_desired_plab_size(); 639 // When the settings are modified from default static initialization 640 static void modify_initialization(size_t n, unsigned wt); 641 }; 642 643 size_t PromotionInfo::refillSize() const { 644 const size_t CMSSpoolBlockSize = 256; 645 const size_t sz = heap_word_size(sizeof(SpoolBlock) + sizeof(markOop) 646 * CMSSpoolBlockSize); 647 return CompactibleFreeListSpace::adjustObjectSize(sz); 648 } | 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 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_IMPLEMENTATION_CONCURRENTMARKSWEEP_COMPACTIBLEFREELISTSPACE_HPP 26 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_COMPACTIBLEFREELISTSPACE_HPP 27 28 #include "gc_implementation/concurrentMarkSweep/binaryTreeDictionary.hpp" 29 #include "gc_implementation/concurrentMarkSweep/freeList.hpp" 30 #include "gc_implementation/concurrentMarkSweep/promotionInfo.hpp" 31 #include "memory/blockOffsetTable.inline.hpp" 32 #include "memory/space.hpp" 33 34 // Classes in support of keeping track of promotions into a non-Contiguous 35 // space, in this case a CompactibleFreeListSpace. 36 37 // Forward declarations 38 class CompactibleFreeListSpace; 39 class BlkClosure; 40 class BlkClosureCareful; 41 class UpwardsObjectClosure; 42 class ObjectClosureCareful; 43 class Klass; 44 45 class LinearAllocBlock VALUE_OBJ_CLASS_SPEC { 46 public: 47 LinearAllocBlock() : _ptr(0), _word_size(0), _refillSize(0), 48 _allocation_size_limit(0) {} 49 void set(HeapWord* ptr, size_t word_size, size_t refill_size, 50 size_t allocation_size_limit) { 51 _ptr = ptr; 52 _word_size = word_size; 53 _refillSize = refill_size; 638 CFLS_LAB(CompactibleFreeListSpace* cfls); 639 640 // Allocate and return a block of the given size, or else return NULL. 641 HeapWord* alloc(size_t word_sz); 642 643 // Return any unused portions of the buffer to the global pool. 644 void retire(int tid); 645 646 // Dynamic OldPLABSize sizing 647 static void compute_desired_plab_size(); 648 // When the settings are modified from default static initialization 649 static void modify_initialization(size_t n, unsigned wt); 650 }; 651 652 size_t PromotionInfo::refillSize() const { 653 const size_t CMSSpoolBlockSize = 256; 654 const size_t sz = heap_word_size(sizeof(SpoolBlock) + sizeof(markOop) 655 * CMSSpoolBlockSize); 656 return CompactibleFreeListSpace::adjustObjectSize(sz); 657 } 658 659 #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_COMPACTIBLEFREELISTSPACE_HPP |