author | stefank |
Thu, 22 Feb 2018 18:36:07 +0100 | |
changeset 49047 | 8f004146e407 |
parent 47897 | eb3696e0c6d8 |
child 49592 | 77fb0be7d19f |
permissions | -rw-r--r-- |
1 | 1 |
/* |
46285
5b673a9fa682
8171235: Move archive object code from G1MarkSweep into G1ArchiveAllocator
sjohanss
parents:
32606
diff
changeset
|
2 |
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5076
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5076
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5076
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
30764 | 25 |
#ifndef SHARE_VM_GC_SERIAL_MARKSWEEP_INLINE_HPP |
26 |
#define SHARE_VM_GC_SERIAL_MARKSWEEP_INLINE_HPP |
|
7397 | 27 |
|
30764 | 28 |
#include "gc/serial/markSweep.hpp" |
46810
7dad333205cd
8179302: Pre-resolve constant pool string entries and cache resolved_reference arrays in CDS archive.
jiangli
parents:
46415
diff
changeset
|
29 |
#include "memory/metaspaceShared.hpp" |
32606
fdaa30d06ada
8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents:
31346
diff
changeset
|
30 |
#include "memory/universe.hpp" |
30764 | 31 |
#include "oops/markOop.inline.hpp" |
32606
fdaa30d06ada
8129417: Oop iteration clean-up to remove oop_ms_follow_contents
sjohanss
parents:
31346
diff
changeset
|
32 |
#include "oops/oop.inline.hpp" |
31346
a70d45c06136
8042668: GC Support for shared heap ranges in CDS
jiangli
parents:
30764
diff
changeset
|
33 |
|
29792
8c6fa07f0869
8075957: Reduce calls to the GC specific object visitors in oopDesc
stefank
parents:
27624
diff
changeset
|
34 |
inline int MarkSweep::adjust_pointers(oop obj) { |
46415
7d5a286cdf89
8138737: Remove oop_ms_adjust_pointers and use oop_iterate instead
sjohanss
parents:
46285
diff
changeset
|
35 |
return obj->oop_iterate_size(&MarkSweep::adjust_pointer_closure); |
29792
8c6fa07f0869
8075957: Reduce calls to the GC specific object visitors in oopDesc
stefank
parents:
27624
diff
changeset
|
36 |
} |
8c6fa07f0869
8075957: Reduce calls to the GC specific object visitors in oopDesc
stefank
parents:
27624
diff
changeset
|
37 |
|
17105
25b392a7740d
8012687: Remove unused is_root checks and closures
stefank
parents:
15482
diff
changeset
|
38 |
template <class T> inline void MarkSweep::adjust_pointer(T* p) { |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
39 |
T heap_oop = oopDesc::load_heap_oop(p); |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
40 |
if (!oopDesc::is_null(heap_oop)) { |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
41 |
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); |
30150
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29792
diff
changeset
|
42 |
assert(Universe::heap()->is_in(obj), "should be in heap"); |
d9c940aa42ef
8075955: Replace the macro based implementation of oop_oop_iterate with a template based solution
stefank
parents:
29792
diff
changeset
|
43 |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
44 |
oop new_obj = oop(obj->mark()->decode_pointer()); |
46810
7dad333205cd
8179302: Pre-resolve constant pool string entries and cache resolved_reference arrays in CDS archive.
jiangli
parents:
46415
diff
changeset
|
45 |
|
47897
eb3696e0c6d8
8189734: Cleanup MarkSweep when G1 dependency is gone
sjohanss
parents:
47216
diff
changeset
|
46 |
assert(new_obj != NULL || // is forwarding ptr? |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
47 |
obj->mark() == markOopDesc::prototype() || // not gc marked? |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11178
diff
changeset
|
48 |
(UseBiasedLocking && obj->mark()->has_bias_pattern()), |
31346
a70d45c06136
8042668: GC Support for shared heap ranges in CDS
jiangli
parents:
30764
diff
changeset
|
49 |
// not gc marked? |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
50 |
"should be forwarded"); |
46810
7dad333205cd
8179302: Pre-resolve constant pool string entries and cache resolved_reference arrays in CDS archive.
jiangli
parents:
46415
diff
changeset
|
51 |
|
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
52 |
if (new_obj != NULL) { |
47897
eb3696e0c6d8
8189734: Cleanup MarkSweep when G1 dependency is gone
sjohanss
parents:
47216
diff
changeset
|
53 |
assert(Universe::heap()->is_in_reserved(new_obj), |
eb3696e0c6d8
8189734: Cleanup MarkSweep when G1 dependency is gone
sjohanss
parents:
47216
diff
changeset
|
54 |
"should be in object space"); |
eb3696e0c6d8
8189734: Cleanup MarkSweep when G1 dependency is gone
sjohanss
parents:
47216
diff
changeset
|
55 |
oopDesc::encode_store_heap_oop_not_null(p, new_obj); |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
56 |
} |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
57 |
} |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
58 |
} |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
59 |
|
30764 | 60 |
#endif // SHARE_VM_GC_SERIAL_MARKSWEEP_INLINE_HPP |