RFR: 8318383: Remove duplicated checks in os::get_native_stack() in posix implementation

Zhengyu Gu zgu at openjdk.org
Thu Oct 19 14:31:41 UTC 2023


On Thu, 19 Oct 2023 02:45:41 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Hi Zhengyu,
>> 
>> This is not trivial :)
>> 
>> let
>> A=> fp == null
>> B=> cb != null
>> C=> sender-pc == null
>> D=> is_first_frame
>> 
>> Old:
>> if (A || B || C || D) break;
>> if (!C && !D) get_sender_for...;
>> 
>> New:
>> if (A || B || C || D) break;
>> get_sender...
>> 
>> Not sure if that is correct, but it is at least not equivalent, so not a simple cleanup.
>> 
>> (note that I support any cleanup, the old code is terrible).
>
> @tstuefe It took me a while to get it too. If we don't break then the two conditions we were checking must be true - else we would not reach that check.

Thanks, @dholmes-ora @tstuefe

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

PR Comment: https://git.openjdk.org/jdk/pull/16232#issuecomment-1771041958


More information about the hotspot-runtime-dev mailing list