> On Oct 17, 2019, at 2:00 PM, John Rose <[email protected]> wrote: > > If the translation strategy were adjusted to translate every > new Foo() expression as invokestatic <new>
One interesting thing we might consider: 'invokestatic Foo.<new>(...)...' could implicitly be rewritten to 'new Foo; dup; invokespecial ...' if there is no declared '<new>' method. This lets us immediately implement the translation strategy you propose, without waiting for classes to be recompiled. It also gives us an atomic "newdupinit" bytecode for free. (I recognize, however, that most implicit magic like this that we've considered in the past has been dropped because the JVM doesn't like implicit magic.)
