(original) (raw)

The class file design looks good. I have two questions:
  1. Will the template class be accessible as a java/lang/Class (or equivalent) in its unspecialized form? If so, will any of the type variable information be made available through this class? We're wondering how much information needs to be stored in our class objects.
  2. The document uses the example where an Outer class' type variable is propagated into the Inner class' GenericClass attribute.
    In this case:

    class Outer {
    class Inner {
    }
    }


    where Inner doesn't declare any type variables, my understanding is that Inner will still have the GenericClass attribute because it may refer to T. Will Inner still appear as the first class frame, with tvarCount=0, enforcing the rule that the first element is always the class itself?
--
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