After JDK-8218145 I noticed HandleMark::pop_and_restore became outlined in places where it was previously inlined. Analyzing the code it seems there are a few calls in that method that are rarely taken, so inlining could be helped by outlining these. Doing so marginally helps static footprint and a small reduction in instructions retired on some startup tests on linux-x64.
When in the neighborhood I noticed some code duplication between ~HandleMark and pop_and_restore, along with a now unused debugging counter (_nof_handlemarks - use was removed byJDK-8146850).
When in the neighborhood I noticed some code duplication between ~HandleMark and pop_and_restore, along with a now unused debugging counter (_nof_handlemarks - use was removed by