author | coleenp |
Sun, 13 Apr 2008 17:43:42 -0400 | |
changeset 360 | 21d113ecbf6a |
parent 1 | 489c9b5090e2 |
child 670 | ddf3e9583f2f |
permissions | -rw-r--r-- |
1 | 1 |
/* |
2 |
* Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
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 |
|
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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
20 |
* CA 95054 USA or visit www.sun.com if you need additional information or |
|
21 |
* have any questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
inline PSPromotionManager* PSPromotionManager::manager_array(int index) { |
|
26 |
assert(_manager_array != NULL, "access of NULL manager_array"); |
|
27 |
assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access"); |
|
28 |
return _manager_array[index]; |
|
29 |
} |
|
30 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
31 |
template <class T> |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
32 |
inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
33 |
if (p != NULL) { // XXX: error if p != NULL here |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
34 |
oop o = oopDesc::load_decode_heap_oop_not_null(p); |
1 | 35 |
if (o->is_forwarded()) { |
36 |
o = o->forwardee(); |
|
37 |
// Card mark |
|
38 |
if (PSScavenge::is_obj_in_young((HeapWord*) o)) { |
|
39 |
PSScavenge::card_table()->inline_write_ref_field_gc(p, o); |
|
40 |
} |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
41 |
oopDesc::encode_store_heap_oop_not_null(p, o); |
1 | 42 |
} else { |
43 |
push_depth(p); |
|
44 |
} |
|
45 |
} |
|
46 |
} |
|
47 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
48 |
template <class T> |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
49 |
inline void PSPromotionManager::claim_or_forward_internal_breadth(T* p) { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
50 |
if (p != NULL) { // XXX: error if p != NULL here |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
51 |
oop o = oopDesc::load_decode_heap_oop_not_null(p); |
1 | 52 |
if (o->is_forwarded()) { |
53 |
o = o->forwardee(); |
|
54 |
} else { |
|
55 |
o = copy_to_survivor_space(o, false); |
|
56 |
} |
|
57 |
// Card mark |
|
58 |
if (PSScavenge::is_obj_in_young((HeapWord*) o)) { |
|
59 |
PSScavenge::card_table()->inline_write_ref_field_gc(p, o); |
|
60 |
} |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
61 |
oopDesc::encode_store_heap_oop_not_null(p, o); |
1 | 62 |
} |
63 |
} |
|
64 |
||
65 |
inline void PSPromotionManager::flush_prefetch_queue() { |
|
66 |
assert(!depth_first(), "invariant"); |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
67 |
for (int i = 0; i < _prefetch_queue.length(); i++) { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
68 |
claim_or_forward_internal_breadth((oop*)_prefetch_queue.pop()); |
1 | 69 |
} |
70 |
} |
|
71 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
72 |
template <class T> |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
73 |
inline void PSPromotionManager::claim_or_forward_depth(T* p) { |
1 | 74 |
assert(depth_first(), "invariant"); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
75 |
assert(PSScavenge::should_scavenge(p, true), "revisiting object?"); |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
76 |
assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap, |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
77 |
"Sanity"); |
1 | 78 |
assert(Universe::heap()->is_in(p), "pointer outside heap"); |
79 |
||
80 |
claim_or_forward_internal_depth(p); |
|
81 |
} |
|
82 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
83 |
template <class T> |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
84 |
inline void PSPromotionManager::claim_or_forward_breadth(T* p) { |
1 | 85 |
assert(!depth_first(), "invariant"); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
86 |
assert(PSScavenge::should_scavenge(p, true), "revisiting object?"); |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
87 |
assert(Universe::heap()->kind() == CollectedHeap::ParallelScavengeHeap, |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
88 |
"Sanity"); |
1 | 89 |
assert(Universe::heap()->is_in(p), "pointer outside heap"); |
90 |
||
91 |
if (UsePrefetchQueue) { |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
92 |
claim_or_forward_internal_breadth((T*)_prefetch_queue.push_and_pop(p)); |
1 | 93 |
} else { |
94 |
// This option is used for testing. The use of the prefetch |
|
95 |
// queue can delay the processing of the objects and thus |
|
96 |
// change the order of object scans. For example, remembered |
|
97 |
// set updates are typically the clearing of the remembered |
|
98 |
// set (the cards) followed by updates of the remembered set |
|
99 |
// for young-to-old pointers. In a situation where there |
|
100 |
// is an error in the sequence of clearing and updating |
|
101 |
// (e.g. clear card A, update card A, erroneously clear |
|
102 |
// card A again) the error can be obscured by a delay |
|
103 |
// in the update due to the use of the prefetch queue |
|
104 |
// (e.g., clear card A, erroneously clear card A again, |
|
105 |
// update card A that was pushed into the prefetch queue |
|
106 |
// and thus delayed until after the erronous clear). The |
|
107 |
// length of the delay is random depending on the objects |
|
108 |
// in the queue and the delay can be zero. |
|
109 |
claim_or_forward_internal_breadth(p); |
|
110 |
} |
|
111 |
} |
|
112 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
113 |
inline void PSPromotionManager::process_popped_location_depth(StarTask p) { |
1 | 114 |
if (is_oop_masked(p)) { |
115 |
assert(PSChunkLargeArrays, "invariant"); |
|
116 |
oop const old = unmask_chunked_array_oop(p); |
|
117 |
process_array_chunk(old); |
|
118 |
} else { |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
119 |
if (p.is_narrow()) { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
120 |
PSScavenge::copy_and_push_safe_barrier(this, (narrowOop*)p); |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
121 |
} else { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
122 |
PSScavenge::copy_and_push_safe_barrier(this, (oop*)p); |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
123 |
} |
1 | 124 |
} |
125 |
} |