On Jan 29, 2019, at 12:27 PM, Brian Goetz <brian.go...@oracle.com> wrote: > > But, now we a problem: we have existing code that erases arrays to > `Object[]`, but after the flag day, such code will erase to Array instead.
Maybe, another way to address this, besides bridging distinct descriptors, is to declare that the old descriptors describe the new types. After all, the old descriptors will be dead (to Java) after the translation strategy stops using them. Make all descriptors of the form `[T` erase to `Array` or some subtype. This isa lossy translation, which means the interpreter will have to do extra runtime type checks on xaload/xastore instructions. The JIT probably won't care. The scheme might shipwreck on reflection, since we need to distinguish all the array classes reflectively, but maybe that's where Crasses (runtime class mirrors) come in handy, to make that distinction. Put another way, int[] and String[] and Object[] are mirrored by Crasses, not proper classes. Maybe there's a solution along this path. Or maybe the floor gives way at some point and you are plunged into the basement where the monsters are. — John