annotate src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.hpp @ 17524:89152779163c

Merge with jdk8-b132
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 11:59:32 +0200
parents 4ca6dc0799b6
children 7848fc12602b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
17524
89152779163c Merge with jdk8-b132
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 14909
diff changeset
2 * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "gc_implementation/shared/collectorCounters.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "gc_implementation/shared/markSweep.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "utilities/stack.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31
0
a61af66fc99e Initial load
duke
parents:
diff changeset
32 class PSAdaptiveSizePolicy;
a61af66fc99e Initial load
duke
parents:
diff changeset
33 class PSYoungGen;
a61af66fc99e Initial load
duke
parents:
diff changeset
34 class PSOldGen;
a61af66fc99e Initial load
duke
parents:
diff changeset
35
a61af66fc99e Initial load
duke
parents:
diff changeset
36 class PSMarkSweep : public MarkSweep {
a61af66fc99e Initial load
duke
parents:
diff changeset
37 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
38 static elapsedTimer _accumulated_time;
a61af66fc99e Initial load
duke
parents:
diff changeset
39 static jlong _time_of_last_gc; // ms
a61af66fc99e Initial load
duke
parents:
diff changeset
40 static CollectorCounters* _counters;
a61af66fc99e Initial load
duke
parents:
diff changeset
41
a61af66fc99e Initial load
duke
parents:
diff changeset
42 // Closure accessors
a61af66fc99e Initial load
duke
parents:
diff changeset
43 static OopClosure* mark_and_push_closure() { return &MarkSweep::mark_and_push_closure; }
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 4913
diff changeset
44 static KlassClosure* follow_klass_closure() { return &MarkSweep::follow_klass_closure; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
45 static VoidClosure* follow_stack_closure() { return (VoidClosure*)&MarkSweep::follow_stack_closure; }
a61af66fc99e Initial load
duke
parents:
diff changeset
46 static OopClosure* adjust_pointer_closure() { return (OopClosure*)&MarkSweep::adjust_pointer_closure; }
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 4913
diff changeset
47 static KlassClosure* adjust_klass_closure() { return &MarkSweep::adjust_klass_closure; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
48 static BoolObjectClosure* is_alive_closure() { return (BoolObjectClosure*)&MarkSweep::is_alive; }
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 debug_only(public:) // Used for PSParallelCompact debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
51 // Mark live objects
a61af66fc99e Initial load
duke
parents:
diff changeset
52 static void mark_sweep_phase1(bool clear_all_softrefs);
a61af66fc99e Initial load
duke
parents:
diff changeset
53 // Calculate new addresses
a61af66fc99e Initial load
duke
parents:
diff changeset
54 static void mark_sweep_phase2();
a61af66fc99e Initial load
duke
parents:
diff changeset
55 debug_only(private:) // End used for PSParallelCompact debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
56 // Update pointers
a61af66fc99e Initial load
duke
parents:
diff changeset
57 static void mark_sweep_phase3();
a61af66fc99e Initial load
duke
parents:
diff changeset
58 // Move objects to new positions
a61af66fc99e Initial load
duke
parents:
diff changeset
59 static void mark_sweep_phase4();
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 debug_only(public:) // Used for PSParallelCompact debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
62 // Temporary data structures for traversal and storing/restoring marks
a61af66fc99e Initial load
duke
parents:
diff changeset
63 static void allocate_stacks();
a61af66fc99e Initial load
duke
parents:
diff changeset
64 static void deallocate_stacks();
a61af66fc99e Initial load
duke
parents:
diff changeset
65 static void set_ref_processor(ReferenceProcessor* rp) { // delete this method
a61af66fc99e Initial load
duke
parents:
diff changeset
66 _ref_processor = rp;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 }
a61af66fc99e Initial load
duke
parents:
diff changeset
68 debug_only(private:) // End used for PSParallelCompact debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 // If objects are left in eden after a collection, try to move the boundary
a61af66fc99e Initial load
duke
parents:
diff changeset
71 // and absorb them into the old gen. Returns true if eden was emptied.
a61af66fc99e Initial load
duke
parents:
diff changeset
72 static bool absorb_live_data_from_eden(PSAdaptiveSizePolicy* size_policy,
a61af66fc99e Initial load
duke
parents:
diff changeset
73 PSYoungGen* young_gen,
a61af66fc99e Initial load
duke
parents:
diff changeset
74 PSOldGen* old_gen);
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 // Reset time since last full gc
a61af66fc99e Initial load
duke
parents:
diff changeset
77 static void reset_millis_since_last_gc();
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
80 static void invoke(bool clear_all_softrefs);
4913
ab4422d0ed59 7146343: PS invoke methods should indicate the type of gc done
jcoomes
parents: 1972
diff changeset
81 static bool invoke_no_policy(bool clear_all_softrefs);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
83 static void initialize();
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 // Public accessors
a61af66fc99e Initial load
duke
parents:
diff changeset
86 static elapsedTimer* accumulated_time() { return &_accumulated_time; }
a61af66fc99e Initial load
duke
parents:
diff changeset
87 static CollectorCounters* counters() { return _counters; }
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 // Time since last full gc (in milliseconds)
a61af66fc99e Initial load
duke
parents:
diff changeset
90 static jlong millis_since_last_gc();
a61af66fc99e Initial load
duke
parents:
diff changeset
91 };
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
92
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
93 #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSMARKSWEEP_HPP