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/parallelScavenge/parallelScavengeHeap.hpp"
27 #include "gc_implementation/parallelScavenge/psOldGen.hpp"
28 #include "gc_implementation/parallelScavenge/psPromotionManager.inline.hpp"
29 #include "gc_implementation/parallelScavenge/psScavenge.inline.hpp"
30 #include "gc_implementation/shared/gcTrace.hpp"
31 #include "gc_implementation/shared/mutableSpace.hpp"
32 #include "memory/allocation.inline.hpp"
33 #include "memory/memRegion.hpp"
34 #include "memory/padded.inline.hpp"
35 #include "oops/instanceKlass.inline.hpp"
36 #include "oops/instanceMirrorKlass.inline.hpp"
37 #include "oops/objArrayKlass.inline.hpp"
38 #include "oops/oop.inline.hpp"
39 #include "utilities/taskqueue.inline.hpp"
40
41 PaddedEnd<PSPromotionManager>* PSPromotionManager::_manager_array = NULL;
42 OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL;
43 PSOldGen* PSPromotionManager::_old_gen = NULL;
44 MutableSpace* PSPromotionManager::_young_space = NULL;
45
46 void PSPromotionManager::initialize() {
47 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
48
49 _old_gen = heap->old_gen();
50 _young_space = heap->young_gen()->to_space();
51
52 // To prevent false sharing, we pad the PSPromotionManagers
53 // and make sure that the first instance starts at a cache line.
54 assert(_manager_array == NULL, "Attempt to initialize twice");
55 _manager_array = PaddedArray<PSPromotionManager, mtGC>::create_unfreeable(ParallelGCThreads + 1);
56 guarantee(_manager_array != NULL, "Could not initialize promotion manager");
57
58 _stack_array_depth = new OopStarTaskQueueSet(ParallelGCThreads);
59 guarantee(_stack_array_depth != NULL, "Could not initialize promotion manager");
|
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/parallel/mutableSpace.hpp"
27 #include "gc/parallel/parallelScavengeHeap.hpp"
28 #include "gc/parallel/psOldGen.hpp"
29 #include "gc/parallel/psPromotionManager.inline.hpp"
30 #include "gc/parallel/psScavenge.inline.hpp"
31 #include "gc/shared/gcTrace.hpp"
32 #include "gc/shared/taskqueue.inline.hpp"
33 #include "memory/allocation.inline.hpp"
34 #include "memory/memRegion.hpp"
35 #include "memory/padded.inline.hpp"
36 #include "oops/instanceKlass.inline.hpp"
37 #include "oops/instanceMirrorKlass.inline.hpp"
38 #include "oops/objArrayKlass.inline.hpp"
39 #include "oops/oop.inline.hpp"
40
41 PaddedEnd<PSPromotionManager>* PSPromotionManager::_manager_array = NULL;
42 OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL;
43 PSOldGen* PSPromotionManager::_old_gen = NULL;
44 MutableSpace* PSPromotionManager::_young_space = NULL;
45
46 void PSPromotionManager::initialize() {
47 ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
48
49 _old_gen = heap->old_gen();
50 _young_space = heap->young_gen()->to_space();
51
52 // To prevent false sharing, we pad the PSPromotionManagers
53 // and make sure that the first instance starts at a cache line.
54 assert(_manager_array == NULL, "Attempt to initialize twice");
55 _manager_array = PaddedArray<PSPromotionManager, mtGC>::create_unfreeable(ParallelGCThreads + 1);
56 guarantee(_manager_array != NULL, "Could not initialize promotion manager");
57
58 _stack_array_depth = new OopStarTaskQueueSet(ParallelGCThreads);
59 guarantee(_stack_array_depth != NULL, "Could not initialize promotion manager");
|