Reducing class pointer size useful?
John Rose
john.r.rose at oracle.com
Sat Sep 11 01:30:57 UTC 2021
On Sep 10, 2021, at 4:11 AM, Thomas Stüfe <thomas.stuefe at gmail.com<mailto:thomas.stuefe at gmail.com>> wrote:
Would it be of use for Lilliput to shrink the class pointer size beyond 32
bit? I did not closely follow the discussions. Therefore I am not sure
where the current thinking goes.
Such things are on the table I think.
There are two parameters here: Number of
bits |ki| in the klass-ID, and size in bytes |ks|
(usually power of 2) of a klass struct.
Both |ki| and |ks| can be freely varied, I think,
as a design and optimization parameter.
1. *Not all* klasses need to be addressed using the
klass-ID of size |ki|; put another way, the first
2^|ki| glasses are privileged to have a compact
object header representation while other may
require more bits (an extension field in the
object layout).
2. *Not all* of the bytes of a klass need to be
represented in the |ks| bytes. You can add
a level of indirection, and it won’t hurt much
as long as all the stuff JVM need fastest access
to is in the first |ks| bytes.
The second insight leads also to the concept
of “near klass” vs “far klass”, and opens the
conversation about having *several* near klasses
for one far klass. In some designs, that allows
you to subdivide refine a system of classes
into a system of classes and “species”, where
several species can share on class.
More information about the lilliput-dev
mailing list