On Tue, 16 Apr 2024 06:48:05 GMT, Dean Long <dl...@openjdk.org> wrote:

>> I thought about that but in both places where these accessors are called 
>> (`frame::get_native_monitor()` and `frame::get_native_receiver()`) there are 
>> such asserts already:
>> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/runtime/frame.cpp#L1085
>
> OK, but I'd rather see it in the accessors too.  Some users are checking for 
> method()->is_native() and others are checking for is_osr_method(), so we need 
> to make sure those are always mutually exclusive: method()->is_native() != 
> is_osr_method().

We have separate `nmethod()` constructor for native method wrappers and it sets 
`_entry_bci = InvocationEntryBci;`. So it is impossible to have OSR native 
method wrapper.
But I agree with adding assert into accessors to catch accidental usage for not 
native methods.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18768#discussion_r1567603094

Reply via email to