RFR: 8359064: Expose reason for marking nmethod non-entrant to JVMCI client [v7]

Cesar Soares Lucas cslucas at openjdk.org
Wed Jun 18 17:32:32 UTC 2025


On Wed, 18 Jun 2025 16:53:51 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

>> Cesar Soares Lucas has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Prevent overriding invalidation reason.
>
> src/hotspot/share/jvmci/jvmciCompilerToVM.cpp line 1408:
> 
>> 1406: 
>> 1407: C2V_VMENTRY(void, invalidateHotSpotNmethod, (JNIEnv* env, jobject, jobject hs_nmethod, jboolean deoptimize, jint invalidation_reason))
>> 1408: #ifdef ASSERT
> 
> We prefer runtime checks and throwing Java exceptions than assertions in this JVMCI code:
> 
>   int first = static_cast<int>(nmethod::InvalidationReason::UNKNOWN);
>   int last = static_cast<int>(nmethod::InvalidationReason::LAST_REASON);
>   if (invalidation_reason < first || invalidation_reason >= last) {
>     JVMCI_THROW_MSG(IllegalArgumentException, err_msg("Invalid invalidation_reason: %d", invalidation_reason ));
>   }

Got it. I'll patch the code.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25706#discussion_r2155147173


More information about the graal-dev mailing list