Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/parallelScavenge/psTasks.cpp @ 4909:95f6641e38e0
7144296: PS: Optimize nmethods processing
Summary: Prunes scavenge roots in code list every young GC, promote objects directly pointed by the code immediately
Reviewed-by: johnc, jcoomes
author | iveresov |
---|---|
date | Fri, 10 Feb 2012 17:40:20 -0800 |
parents | bca17e38de00 |
children | da91efe96a93 |
comparison
equal
deleted
inserted
replaced
4888:3c4621be5149 | 4909:95f6641e38e0 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2002, 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. |
49 void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) { | 49 void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) { |
50 assert(Universe::heap()->is_gc_active(), "called outside gc"); | 50 assert(Universe::heap()->is_gc_active(), "called outside gc"); |
51 | 51 |
52 PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which); | 52 PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which); |
53 PSScavengeRootsClosure roots_closure(pm); | 53 PSScavengeRootsClosure roots_closure(pm); |
54 PSPromoteRootsClosure roots_to_old_closure(pm); | |
54 | 55 |
55 switch (_root_type) { | 56 switch (_root_type) { |
56 case universe: | 57 case universe: |
57 Universe::oops_do(&roots_closure); | 58 Universe::oops_do(&roots_closure); |
58 break; | 59 break; |
89 break; | 90 break; |
90 | 91 |
91 | 92 |
92 case code_cache: | 93 case code_cache: |
93 { | 94 { |
94 CodeBlobToOopClosure each_scavengable_code_blob(&roots_closure, /*do_marking=*/ true); | 95 CodeBlobToOopClosure each_scavengable_code_blob(&roots_to_old_closure, /*do_marking=*/ true); |
95 CodeCache::scavenge_root_nmethods_do(&each_scavengable_code_blob); | 96 CodeCache::scavenge_root_nmethods_do(&each_scavengable_code_blob); |
96 } | 97 } |
97 break; | 98 break; |
98 | 99 |
99 default: | 100 default: |