RFR 8028347: Rewriter::scan_method asserts with array oob in RT_Baseline

John Rose john.r.rose at oracle.com
Thu Nov 14 12:22:13 PST 2013

Rather than messing with the exceptions more, it would be better to have rewrite_invokespecial return a boolean for success, and have the caller (in the forward direction only) throw the exception.

The CATCH macro use makes me especially nervous.  It's almost always the wrong answer.

Also, exceptions are wrong here (in hindsight) because they cause rewrite_invokespecial to fail out halfway, and then it's probably wrong to reverse all the way.  I.e., suppose you have three invokespecials, of which the second fails:  You will then *not* rewrite the third, and when attempting to reverse all three of them (during failure processing) you will probably do something wrong trying to reverse the third which was *not* rewritten.

So (in hindsight) exceptions are the wrong tool for the job here; accumulate a "failing" boolean, finish the rewrite pass, and then un-rewrite it all cleanly before throwing the exception.

Sorry I didn't catch this.  When I have worked on rewriter.cpp, I have stayed away from exceptions for these sorts of reasons, and I should have called it out on first review.

— John

On Nov 14, 2013, at 12:01 PM, Coleen Phillimore <coleen.phillimore at oracle.com> wrote:

> Summary: Fix reversing rewriting for invokespecial (which I broke with last checkin)
> Ran runtime jtreg tests (including failing tests).   Rerunning vm.mlvm.testlist.
> open webrev at http://cr.openjdk.java.net/~coleenp/8028347/
> bug link https://bugs.openjdk.java.net/browse/JDK-8028347
> Thanks,
> Coleen

More information about the hotspot-runtime-dev mailing list