vastore and vaload

Remi Forax forax at univ-mlv.fr
Thu Sep 7 21:47:32 UTC 2017


I've just discovered that while the spec specified that vaload and vastore takes a constant class as parameter, the implementation use vaload and vastore with no parameter (like aaload, aastore).

Let see the tradeoffs:
1/ vaload/vastore <empty>  has the same bytecode shape as the other *aload/*astore, need to get the header of the array to find how to shift from one array cell to another,
                           it also mean you call the same vaload/vastore at a bci with array of different value types, which is pure evil from the JIT POV.
                           I believe it's only true if the verifier is deactivated otherwise, you need to have a stackframe when joining two different kinds of array.
                          
2/ vaload/vastore valueref has the same model as the other *aload/*astore bytecode, you can precompute the shift from one array cell to another.

so apart from the size of the opcodes, i think i prefer the solution 2.

Do i miss something ?

regards,
Rémi


More information about the valhalla-spec-observers mailing list