11/*
2- * Copyright (c) 2001, 2020 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2001, 2021 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -36,74 +36,24 @@ class Space;
3636// This RemSet uses a card table both as shared data structure
3737// for a mod ref barrier set and for the rem set information.
3838
39- class CardTableRS : public CardTable {
39+ class CardTableRS : public CardTable {
4040 friend class VMStructs ;
4141 // Below are private classes used in impl.
4242 friend class VerifyCTSpaceClosure ;
4343 friend class ClearNoncleanCardWrapper ;
4444
4545 void verify_space (Space* s, HeapWord* gen_start);
4646
47- enum ExtendedCardValue {
48- youngergen_card = CT_MR_BS_last_reserved + 1 ,
49- // These are for parallel collection.
50- // There are three P (parallel) youngergen card values. In general, this
51- // needs to be more than the number of generations (including the perm
52- // gen) that might have younger_refs_do invoked on them separately. So
53- // if we add more gens, we have to add more values.
54- youngergenP1_card = CT_MR_BS_last_reserved + 2 ,
55- youngergenP2_card = CT_MR_BS_last_reserved + 3 ,
56- youngergenP3_card = CT_MR_BS_last_reserved + 4 ,
57- cur_youngergen_and_prev_nonclean_card =
58- CT_MR_BS_last_reserved + 5
59- };
60-
61- // An array that contains, for each generation, the card table value last
62- // used as the current value for a younger_refs_do iteration of that
63- // portion of the table. The perm gen is index 0. The young gen is index 1,
64- // but will always have the value "clean_card". The old gen is index 2.
65- CardValue* _last_cur_val_in_gen;
66-
67- CardValue _cur_youngergen_card_val;
68-
69- // Number of generations, plus one for lingering PermGen issues in CardTableRS.
70- static const int _regions_to_iterate = 3 ;
71-
72- CardValue cur_youngergen_card_val () {
73- return _cur_youngergen_card_val;
74- }
75- void set_cur_youngergen_card_val (CardValue v) {
76- _cur_youngergen_card_val = v;
77- }
78- bool is_prev_youngergen_card_val (CardValue v) {
79- return
80- youngergen_card <= v &&
81- v < cur_youngergen_and_prev_nonclean_card &&
82- v != _cur_youngergen_card_val;
83- }
84- // Return a youngergen_card_value that is not currently in use.
85- CardValue find_unused_youngergenP_card_value ();
86-
8747public:
8848 CardTableRS (MemRegion whole_heap, bool scanned_concurrently);
89- ~CardTableRS ();
9049
9150 void younger_refs_in_space_iterate (Space* sp, HeapWord* gen_boundary, OopIterateClosure* cl);
9251
9352 virtual void verify_used_region_at_save_marks (Space* sp) const NOT_DEBUG_RETURN;
9453
95- // Override.
96- void prepare_for_younger_refs_iterate (bool parallel);
97-
98- // Card table entries are cleared before application;
99- void at_younger_refs_iterate ();
100-
101- void inline_write_ref_field_gc (void * field, oop new_val) {
54+ void inline_write_ref_field_gc (void * field) {
10255 CardValue* byte = byte_for (field);
103- *byte = youngergen_card;
104- }
105- void write_ref_field_gc_work (void * field, oop new_val) {
106- inline_write_ref_field_gc (field, new_val);
56+ *byte = dirty_card_val ();
10757 }
10858
10959 bool is_aligned (HeapWord* addr) {
@@ -117,33 +67,6 @@ class CardTableRS: public CardTable {
11767
11868 void invalidate_or_clear (Generation* old_gen);
11969
120- bool is_prev_nonclean_card_val (CardValue v) {
121- return
122- youngergen_card <= v &&
123- v <= cur_youngergen_and_prev_nonclean_card &&
124- v != _cur_youngergen_card_val;
125- }
126-
127- static bool youngergen_may_have_been_dirty (CardValue cv) {
128- return cv == CardTableRS::cur_youngergen_and_prev_nonclean_card;
129- }
130-
131- // *** Support for parallel card scanning.
132-
133- // dirty and precleaned are equivalent wrt younger_refs_iter.
134- static bool card_is_dirty_wrt_gen_iter (CardValue cv) {
135- return cv == dirty_card;
136- }
137-
138- // Returns "true" iff the value "cv" will cause the card containing it
139- // to be scanned in the current traversal. May be overridden by
140- // subtypes.
141- bool card_will_be_scanned (CardValue cv);
142-
143- // Returns "true" iff the value "cv" may have represented a dirty card at
144- // some point.
145- bool card_may_have_been_dirty (CardValue cv);
146-
14770 // Iterate over the portion of the card-table which covers the given
14871 // region mr in the given space and apply cl to any dirty sub-regions
14972 // of mr. Clears the dirty cards as they are processed.
@@ -153,18 +76,6 @@ class CardTableRS: public CardTable {
15376 OopIterateClosure* cl,
15477 CardTableRS* ct);
15578
156- // This is an array, one element per covered region of the card table.
157- // Each entry is itself an array, with one element per chunk in the
158- // covered region. Each entry of these arrays is the lowest non-clean
159- // card of the corresponding chunk containing part of an object from the
160- // previous chunk, or else NULL.
161- typedef CardValue* CardPtr;
162- typedef CardPtr* CardArr;
163- CardArr* _lowest_non_clean;
164- size_t * _lowest_non_clean_chunk_size;
165- uintptr_t * _lowest_non_clean_base_chunk_index;
166- volatile int * _last_LNC_resizing_collection;
167-
16879 virtual bool is_in_young (oop obj) const ;
16980};
17081
@@ -179,9 +90,6 @@ class ClearNoncleanCardWrapper: public MemRegionClosure {
17990 // Clears the given card, return true if the corresponding card should be
18091 // processed.
18192 inline bool clear_card (CardValue* entry);
182- // Work methods called by the clear_card()
183- inline bool clear_card_serial (CardValue* entry);
184- inline bool clear_card_parallel (CardValue* entry);
18593 // check alignment of pointer
18694 bool is_word_aligned (CardValue* entry);
18795
0 commit comments