RFR: 8283441: C2: segmentation fault in ciMethodBlocks::make_block_at(int) [v3]

Tobias Hartmann thartmann at openjdk.java.net
Tue Apr 26 06:00:11 UTC 2022


On Mon, 25 Apr 2022 21:01:55 GMT, Dean Long <dlong at openjdk.org> wrote:

>> src/hotspot/share/ci/ciMethodBlocks.cpp line 151:
>> 
>>> 149:         cur_block->set_control_bci(bci);
>>> 150:         if (s.next_bci() < limit_bci) {
>>> 151:           ciBlock *fall_through = make_block_at(s.next_bci());
>> 
>> I see that we already have this check in place for some usages of `make_block_at`. Could we simply move the checks into that method (and assert `!= NULL` at use sides where this should never happen)? 
>> 
>> If not, can we at least remove the unused local variables? Like so:
>> 
>> Suggestion:
>> 
>>           make_block_at(s.next_bci());
>
> My first attempt was to use a macro MAKE_BLOCK_AT_FALLTHROUGH, but decided to minimize code changes instead, especially since the same pattern is used in the c1 code.
> 
> The unused local is used in several places in that function.  It seems to be a way to self-ducument the code without using a comment.  If I remove the unused local in one place, then I should probably do it everywhere and add more comments.

Okay, thanks for the background, looks good to me as is.

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

PR: https://git.openjdk.java.net/jdk/pull/8374


More information about the hotspot-compiler-dev mailing list