RFR (S) 8217714: [lworld] Support for substitutability checks in interpreter

John Rose john.r.rose at oracle.com
Fri Jun 7 05:21:26 UTC 2019

On Jun 5, 2019, at 5:22 AM, Frederic Parain <frederic.parain at oracle.com> wrote:
> interpreterRuntime.cpp: 529:
> Instead of 
> 530     fatal("isSubstitutable() raised exception");
> 531   }
> I would prefer
>  guarantee(!HAS_PENDING_EXCEPTION,"isSubstitutable() raised exception”);
> Are we sure that the substitutability test will never, ever throw an exception?

Good question.  The answer is "no".

I can imagine the VM wanting to throw some kind of VirtualMachineError
in pathological cases.  The normal implementation will have an occasional
recursion which might (pathologically) be deep enough to trigger SOE.
Even the single stack frame that is pushed by the code under review
(JavaCalls::call in InterpreterRuntime::is_substitutable) could trigger SOE
in very unlucky circumstances.

This is not so far-fetched if you remember that the interpreter might
already be on the edge of an SOE for other reasons.

We try hard not to crash even when we run out of stack at just the
wrong moment.

So, I think that we should allow acmp to be a throwing bytecode,
at this point.  Almost any JVM operation can throw a VME, after all.

— John

More information about the valhalla-dev mailing list