RFR: JDK-8297796 GenShen: instrument the remembered set scan [v12]

William Kemper wkemper at openjdk.org
Wed Dec 21 19:45:18 UTC 2022


On Wed, 21 Dec 2022 17:40:44 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> I believe we switch into one of two modes based on the first card we encounter. So there are 3 states: an initial (neither), and then subsequently either dirty or clean. So there are 3 states, which is 2 bits. It's possible I could shrink it to 1 bit with some cleverness, but figured I wouldn't try too hard as this is still all non-product. I'll think some more about it.
>
> I re-examined the code with an eye to reducing the use of flags. Although I think it might be possible, I believe it would complicate the structure of the code a bit because of teh asymmetric treatment of clean and dirty. As things stand the symmetry of the treatment leads to more uniform and consistent code structure that makes the code more maintainable. We can revisit the reduction in state separately in the fullness of time.
> 
> I'll resolve this comment based on the above reasoning.

Okay, I was thinking that code of the form:

if (_last_dirty) {
  // ...
} else if (_last_clean) {
 // ...
}

Could be:

if (_last_dirty) {
  // ...
} else {
 // ...
}

But, as you point out, this doesn't handle the initial case.

-------------

PR: https://git.openjdk.org/shenandoah/pull/176


More information about the shenandoah-dev mailing list