RFR: 8269476: Skip nmethod entry barrier if there is no oops in the jit code [v2]
王超
github.com+25214855+casparcwang at openjdk.java.net
Mon Jun 28 13:29:03 UTC 2021
On Mon, 28 Jun 2021 13:18:13 GMT, 王超 <github.com+25214855+casparcwang at openjdk.org> wrote:
>> You may need an additional instruction, e.g. uses MSB of disarmed_value to indicate always disarmed and test the bit before `cmpl`.
>>
>> Also, you need a new method to set the bit during nmethod registration.
>>
>> nmethod entry barrier tests is_armed() early, so may benefit more.
>
>> You may need an additional instruction, e.g. uses MSB of disarmed_value to indicate always disarmed and test the bit before `cmpl`.
>>
>> Also, you need a new method to set the bit during nmethod registration.
>>
>> nmethod entry barrier tests is_armed() early, so may benefit more.
>
> The barrier can be bypassed only when the nmethod does not any contain oop relocation, if it's bypassed, it should always be bypassed, there is no need to test the bit of disarmed_value.
>
> I think several `nop` instruction can be added before `cmpl`, and patched to direct jump if the barrier can be bypassed. And when the nmethod is changed to contain oops again, the direct jump should be patched to `nop` again.
>
> `x86_instruction_opcode disarmed_value_addr, some_magic_number_immediate; jcc label;` : If there exists some instructions like this, only need to change `some_magic_number_immediate` to make the following `jcc` instruction alway jump, this is the dream version of code sequences, but I do not figure out which instructions can be used to implement this functionality.
maybe `subl ; jcc` can be used to implement a more compact version, but the `nop`<->`jump` can benefit more
-------------
PR: https://git.openjdk.java.net/jdk/pull/4610
More information about the hotspot-dev
mailing list