RFR: 8309209: C2 failed "assert(_stack_guard_state == stack_guard_reserved_disabled) failed: inconsistent state" [v4]

David Holmes dholmes at openjdk.org
Wed Jun 28 08:05:22 UTC 2023


On Wed, 28 Jun 2023 06:10:55 GMT, Amit Kumar <amitkumar at openjdk.org> wrote:

>> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix typo
>
> Here is s390x port:
> 
> diff --git a/src/hotspot/cpu/s390/interp_masm_s390.cpp b/src/hotspot/cpu/s390/interp_masm_s390.cpp
> index 79c758f8b11..7555eb05b1f 100644
> --- a/src/hotspot/cpu/s390/interp_masm_s390.cpp
> +++ b/src/hotspot/cpu/s390/interp_masm_s390.cpp
> @@ -952,6 +952,11 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
>      // Test if reserved zone needs to be enabled.
>      Label no_reserved_zone_enabling;
>  
> +    // check if already enabled - if so no re-enabling needed
> +    guarantee(sizeof(StackOverflow::StackGuardState) == 4, "unexptected size");
> +    z_ly(Z_R0, Address(Z_thread, JavaThread::stack_guard_state_offset()));
> +    compare32_and_branch(Z_R0, StackOverflow::stack_guard_enabled, bcondEqual, no_reserved_zone_enabling);
> +
>      // Compare frame pointers. There is no good stack pointer, as with stack
>      // frame compression we can get different SPs when we do calls. A subsequent
>      // call could have a smaller SP, so that this compare succeeds for an
> 
> 
> 
> @TheRealMDoerr I have a 2nd patch as well, Would you please confirm which will be better:
> 
> 
> diff --git a/src/hotspot/cpu/s390/interp_masm_s390.cpp b/src/hotspot/cpu/s390/interp_masm_s390.cpp
> index 79c758f8b11..a6774326286 100644
> --- a/src/hotspot/cpu/s390/interp_masm_s390.cpp
> +++ b/src/hotspot/cpu/s390/interp_masm_s390.cpp
> @@ -952,6 +952,12 @@ void InterpreterMacroAssembler::remove_activation(TosState state,
>      // Test if reserved zone needs to be enabled.
>      Label no_reserved_zone_enabling;
>  
> +    // check if already enabled - if so no re-enabling needed
> +    guarantee(sizeof(StackOverflow::StackGuardState) == 4, "unexptected size");
> +    z_cli(Address(Z_thread, JavaThread::stack_guard_state_offset() + in_ByteSize(sizeof(StackOverflow::StackGuardState) - 1)),
> +            StackOverflow::stack_guard_enabled);
> +    z_bre(no_reserved_zone_enabling);
> +
>      // Compare frame pointers. There is no good stack pointer, as with stack
>      // frame compression we can get different SPs when we do calls. A subsequent
>      // call could have a smaller SP, so that this compare succeeds for an

Thanks @offamitkumar ! I've applied the first variant for now.

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

PR Comment: https://git.openjdk.org/jdk/pull/14669#issuecomment-1610946742


More information about the hotspot-compiler-dev mailing list