[lworld] Keep buffer oop on scalarized calls

XMLWordPrintable

      Currently, the scalarized calling convention does not keep the buffer oop if there's any. As a result, buffer allocations are lost once a value object is passed in scalarized form.

      The attached test TestBufferLost.java demonstrates this:

      java --enable-preview -Xmx200M -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -XX:CompileCommand=dontinline,*::*Callee -Xbatch -XX:-TieredCompilation TestBufferLost.java
      CompileCommand: dontinline *.*Callee bool dontinline = true
      Terminating due to java.lang.OutOfMemoryError: Java heap space

      Whereas with -XX:-InlineTypePassFieldsAsArgs it will pass just fine and only need 70 MB of java heap space.

      We need to be careful that a call does not keep an otherwise unused buffer allocation live. We only want to pass it if it's always available, i.e. "free", in the caller. For the code that handles this for returns, see Compile::process_inline_types.

      We fixed this already for scalarized returns with JDK-8262863.

            Assignee:
            Unassigned
            Reporter:
            Tobias Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: