5 * under the terms of the GNU General Public License version 2 only, as
6 * published by the Free Software Foundation.
7 *
8 * This code is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/shared/cardTableBarrierSet.inline.hpp"
26 #include "gc/shared/collectedHeap.hpp"
27 #include "gc/shared/genCollectedHeap.hpp"
28 #include "gc/shared/space.inline.hpp"
29 #include "logging/log.hpp"
30 #include "memory/virtualspace.hpp"
31 #include "oops/oop.inline.hpp"
32 #include "runtime/thread.hpp"
33 #include "services/memTracker.hpp"
34 #include "utilities/align.hpp"
35 #include "utilities/macros.hpp"
36
37 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
38 // enumerate ref fields that have been modified (since the last
39 // enumeration.)
40
41 CardTableBarrierSet::CardTableBarrierSet(
42 CardTable* card_table,
43 const BarrierSet::FakeRtti& fake_rtti) :
44 ModRefBarrierSet(fake_rtti.add_tag(BarrierSet::CardTableBarrierSet)),
45 _defer_initial_card_mark(false),
46 _card_table(card_table)
47 {}
48
49 CardTableBarrierSet::CardTableBarrierSet(CardTable* card_table) :
50 ModRefBarrierSet(BarrierSet::FakeRtti(BarrierSet::CardTableBarrierSet)),
51 _defer_initial_card_mark(false),
52 _card_table(card_table)
53 {}
54
55 void CardTableBarrierSet::initialize() {
56 initialize_deferred_card_mark_barriers();
57 }
58
59 CardTableBarrierSet::~CardTableBarrierSet() {
60 delete _card_table;
61 }
62
63 void CardTableBarrierSet::write_ref_array_work(MemRegion mr) {
64 _card_table->dirty_MemRegion(mr);
65 }
66
67 void CardTableBarrierSet::invalidate(MemRegion mr) {
68 _card_table->invalidate(mr);
69 }
|
5 * under the terms of the GNU General Public License version 2 only, as
6 * published by the Free Software Foundation.
7 *
8 * This code is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 * version 2 for more details (a copy is included in the LICENSE file that
12 * accompanied this code).
13 *
14 * You should have received a copy of the GNU General Public License version
15 * 2 along with this work; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/shared/cardTableBarrierSetAssembler.hpp"
26 #include "gc/shared/cardTableBarrierSet.inline.hpp"
27 #include "gc/shared/collectedHeap.hpp"
28 #include "gc/shared/genCollectedHeap.hpp"
29 #include "gc/shared/space.inline.hpp"
30 #include "logging/log.hpp"
31 #include "memory/virtualspace.hpp"
32 #include "oops/oop.inline.hpp"
33 #include "runtime/thread.hpp"
34 #include "services/memTracker.hpp"
35 #include "utilities/align.hpp"
36 #include "utilities/macros.hpp"
37
38 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
39 // enumerate ref fields that have been modified (since the last
40 // enumeration.)
41
42 CardTableBarrierSet::CardTableBarrierSet(BarrierSetAssembler* barrier_set_assembler,
43 CardTable* card_table,
44 const BarrierSet::FakeRtti& fake_rtti) :
45 ModRefBarrierSet(barrier_set_assembler,
46 fake_rtti.add_tag(BarrierSet::CardTableBarrierSet)),
47 _defer_initial_card_mark(false),
48 _card_table(card_table)
49 {}
50
51 CardTableBarrierSet::CardTableBarrierSet(CardTable* card_table) :
52 ModRefBarrierSet(make_barrier_set_assembler<CardTableBarrierSetAssembler>(),
53 BarrierSet::FakeRtti(BarrierSet::CardTableBarrierSet)),
54 _defer_initial_card_mark(false),
55 _card_table(card_table)
56 {}
57
58 void CardTableBarrierSet::initialize() {
59 initialize_deferred_card_mark_barriers();
60 }
61
62 CardTableBarrierSet::~CardTableBarrierSet() {
63 delete _card_table;
64 }
65
66 void CardTableBarrierSet::write_ref_array_work(MemRegion mr) {
67 _card_table->dirty_MemRegion(mr);
68 }
69
70 void CardTableBarrierSet::invalidate(MemRegion mr) {
71 _card_table->invalidate(mr);
72 }
|