-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P2
-
Affects Version/s: repo-valhalla
-
Component/s: hotspot
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 withJDK-8262863.
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
- relates to
-
JDK-8284443 [lworld] Follow-up work from support for scalarization of nullable inline types in the calling convention
-
- Open
-
-
JDK-8254218 [lworld] Calling Convention 2.0
-
- Open
-