(original) (raw)
I have a question about reifying array types. This is what I understand is the proposed behaviour:
- Foo - Reference, so erased
- Foo - Primitive, so reified
- Foo - In the Model 3 Classfile Design document, this is reified.
- Foo - Unclear - erased as reference, or reified as array?
The first two are quite clear, but I'm wondering about 3 and 4\. What is the reason for reifying the int\[\] in the Model 3 document? Considering that both int\[\] and String are subclasses of Object, can we not erase array types? If we can't erase them, does that apply to reference arrays as well, e.g. String\[\]?
--
Bjørn Vårdal
Bjørn Vårdal
----- Original message -----
From: Brian Goetz
Sent by: "valhalla-spec-experts"
To: valhalla-spec-experts@openjdk.java.net
Cc:
Subject: Model 3 classfile design document
Date: Fri, Jan 22, 2016 11:53 AM
Please find a document here:
http://cr.openjdk.java.net/\~briangoetz/valhalla/eg-attachments/model3-01.html
that describes our current thinking for evolving the classfile format to
clearly and efficiently represent parametric polymorphism. The early
concepts of this approach were outlined in my talk at JVMLS last year;
this represents a refinement of those ideas, and a reasonable "stake in
the ground" description of what seems the most sensible way to balance
preserving parametric information in the classfile without imposing
excessive runtime costs for loading specializations.
We're working on an updated compiler prototype which people will be able
to play with soon (along with a formal model.)
Please ask questions!
Some things this document does not address yet:
- How we deal with types implicit in the bytecodes (aload vs iload)
and how they get specialized;
- How we represent restricted methods in the classfile;
- How we represent the wildcard type Foo