[aarch64-port-dev ] RFR: Shenandoah import
Aleksey Shipilev
shade at redhat.com
Wed Oct 4 10:58:06 UTC 2017
On 10/04/2017 12:32 PM, Roman Kennke wrote:
>> I think it is a good style to make the "&& (expr)" additions to predicates where expr clearly
>> coverts itself into "true" when UseShenandoahGC is "false".
> I would go even further and use nested if statements like:
> if (UseShenandoahGC) {
> if (blabla) {
> }
> }
>
> or
>
> if (!UseShenandoahGC) {
> if (blabla) {
> }
> }
>
> and even retain intendation of upstream-code...
Not arguing against this, but preaching restraint with applying this rule. These two goals are
subtly inconsistent: we cannot move the upstream block under (!UseShenandoahGC) and not change it
indenting without breaking the code style, and thus setting us, reviewers, to making even more
mistakes. Not changing the indentation is also the source of bugs.
For many parts of e.g. compiler code injecting the UseShenandoahGC-guarded predicate seems like a
lesser evil. There are ways to do that without the need to restructure the predicate itself, thus
keeping the evaluation order the same:
- additional Shenandoah-specific exclusive condition:
(a & b) -> (a & b & (!UseShenandoahGC || c))
- additional Shenandoah-specific inclusive condition:
(a || b) -> (a || b || (UseShenandoahGC && c))
...etc.
Of course, if change requires restructuring the entire predicate, splitting out the body is the
lesser evil, but this is seldom the need for that.
-Aleksey
More information about the aarch64-port-dev
mailing list