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 #include "precompiled.hpp"
26 #include "gc_implementation/shared/collectorCounters.hpp"
27 #include "gc_implementation/shared/gcPolicyCounters.hpp"
28 #include "gc_implementation/shared/gcHeapSummary.hpp"
29 #include "gc_implementation/shared/gcTimer.hpp"
30 #include "gc_implementation/shared/gcTraceTime.hpp"
31 #include "gc_implementation/shared/gcTrace.hpp"
32 #include "gc_implementation/shared/spaceDecorator.hpp"
33 #include "memory/defNewGeneration.inline.hpp"
34 #include "memory/gcLocker.inline.hpp"
35 #include "memory/genCollectedHeap.hpp"
36 #include "memory/genOopClosures.inline.hpp"
37 #include "memory/genRemSet.hpp"
38 #include "memory/generationSpec.hpp"
39 #include "memory/iterator.hpp"
40 #include "memory/referencePolicy.hpp"
41 #include "memory/space.inline.hpp"
42 #include "oops/instanceRefKlass.hpp"
43 #include "oops/oop.inline.hpp"
44 #include "runtime/atomic.inline.hpp"
45 #include "runtime/java.hpp"
46 #include "runtime/prefetch.inline.hpp"
47 #include "runtime/thread.inline.hpp"
48 #include "utilities/copy.hpp"
49 #include "utilities/globalDefinitions.hpp"
50 #include "utilities/stack.inline.hpp"
51 #if INCLUDE_ALL_GCS
52 #include "gc_implementation/parNew/parOopClosures.hpp"
53 #endif
54
55 //
56 // DefNewGeneration functions.
57
58 // Methods of protected closure types.
59
60 DefNewGeneration::IsAliveClosure::IsAliveClosure(Generation* g) : _g(g) {
61 assert(g->level() == 0, "Optimized for youngest gen.");
62 }
63 bool DefNewGeneration::IsAliveClosure::do_object_b(oop p) {
64 return (HeapWord*)p >= _g->reserved().end() || p->is_forwarded();
65 }
66
67 DefNewGeneration::KeepAliveClosure::
68 KeepAliveClosure(ScanWeakRefClosure* cl) : _cl(cl) {
69 GenRemSet* rs = GenCollectedHeap::heap()->rem_set();
70 _rs = (CardTableRS*)rs;
71 }
72
|
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 #include "precompiled.hpp"
26 #include "gc/serial/defNewGeneration.inline.hpp"
27 #include "gc/shared/collectorCounters.hpp"
28 #include "gc/shared/gcHeapSummary.hpp"
29 #include "gc/shared/gcLocker.inline.hpp"
30 #include "gc/shared/gcPolicyCounters.hpp"
31 #include "gc/shared/gcTimer.hpp"
32 #include "gc/shared/gcTrace.hpp"
33 #include "gc/shared/gcTraceTime.hpp"
34 #include "gc/shared/genCollectedHeap.hpp"
35 #include "gc/shared/genOopClosures.inline.hpp"
36 #include "gc/shared/genRemSet.hpp"
37 #include "gc/shared/generationSpec.hpp"
38 #include "gc/shared/referencePolicy.hpp"
39 #include "gc/shared/space.inline.hpp"
40 #include "gc/shared/spaceDecorator.hpp"
41 #include "memory/iterator.hpp"
42 #include "oops/instanceRefKlass.hpp"
43 #include "oops/oop.inline.hpp"
44 #include "runtime/atomic.inline.hpp"
45 #include "runtime/java.hpp"
46 #include "runtime/prefetch.inline.hpp"
47 #include "runtime/thread.inline.hpp"
48 #include "utilities/copy.hpp"
49 #include "utilities/globalDefinitions.hpp"
50 #include "utilities/stack.inline.hpp"
51 #if INCLUDE_ALL_GCS
52 #include "gc/cms/parOopClosures.hpp"
53 #endif
54
55 //
56 // DefNewGeneration functions.
57
58 // Methods of protected closure types.
59
60 DefNewGeneration::IsAliveClosure::IsAliveClosure(Generation* g) : _g(g) {
61 assert(g->level() == 0, "Optimized for youngest gen.");
62 }
63 bool DefNewGeneration::IsAliveClosure::do_object_b(oop p) {
64 return (HeapWord*)p >= _g->reserved().end() || p->is_forwarded();
65 }
66
67 DefNewGeneration::KeepAliveClosure::
68 KeepAliveClosure(ScanWeakRefClosure* cl) : _cl(cl) {
69 GenRemSet* rs = GenCollectedHeap::heap()->rem_set();
70 _rs = (CardTableRS*)rs;
71 }
72
|