-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8358735: GenShen: block_start() may be incorrect after class unloading #27353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
eec0844
f28571d
893f5e8
256944a
051e574
6c607af
0b4eac8
f304980
212aed4
b8fff8d
e2b61ed
c1356ef
63fde7e
69452aa
7b48ebf
ca728de
faaf779
4f1057e
490638f
84ad6b6
0583a04
7578484
9c87c2f
349818d
7697942
668e861
80198ab
e16ea23
d341522
643cdfd
637c177
0e2120b
29f5d42
cee16f8
9f629a2
2dc7e98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,9 +119,21 @@ class ShenandoahMarkBitMap { | |
| template<bm_word_t flip, bool aligned_right> | ||
| inline idx_t get_next_bit_impl(idx_t l_index, idx_t r_index) const; | ||
|
|
||
| inline idx_t get_next_one_offset (idx_t l_index, idx_t r_index) const; | ||
| // Helper for get_prev_{zero,one}_bit variants. | ||
| // - flip designates whether searching for 1s or 0s. Must be one of | ||
| // find_{zeros,ones}_flip. | ||
| // - aligned_left is true if l_index is a priori on a bm_word_t boundary. | ||
| template<bm_word_t flip, bool aligned_left> | ||
| inline idx_t get_prev_bit_impl(idx_t l_index, idx_t r_index) const; | ||
|
|
||
| // Search for the first marked address in the range [l_index, r_index), or r_index if none found. | ||
| inline idx_t get_next_one_offset(idx_t l_index, idx_t r_index) const; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please document analogous to line 131.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry. I overlooked this request in prior response. Done. |
||
|
|
||
| void clear_large_range (idx_t beg, idx_t end); | ||
| // Search for last one in the range [l_index, r_index). Return r_index if not found. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Symmetry arguments wrt spec for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment above regarding asymmetry. It is by design, due to shape of the data. |
||
| inline idx_t get_prev_one_offset(idx_t l_index, idx_t r_index) const; | ||
|
|
||
| // Clear the strong and weak mark bits for all index positions >= l_index and < r_index. | ||
| void clear_large_range(idx_t beg, idx_t end); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. documentation comment.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: l_index <-> beg in either comment or formal args to make them mutually consistent.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added a comment here as well. |
||
|
|
||
| // Verify bit is less than size(). | ||
| void verify_index(idx_t bit) const NOT_DEBUG_RETURN; | ||
|
|
@@ -162,12 +174,14 @@ class ShenandoahMarkBitMap { | |
|
|
||
| bool is_bitmap_clear_range(const HeapWord* start, const HeapWord* end) const; | ||
|
|
||
| // Return the address corresponding to the next marked bit at or after | ||
| // "addr", and before "limit", if "limit" is non-null. If there is no | ||
| // such bit, returns "limit" if that is non-null, or else "endWord()". | ||
| // Return the first marked address in the range [addr, limit), or limit if none found. | ||
| HeapWord* get_next_marked_addr(const HeapWord* addr, | ||
| const HeapWord* limit) const; | ||
|
|
||
| // Return the last marked address in the range [limit, addr], or addr+1 if none found. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Symmetry would have preferred
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah. The reason for the asymmetry is that forward-looking limit may not be a legitimate address (may be end of heap), whereas backward looking limit is a legitimate address. |
||
| HeapWord* get_prev_marked_addr(const HeapWord* limit, | ||
| const HeapWord* addr) const; | ||
|
|
||
| bm_word_t inverted_bit_mask_for_range(idx_t beg, idx_t end) const; | ||
| void clear_range_within_word (idx_t beg, idx_t end); | ||
| void clear_range (idx_t beg, idx_t end); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make more sense for these checks to move to the caller? It appears to me to be a leakage of abstraction to test these conditions here. We should be able to return the address for the marked bit found without interpreting the semantics of the bits themselves?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice that this is the case for the
get_next_...version below as well; if my comment makes some sense, this can be addressed separately.Perhaps frugality in testing the conditions required us to site these assertions here, which I kind of understand, although the right thing in that case is to have the wrapper class, viz.
ShenandoahMarkingContextmake those checks before calling here.