[lworld] RFR: 8266466: [lworld] Enhance javac to consume unified primitive class files generated under the option -XDunifiedValRefClass [v2]
Srikanth Adayapalam
sadayapalam at openjdk.java.net
Fri May 21 14:04:45 UTC 2021
> Post the integration of https://bugs.openjdk.java.net/browse/JDK-8244227,
> the constructor of ClassType, takes a boolean isReferenceProjection as an additional
> parameter. Till now, it was feasible to upfront decide at the time of constructing
> a class type whether the proposed type is supposed to be a reference projection or not.
>
> This is no longer possible under the unified class file generation scheme we are
> moving to. When we see LFoo; in field/method signatures/descriptors, we don't know
> whether the type is Foo.ref of a primitive class Foo or a plain old reference type.
>
> Likewise when we see QFoo; we have an ambiguity whether this is the primitive class
> type Foo or is Foo.val type of a ref-default primitive class Foo. Till a class is
> fully built ("completed"), we don't know whether it is a primitive class and if so,
> what its ref-val defaultness is.
>
> Completing class Foo every time we see a type descriptor LFoo; or QFoo; is wasteful
> of resources. Nor is it possible as it is, since it would call for the ClassReader's
> code to be reentered even as some other class is being read in: So the proposed patch
> implements an incremental piece meal augmentation of attributes.
>
> I suggest the review be started with Type.java in ClassType#Flavor enumeration to gather
> a high level picture of the abstractions put in place to characterize a class type in
> an incremental basis. After Type.java, Attr.java, ClassReader.java and Symbol.java in
> that order provide a good order for review.
>
> Please note, while this patch puts together the infrastructure and layes the groundwork
> for modelling ref-default classes and thereby enable VBC migration work, such work will
> arrive separately at a later time.
>
> As of now javac knows only about primitive class and their reference projections and
> plain old reference types. There is no notion of ref-val defaultness yet, Nor a way
> to declare them.
Srikanth Adayapalam has updated the pull request incrementally with one additional commit since the last revision:
Fix problem caught by Maurizio during review - Use the right flavor.
-------------
Changes:
- all: https://git.openjdk.java.net/valhalla/pull/421/files
- new: https://git.openjdk.java.net/valhalla/pull/421/files/3f0b2ef9..1df1b722
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=valhalla&pr=421&range=01
- incr: https://webrevs.openjdk.java.net/?repo=valhalla&pr=421&range=00-01
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.java.net/valhalla/pull/421.diff
Fetch: git fetch https://git.openjdk.java.net/valhalla pull/421/head:pull/421
PR: https://git.openjdk.java.net/valhalla/pull/421
More information about the valhalla-dev
mailing list