author | mgerdin |
Mon, 07 Mar 2016 17:23:59 +0100 | |
changeset 37039 | 79f62b89a7a6 |
parent 35051 | 002d874a4284 |
permissions | -rw-r--r-- |
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
1 |
/* |
30764 | 2 |
* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. |
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
4 |
* |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
8 |
* |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
13 |
* accompanied this code). |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
14 |
* |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
18 |
* |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
21 |
* questions. |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
22 |
* |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
23 |
*/ |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
24 |
|
30764 | 25 |
#ifndef SHARE_VM_GC_G1_G1INCSETSTATE_HPP |
26 |
#define SHARE_VM_GC_G1_G1INCSETSTATE_HPP |
|
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
27 |
|
30764 | 28 |
#include "gc/g1/g1BiasedArray.hpp" |
29 |
#include "gc/g1/heapRegion.hpp" |
|
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
30 |
#include "memory/allocation.hpp" |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
31 |
|
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
32 |
// Per-region state during garbage collection. |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
33 |
struct InCSetState { |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
34 |
public: |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
35 |
// We use different types to represent the state value. Particularly SPARC puts |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
36 |
// values in structs from "left to right", i.e. MSB to LSB. This results in many |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
37 |
// unnecessary shift operations when loading and storing values of this type. |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
38 |
// This degrades performance significantly (>10%) on that platform. |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
39 |
// Other tested ABIs do not seem to have this problem, and actually tend to |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
40 |
// favor smaller types, so we use the smallest usable type there. |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
41 |
#ifdef SPARC |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
42 |
#define CSETSTATE_FORMAT INTPTR_FORMAT |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
43 |
typedef intptr_t in_cset_state_t; |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
44 |
#else |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
45 |
#define CSETSTATE_FORMAT "%d" |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
46 |
typedef int8_t in_cset_state_t; |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
47 |
#endif |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
48 |
private: |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
49 |
in_cset_state_t _value; |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
50 |
public: |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
51 |
enum { |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
52 |
// Selection of the values were driven to micro-optimize the encoding and |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
53 |
// frequency of the checks. |
33228
9a491d1be90f
8135078: Refactor InCSetState::is_in_cset_or_humongous
ehelin
parents:
33105
diff
changeset
|
54 |
// The most common check is whether the region is in the collection set or not, |
9a491d1be90f
8135078: Refactor InCSetState::is_in_cset_or_humongous
ehelin
parents:
33105
diff
changeset
|
55 |
// this encoding allows us to use an > 0 check. |
35051
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
56 |
// The positive values are encoded in increasing generation order, which |
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
57 |
// makes getting the next generation fast by a simple increment. They are also |
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
58 |
// used to index into arrays. |
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
59 |
// The negative values are used for objects requiring various special cases, |
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
60 |
// for example eager reclamation of humongous objects. |
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
61 |
Ext = -2, // Extension point |
33228
9a491d1be90f
8135078: Refactor InCSetState::is_in_cset_or_humongous
ehelin
parents:
33105
diff
changeset
|
62 |
Humongous = -1, // The region is humongous |
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
63 |
NotInCSet = 0, // The region is not in the collection set. |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
64 |
Young = 1, // The region is in the collection set and a young region. |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
65 |
Old = 2, // The region is in the collection set and an old region. |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
66 |
Num |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
67 |
}; |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
68 |
|
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
69 |
InCSetState(in_cset_state_t value = NotInCSet) : _value(value) { |
33105
294e48b4f704
8080775: Better argument formatting for assert() and friends
david
parents:
31592
diff
changeset
|
70 |
assert(is_valid(), "Invalid state %d", _value); |
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
71 |
} |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
72 |
|
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
73 |
in_cset_state_t value() const { return _value; } |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
74 |
|
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
75 |
void set_old() { _value = Old; } |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
76 |
|
33228
9a491d1be90f
8135078: Refactor InCSetState::is_in_cset_or_humongous
ehelin
parents:
33105
diff
changeset
|
77 |
bool is_in_cset_or_humongous() const { return is_in_cset() || is_humongous(); } |
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
78 |
bool is_in_cset() const { return _value > NotInCSet; } |
33228
9a491d1be90f
8135078: Refactor InCSetState::is_in_cset_or_humongous
ehelin
parents:
33105
diff
changeset
|
79 |
|
9a491d1be90f
8135078: Refactor InCSetState::is_in_cset_or_humongous
ehelin
parents:
33105
diff
changeset
|
80 |
bool is_humongous() const { return _value == Humongous; } |
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
81 |
bool is_young() const { return _value == Young; } |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
82 |
bool is_old() const { return _value == Old; } |
35051
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
83 |
bool is_ext() const { return _value == Ext; } |
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
84 |
|
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
85 |
#ifdef ASSERT |
35051
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
86 |
bool is_default() const { return _value == NotInCSet; } |
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
87 |
bool is_valid() const { return (_value >= Ext) && (_value < Num); } |
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
88 |
bool is_valid_gen() const { return (_value >= Young && _value <= Old); } |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
89 |
#endif |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
90 |
}; |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
91 |
|
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
92 |
// Instances of this class are used for quick tests on whether a reference points |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
93 |
// into the collection set and into which generation or is a humongous object |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
94 |
// |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
95 |
// Each of the array's elements indicates whether the corresponding region is in |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
96 |
// the collection set and if so in which generation, or a humongous region. |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
97 |
// |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
98 |
// We use this to speed up reference processing during young collection and |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
99 |
// quickly reclaim humongous objects. For the latter, by making a humongous region |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
100 |
// succeed this test, we sort-of add it to the collection set. During the reference |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
101 |
// iteration closures, when we see a humongous region, we then simply mark it as |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
102 |
// referenced, i.e. live. |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
103 |
class G1InCSetStateFastTestBiasedMappedArray : public G1BiasedMappedArray<InCSetState> { |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
104 |
protected: |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
105 |
InCSetState default_value() const { return InCSetState::NotInCSet; } |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
106 |
public: |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
107 |
void set_humongous(uintptr_t index) { |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
108 |
assert(get_by_index(index).is_default(), |
33105
294e48b4f704
8080775: Better argument formatting for assert() and friends
david
parents:
31592
diff
changeset
|
109 |
"State at index " INTPTR_FORMAT " should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value()); |
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
110 |
set_by_index(index, InCSetState::Humongous); |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
111 |
} |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
112 |
|
35051
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
113 |
void set_ext(uintptr_t index) { |
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
114 |
assert(get_by_index(index).is_default(), |
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
115 |
"State at index " INTPTR_FORMAT " should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value()); |
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
116 |
set_by_index(index, InCSetState::Ext); |
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
117 |
} |
002d874a4284
8144714: Add extension point to G1 evacuation closures
mgerdin
parents:
33228
diff
changeset
|
118 |
|
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
119 |
void clear_humongous(uintptr_t index) { |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
120 |
set_by_index(index, InCSetState::NotInCSet); |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
121 |
} |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
122 |
|
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
123 |
void set_in_young(uintptr_t index) { |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
124 |
assert(get_by_index(index).is_default(), |
33105
294e48b4f704
8080775: Better argument formatting for assert() and friends
david
parents:
31592
diff
changeset
|
125 |
"State at index " INTPTR_FORMAT " should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value()); |
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
126 |
set_by_index(index, InCSetState::Young); |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
127 |
} |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
128 |
|
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
129 |
void set_in_old(uintptr_t index) { |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
130 |
assert(get_by_index(index).is_default(), |
33105
294e48b4f704
8080775: Better argument formatting for assert() and friends
david
parents:
31592
diff
changeset
|
131 |
"State at index " INTPTR_FORMAT " should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value()); |
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
132 |
set_by_index(index, InCSetState::Old); |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
133 |
} |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
134 |
|
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
135 |
bool is_in_cset_or_humongous(HeapWord* addr) const { return at(addr).is_in_cset_or_humongous(); } |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
136 |
bool is_in_cset(HeapWord* addr) const { return at(addr).is_in_cset(); } |
29470
e34bbcd36e53
8030646: track collection set membership in one place
ehelin
parents:
28213
diff
changeset
|
137 |
bool is_in_cset(const HeapRegion* hr) const { return get_by_index(hr->hrm_index()).is_in_cset(); } |
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
138 |
InCSetState at(HeapWord* addr) const { return get_by_address(addr); } |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
139 |
void clear() { G1BiasedMappedArray<InCSetState>::clear(); } |
29470
e34bbcd36e53
8030646: track collection set membership in one place
ehelin
parents:
28213
diff
changeset
|
140 |
void clear(const HeapRegion* hr) { return set_by_index(hr->hrm_index(), InCSetState::NotInCSet); } |
28213
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
141 |
}; |
b0bf57cd1e9d
8060025: Object copy time regressions after JDK-8031323 and JDK-8057536
tschatzl
parents:
diff
changeset
|
142 |
|
30764 | 143 |
#endif // SHARE_VM_GC_G1_G1INCSETSTATE_HPP |