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 // Forward declarations 26 class CompactibleFreeListSpace; 27 28 class PromotedObject VALUE_OBJ_CLASS_SPEC { 29 private: 30 enum { 31 promoted_mask = right_n_bits(2), // i.e. 0x3 32 displaced_mark = nth_bit(2), // i.e. 0x4 33 next_mask = ~(right_n_bits(3)) // i.e. ~(0x7) 34 }; 35 36 // Below, we want _narrow_next in the "higher" 32 bit slot, 37 // whose position will depend on endian-ness of the platform. 38 // This is so that there is no interference with the 39 // cms_free_bit occupying bit position 7 (lsb == 0) 40 // when we are using compressed oops; see FreeChunk::isFree(). 41 // We cannot move the cms_free_bit down because currently 42 // biased locking code assumes that age bits are contiguous 43 // with the lock bits. Even if that assumption were relaxed, 44 // the least position we could move this bit to would be 187 #undef PROMOTED_OOPS_ITERATE_DECL 188 void promoted_oops_iterate(OopsInGenClosure* cl) { 189 promoted_oops_iterate_v(cl); 190 } 191 void verify() const; 192 void reset() { 193 _promoHead = NULL; 194 _promoTail = NULL; 195 _spoolHead = NULL; 196 _spoolTail = NULL; 197 _spareSpool = NULL; 198 _firstIndex = 0; 199 _nextIndex = 0; 200 201 } 202 203 void print_on(outputStream* st) const; 204 void print_statistics(uint worker_id) const; 205 }; 206 | 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_PROMOTIONINFO_HPP 26 #define SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_PROMOTIONINFO_HPP 27 28 #include "gc_implementation/concurrentMarkSweep/freeChunk.hpp" 29 #include "memory/allocation.hpp" 30 31 // Forward declarations 32 class CompactibleFreeListSpace; 33 34 class PromotedObject VALUE_OBJ_CLASS_SPEC { 35 private: 36 enum { 37 promoted_mask = right_n_bits(2), // i.e. 0x3 38 displaced_mark = nth_bit(2), // i.e. 0x4 39 next_mask = ~(right_n_bits(3)) // i.e. ~(0x7) 40 }; 41 42 // Below, we want _narrow_next in the "higher" 32 bit slot, 43 // whose position will depend on endian-ness of the platform. 44 // This is so that there is no interference with the 45 // cms_free_bit occupying bit position 7 (lsb == 0) 46 // when we are using compressed oops; see FreeChunk::isFree(). 47 // We cannot move the cms_free_bit down because currently 48 // biased locking code assumes that age bits are contiguous 49 // with the lock bits. Even if that assumption were relaxed, 50 // the least position we could move this bit to would be 193 #undef PROMOTED_OOPS_ITERATE_DECL 194 void promoted_oops_iterate(OopsInGenClosure* cl) { 195 promoted_oops_iterate_v(cl); 196 } 197 void verify() const; 198 void reset() { 199 _promoHead = NULL; 200 _promoTail = NULL; 201 _spoolHead = NULL; 202 _spoolTail = NULL; 203 _spareSpool = NULL; 204 _firstIndex = 0; 205 _nextIndex = 0; 206 207 } 208 209 void print_on(outputStream* st) const; 210 void print_statistics(uint worker_id) const; 211 }; 212 213 214 #endif // SHARE_VM_GC_IMPLEMENTATION_CONCURRENTMARKSWEEP_PROMOTIONINFO_HPP |