RFR: 8240772: x86_64: Pre-generate Assembler::popa, pusha and vzeroupper

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Mar 10 18:55:39 UTC 2020


Hi Claes,

I don't think you can guaranty that these instructions will be called during bootstrap.

I was thinking about calling precompute_instructions() from generate_initial() in stubGenerator_x86_64.cpp so it is 
definitely called during bootstrap.

thanks,
Vladimir K

On 3/10/20 6:46 AM, Claes Redestad wrote:
> Hi,
> 
> calculate some invariant Assembler routines at bootstrap, copy on
> subsequent invocations.
> 
> For popa and pusha this means an overhead reduction of around 98% (from
> ~2500 instructions to emit a pusha to ~50). For vzeroupper an overhead
> reduction of ~65% (117 -> 42). Together these add up to about a 1%
> reduction of instructions executed on a Hello World - with some
> (smaller) scaling impact on larger applications.
> 
> The initialization is very simple/naive, i.e., lacks any kind of synchronization protocol. But as this setup is 
> guaranteed to happen very
> early during bootstrap this should be fine. Thanks Ioi for some helpful
> suggestions here!
> 
> Bug:    https://bugs.openjdk.java.net/browse/JDK-8240772
> Webrev: http://cr.openjdk.java.net/~redestad/8240772/open.00/
> 
> Testing: tier1-3
> 
> Thanks!
> 
> /Claes


More information about the hotspot-compiler-dev mailing list