comparison src/share/vm/memory/blockOffsetTable.cpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents d2a62e0f25eb
children 746b070f5022
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
95 assert(p >= _reserved.start(), "just checking"); 95 assert(p >= _reserved.start(), "just checking");
96 size_t delta = pointer_delta(p, _reserved.start()); 96 size_t delta = pointer_delta(p, _reserved.start());
97 return (delta & right_n_bits(LogN_words)) == (size_t)NoBits; 97 return (delta & right_n_bits(LogN_words)) == (size_t)NoBits;
98 } 98 }
99 99
100
101 void BlockOffsetSharedArray::serialize(SerializeOopClosure* soc,
102 HeapWord* start, HeapWord* end) {
103 assert(_offset_array[0] == 0, "objects can't cross covered areas");
104 assert(start <= end, "bad address range");
105 size_t start_index = index_for(start);
106 size_t end_index = index_for(end-1)+1;
107 soc->do_region(&_offset_array[start_index],
108 (end_index - start_index) * sizeof(_offset_array[0]));
109 }
110 100
111 ////////////////////////////////////////////////////////////////////// 101 //////////////////////////////////////////////////////////////////////
112 // BlockOffsetArray 102 // BlockOffsetArray
113 ////////////////////////////////////////////////////////////////////// 103 //////////////////////////////////////////////////////////////////////
114 104
799 "just checking"); 789 "just checking");
800 size_t bottom_index = _array->index_for(_bottom); 790 size_t bottom_index = _array->index_for(_bottom);
801 _array->set_offset_array(bottom_index, 0); 791 _array->set_offset_array(bottom_index, 0);
802 } 792 }
803 793
804
805 void BlockOffsetArrayContigSpace::serialize(SerializeOopClosure* soc) {
806 if (soc->reading()) {
807 // Null these values so that the serializer won't object to updating them.
808 _next_offset_threshold = NULL;
809 _next_offset_index = 0;
810 }
811 soc->do_ptr(&_next_offset_threshold);
812 soc->do_size_t(&_next_offset_index);
813 }
814
815 size_t BlockOffsetArrayContigSpace::last_active_index() const { 794 size_t BlockOffsetArrayContigSpace::last_active_index() const {
816 size_t result = _next_offset_index - 1; 795 size_t result = _next_offset_index - 1;
817 return result >= 0 ? result : 0; 796 return result >= 0 ? result : 0;
818 } 797 }