author | phh |
Sat, 30 Nov 2019 14:33:05 -0800 | |
changeset 59330 | 5b96c12f909d |
parent 53244 | 9807daeb47c4 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52117
diff
changeset
|
2 |
* Copyright (c) 2002, 2019, 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:
670
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
670
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:
670
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52117
diff
changeset
|
25 |
#ifndef SHARE_GC_PARALLEL_PSSCAVENGE_INLINE_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52117
diff
changeset
|
26 |
#define SHARE_GC_PARALLEL_PSSCAVENGE_INLINE_HPP |
7397 | 27 |
|
30764 | 28 |
#include "gc/parallel/parallelScavengeHeap.hpp" |
29 |
#include "gc/parallel/psScavenge.hpp" |
|
35061 | 30 |
#include "logging/log.hpp" |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
11753
diff
changeset
|
31 |
#include "memory/iterator.hpp" |
37248 | 32 |
#include "memory/resourceArea.hpp" |
49592
77fb0be7d19f
8199946: Move load/store and encode/decode out of oopDesc
stefank
parents:
49164
diff
changeset
|
33 |
#include "oops/access.inline.hpp" |
49722
a47d1e21b3f1
8199735: Mark word updates need to use Access API
rkennke
parents:
49592
diff
changeset
|
34 |
#include "oops/oop.inline.hpp" |
24098
48f07e2c74de
8039957: Replace the last few %p usages with PTR_FORMAT in the GC code
stefank
parents:
20282
diff
changeset
|
35 |
#include "utilities/globalDefinitions.hpp" |
7397 | 36 |
|
1 | 37 |
inline void PSScavenge::save_to_space_top_before_gc() { |
30173
13cf7580b000
8077413: Avoid use of Universe::heap() inside collectors
pliden
parents:
29208
diff
changeset
|
38 |
ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); |
1 | 39 |
_to_space_top_before_gc = heap->young_gen()->to_space()->top(); |
40 |
} |
|
41 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
42 |
template <class T> inline bool PSScavenge::should_scavenge(T* p) { |
49592
77fb0be7d19f
8199946: Move load/store and encode/decode out of oopDesc
stefank
parents:
49164
diff
changeset
|
43 |
T heap_oop = RawAccess<>::oop_load(p); |
17852
59b05e1db547
8015486: PSScavenge::is_obj_in_young is unnecessarily slow with UseCompressedOops
stefank
parents:
13728
diff
changeset
|
44 |
return PSScavenge::is_obj_in_young(heap_oop); |
1 | 45 |
} |
46 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
47 |
template <class T> |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
48 |
inline bool PSScavenge::should_scavenge(T* p, MutableSpace* to_space) { |
1 | 49 |
if (should_scavenge(p)) { |
50728 | 50 |
oop obj = RawAccess<IS_NOT_NULL>::oop_load(p); |
1 | 51 |
// Skip objects copied to to_space since the scavenge started. |
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
52 |
HeapWord* const addr = (HeapWord*)obj; |
1 | 53 |
return addr < to_space_top_before_gc() || addr >= to_space->end(); |
54 |
} |
|
55 |
return false; |
|
56 |
} |
|
57 |
||
360
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
58 |
template <class T> |
21d113ecbf6a
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
1
diff
changeset
|
59 |
inline bool PSScavenge::should_scavenge(T* p, bool check_to_space) { |
1 | 60 |
if (check_to_space) { |
30173
13cf7580b000
8077413: Avoid use of Universe::heap() inside collectors
pliden
parents:
29208
diff
changeset
|
61 |
ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); |
1 | 62 |
return should_scavenge(p, heap->young_gen()->to_space()); |
63 |
} |
|
64 |
return should_scavenge(p); |
|
65 |
} |
|
66 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52117
diff
changeset
|
67 |
#endif // SHARE_GC_PARALLEL_PSSCAVENGE_INLINE_HPP |