RFR: 8256274: C2: Optimize copying of the shared type dictionary [v2]

Claes Redestad redestad at openjdk.java.net
Thu Nov 12 14:55:15 UTC 2020


> - Remove unused (and subtly broken) Dict deep copy constructors
> - Add a fixed, deep copy constructor to Dict which also takes the arena to allocate the copy in
> - Use this new deep copy constructor in Type::Initialize instead of copying by iterating over the shared dict
> 
> This reduce the overhead of each C2 compilation by ~32k instructions[1], with a noticeable gain on targeted micros such as `trivialMath_repeat_c2`. Baseline:
> Benchmark                                      Mode  Cnt    Score   Error  Units
> SimpleRepeatCompilation.trivialMath_repeat_c2    ss   10  396.004 ± 3.061  ms/op
> Patch:
> Benchmark                                      Mode  Cnt    Score   Error  Units
> SimpleRepeatCompilation.trivialMath_repeat_c2    ss   10  354.639 ± 1.929  ms/op
> 
> (Each fork does 2000 repeated compilations, so the improvement is somewhere around 20us/compilation)
> 
> [1] when instrumenting with valgrind+callgrind

Claes Redestad has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - Merge branch 'master' into copy_shared_dict
 - Clean-up, copyrights
 - 8256274: C2: Optimize copying of the shared type dictionary on compilation setup

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/1186/files
  - new: https://git.openjdk.java.net/jdk/pull/1186/files/ef930d0b..bcd6adb0

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1186&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1186&range=00-01

  Stats: 7268 lines in 189 files changed: 2728 ins; 4024 del; 516 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1186.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1186/head:pull/1186

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


More information about the hotspot-compiler-dev mailing list