A "RecursiveConstants" attribute

Dan Smith daniel.smith at oracle.com
Fri Jan 19 21:40:39 UTC 2018

> On Jan 19, 2018, at 2:24 PM, John Rose <john.r.rose at oracle.com> wrote:
> On Jan 19, 2018, at 12:11 PM, Dan Smith <daniel.smith at oracle.com> wrote:
>> To flesh the attribute idea out, here's a possible spec. Mentions CONSTANT_Dynamic for now, and would be modified in the future to name other constant types that allow cycles.
>> Is this a happy solution to the problems raised in previous discussions about constant cycles? Any new problems introduced?
> Yes, this is about what I had in mind when I made the suggestion of an
> acyclicity proof.  It reads well and looks like it would do the job.  I like
> the touch of assigning zero to a missing condy; that gracefully covers
> the many non-recursive cases.
> Like Karen, I assume this is not an addendum to the final "minimal condy"
> spec you sent out.

Nope, this isn't intended to be tied to condy. It's a separate effort.

The followup question is: when should we try to deliver it?

- SE 11: get it in when condy is introduced, avoid allowing any cyclical constant pools to escape into the wild
- Sometime soon after 11: address compatibility by easing into it, perhaps following the path of StackMapTable (optional at first)
- Next time we introduce a cyclical attribute: let condy be, don't disrupt anything until we need this check somewhere else

The SE 11 option has the advantage of avoiding future historical baggage (e.g., otherwise, to support 55.0 class files, the resolution-time check must remain in place forever). It has the disadvantage that it's late in the game to be introducing new JVM attributes.


More information about the valhalla-spec-observers mailing list