I was reading the JEP doc about Value Objects in Java and came across a line in the motivation section in context of scalarization of objects that read like this:
There are optimizations which can eliminate object allocation in some regions of code. For example, objects can sometimes be "scalarized" into their component fields, if an escape analysis can be successfully carried out. However, such optimizations are limited in scope and applicability. For out-of-line calls, objects must still be boxed into memory, as long as existing Java reference semantics are enforced
I got the idea about the optimization that is spoken about here from the answer to this post.
The part that I am unable to understand is in the JEP, what does the author means by out-of-line calls? What can be a good example?
To keep it short, I understood the fact that Hotspot will unfold the fields of an Object and allocate them in the method stack if the object's scope doesn't leave the method.
What kind of code will look like out-of-line call?