Idea how to implement VT/VO compatibility in JVM
stef at epardaud.fr
Thu Jan 22 14:16:46 UTC 2015
On 01/22/2015 03:09 PM, Maurizio Cimadamore wrote:
> Well, to some extent, everything falls in the category of 'things to
> implement'. To be honest, it's not very clear from your emails how you
> plan to tackle those issues, and I don't mean in terms of C++ Hotspot
> code, but merely in terms of how things should be wired up. Saying
> there should be _some kind_ of instanceof support sounds a bit vague-ish?
Well, I assume there's a relation point back from specialised ArrayList
classes to the ArrayList class, no?
> Backing up a bit, there are two dimensions to the problem you are
> trying to solve; one is to have specialized(A) and erased(A) to
> respond to the same sets of messages; I think your strategy there
> ticks the boxes; yes, it leaves field access a bit behind, but let's
> say that's collateral damage (although you need to prove that this
> won't come up so frequently that it would represent a real source
> compatibility threat).
> The second dimension is to have specialized(A) 'is-a' erased(A) - and
> this is the part of the story that looks less clear.
And that's where you may be aware of technical issues that would make
this hard that I'm not aware of yet. If it's just about being able to
find back erased(A) from and instance of specialized(A) then it doesn't
sound too hard, I suppose that information will be available in the
runtime class for specialized(A), so `checkcast` and `instanceof` and
friends can use that for checks. Pretty much the same way we'd allow
these types to be interchangeable at compile-time from javac.
More information about the valhalla-dev