RFR: 8255231: Avoid upcalls when initializing the statSampler

Claes Redestad redestad at openjdk.java.net
Thu Oct 22 10:41:18 UTC 2020


Current implementation of the statSampler does upcalls to System.getProperty to collect values for a number of properties that are all provided by the VM itself. And since the sampling starts before any user code run then no property can have changed.

I suggest refactoring the code so that no upcalls are made normally - while asserting this invariant holds using assert-only upcalls. 

This is a small startup optimization - reducing the startup sequence by approx. 300k instructions and 70k branches in my linux-x64 setup.

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

Commit messages:
 - Merge branch 'master' into com_ns
 - Improve comments
 - typo
 - Missing definition
 - Extract the shorthand java.version from VersionProps and use it in StatSampler
 - Improve assert
 - Assert on missing value
 - Re-arrange assertions to flow TRAPS through ok
 - Re-arrange assertions to flow TRAPS through ok
 - Remove TRAPS from assert-only method
 - ... and 6 more: https://git.openjdk.java.net/jdk/compare/cc50c8d4...7b922c2a

Changes: https://git.openjdk.java.net/jdk/pull/802/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=802&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8255231
  Stats: 126 lines in 8 files changed: 38 ins; 39 del; 49 mod
  Patch: https://git.openjdk.java.net/jdk/pull/802.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/802/head:pull/802

PR: https://git.openjdk.java.net/jdk/pull/802


More information about the hotspot-dev mailing list