Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8278429

Escape analysis not behaving correctly with superclasses

XMLWordPrintable

      The attached benchmark shows a hot loop in which some objects are allocated as intermediate computations, but are then thrown away, as the loop is interested in a value that should really be scalarized.

      I noticed that EA behavior for this benchmark is erratic: if one of the objects being created has a superclass, then EA won't work, even though the benchmark doesn't touch any of the superclass fields.

      If the object hierarchy is flattened, EA works as expected, and the benchmark becomes considerably faster.

      Benchmark Mode Cnt Score Error Units
      PointerBenchmarkAnon.test avgt 30 4.836 ± 0.067 ms/op
      PointerBenchmarkAnon.testFlat avgt 30 0.242 ± 0.003 ms/op

            thartmann Tobias Hartmann
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: