Review request for JDK-8067139
attila.szegedi at oracle.com
Wed Jan 28 16:36:49 UTC 2015
On Jan 28, 2015, at 4:42 PM, Marcus Lagergren <marcus.lagergren at oracle.com> wrote:
> OK this looks good. It’s somewhat semi-horrible to have an inlined finallies list per TryNode, but that’s the way it’s going to have to be, in this big picture, given the scope reification issues that we are stuck with in dynamic languages.
Well, the overall AST object mass is pretty comparable - just instead of copying the finally blocks before every relevant break/continue/return in the try body, we now hang them off of the TryNode. (As a matter of fact, it'd even be possible to add an optimization where - if the finally is itself terminal - we just emit it once below the try block and jump to it from break/continue/return. It's probably rare enough that it ain't worth bothering with it, though…)
The generated code ends up being slightly larger, as for every inlined finally block now there's also a GOTO instruction (3 bytes) to jump to it. But yeah, can't help it…
> Javac has it so easy.
> Tested upside down and sideways with different splitter thresholds and so on?
ant test, ant test262parallel, full octane suite, and full octane suite with default splitter threshold, and full octane suite with splitter threshold lowered to 1000. Yup. Since one of tricky parts of splitting is cross-split control flow transfer, I was admittedly weary of it, but fortunately I wrote SplitIntoFunctions.java logic back then so that it works with any kind of semi-structured jumps, and all it took for it to work with this new jump was a single-line visitor method override :-)
>> On 27 Jan 2015, at 16:39, Attila Szegedi <attila.szegedi at oracle.com> wrote:
>> Please review JDK-8067139 at <http://cr.openjdk.java.net/~attila/8067139/webrev.00> for <https://bugs.openjdk.java.net/browse/JDK-8067139>
More information about the nashorn-dev