Hi Vitaly,
for PackedObjects/ObjectLayout you need to specially annotate the
classes and/or fields which you want to allocate "inline". Once you've
done that you have no choice with the PackedObjects approach.
ObjectLayout is a little special here, because it can run with any
Java VM in which case
Hi Volker,
Sorry, I may have been unclear in my question. As you say, ObjectLayout
requires that you annotate the fields that you'd like inlined and then also
use special API to construct those objects. I'm wondering whether,
instead, all private final fields are automatically inlined, and only
Hi Vitaly,
I don't think what you propose could be done in general. References
are polymorphic, i.e. you could have:
class Point { int x, y; }
class Line { Point p1, p2;}
Now how could you inline p1 and p2 into a Line object when you also have:
class Point3D extends Point { int z; }
You could
Right, but I'm talking about using same restrictions that ObjectLayout
requires (private final fields initialized inside constructor). I guess an
easy way to describe it as "do same thing automatically that would be done
manually using ObjectLayout".
sent from my phone
On Feb 3, 2015 11:53 AM, "
Gil, not sure if you saw my reply to Volker, but I agree -- I was simply
asking why request this optimization via explicit syntax and not do it
automatically in the runtime (with all the same restrictions, caveats, fine
print, etc).
On Tue, Feb 3, 2015 at 11:58 AM, Gil Tene wrote:
> A couple of
1) My assumption is that vast majority of classes will benefit from inline
storage of their collaborators. The waste would be in classes that have
hot and cold members together, but I think that's the minority? But, for
those cases, it would be beneficial to allow out-of-band layout (i.e.
today's
>
> But even if #2 is solved somehow for some subset of instantiations that
> the VM can auto-magically determine can be converted to a "placement-new"
> sort of allocation / construction sequence, there are plenty of final field
> assignment cases where the final ref field refers to an object that