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 "aot/aotLoader.hpp"
27 #include "classfile/systemDictionary.hpp"
28 #include "code/codeCache.hpp"
29 #include "gc/parallel/cardTableExtension.hpp"
30 #include "gc/parallel/gcTaskManager.hpp"
31 #include "gc/parallel/psMarkSweep.hpp"
32 #include "gc/parallel/psPromotionManager.hpp"
33 #include "gc/parallel/psPromotionManager.inline.hpp"
34 #include "gc/parallel/psScavenge.inline.hpp"
35 #include "gc/parallel/psTasks.hpp"
36 #include "gc/shared/taskqueue.inline.hpp"
37 #include "memory/iterator.hpp"
38 #include "memory/resourceArea.hpp"
39 #include "memory/universe.hpp"
40 #include "oops/oop.inline.hpp"
41 #include "runtime/fprofiler.hpp"
42 #include "runtime/thread.hpp"
43 #include "runtime/vmThread.hpp"
44 #include "services/management.hpp"
45
46 //
47 // ScavengeRootsTask
48 //
49
50 void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) {
51 assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
164 }
165 }
166 }
167 guarantee(pm->stacks_empty(), "stacks should be empty at this point");
168 }
169
170 //
171 // OldToYoungRootsTask
172 //
173
174 void OldToYoungRootsTask::do_it(GCTaskManager* manager, uint which) {
175 // There are not old-to-young pointers if the old gen is empty.
176 assert(!_old_gen->object_space()->is_empty(),
177 "Should not be called is there is no work");
178 assert(_old_gen != NULL, "Sanity");
179 assert(_old_gen->object_space()->contains(_gen_top) || _gen_top == _old_gen->object_space()->top(), "Sanity");
180 assert(_stripe_number < ParallelGCThreads, "Sanity");
181
182 {
183 PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which);
184 CardTableExtension* card_table =
185 barrier_set_cast<CardTableExtension>(ParallelScavengeHeap::heap()->barrier_set());
186
187 card_table->scavenge_contents_parallel(_old_gen->start_array(),
188 _old_gen->object_space(),
189 _gen_top,
190 pm,
191 _stripe_number,
192 _stripe_total);
193
194 // Do the real work
195 pm->drain_stacks(false);
196 }
197 }
|
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 "aot/aotLoader.hpp"
27 #include "classfile/systemDictionary.hpp"
28 #include "code/codeCache.hpp"
29 #include "gc/parallel/gcTaskManager.hpp"
30 #include "gc/parallel/psMarkSweep.hpp"
31 #include "gc/parallel/psCardTable.hpp"
32 #include "gc/parallel/psPromotionManager.hpp"
33 #include "gc/parallel/psPromotionManager.inline.hpp"
34 #include "gc/parallel/psScavenge.inline.hpp"
35 #include "gc/parallel/psTasks.hpp"
36 #include "gc/shared/taskqueue.inline.hpp"
37 #include "memory/iterator.hpp"
38 #include "memory/resourceArea.hpp"
39 #include "memory/universe.hpp"
40 #include "oops/oop.inline.hpp"
41 #include "runtime/fprofiler.hpp"
42 #include "runtime/thread.hpp"
43 #include "runtime/vmThread.hpp"
44 #include "services/management.hpp"
45
46 //
47 // ScavengeRootsTask
48 //
49
50 void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) {
51 assert(ParallelScavengeHeap::heap()->is_gc_active(), "called outside gc");
164 }
165 }
166 }
167 guarantee(pm->stacks_empty(), "stacks should be empty at this point");
168 }
169
170 //
171 // OldToYoungRootsTask
172 //
173
174 void OldToYoungRootsTask::do_it(GCTaskManager* manager, uint which) {
175 // There are not old-to-young pointers if the old gen is empty.
176 assert(!_old_gen->object_space()->is_empty(),
177 "Should not be called is there is no work");
178 assert(_old_gen != NULL, "Sanity");
179 assert(_old_gen->object_space()->contains(_gen_top) || _gen_top == _old_gen->object_space()->top(), "Sanity");
180 assert(_stripe_number < ParallelGCThreads, "Sanity");
181
182 {
183 PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which);
184 PSCardTable* card_table = ParallelScavengeHeap::heap()->card_table();
185
186 card_table->scavenge_contents_parallel(_old_gen->start_array(),
187 _old_gen->object_space(),
188 _gen_top,
189 pm,
190 _stripe_number,
191 _stripe_total);
192
193 // Do the real work
194 pm->drain_stacks(false);
195 }
196 }
|