RFR: JDK-8302736: Major performance regression in Math.log on aarch64

Dean Long dlong at openjdk.org
Thu May 11 01:46:40 UTC 2023


On Thu, 11 May 2023 01:06:01 GMT, David Holmes <dholmes at openjdk.org> wrote:

> The trade-off of course is that if we push this too far down we may have to execute it far more often and so take a performance hit. So figuring out the optimum placement for these in the call stack seems rather difficult.

Most code does not care what the WXWrite state is.  We could use an alternative approach where code that needs a particular WXWrite state sets it, but when it is done not change the state back.  So instead of using ThreadWXEnable RAII that resets the state when it goes out of scope, we would use thread->enable_wx(WXWrite) before writing into the code cache and we would use thread->enable_wx(WXExec) when transitioning from _thread_in_vm to _thread_in_Java thread state.  The implementation of enable_wx() already makes redundant state transitions cheap.  This allows us to move the thread->enable_wx(WXWrite) to immediately before the write into the code cache without needing to worry about finding an optimal coarser scope if the code writes into the code cache in multiple places.

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

PR Comment: https://git.openjdk.org/jdk/pull/13606#issuecomment-1543129555


More information about the hotspot-dev mailing list