Error handling without exceptions (was: Throwable)
John.Rose at Sun.COM
Wed Aug 19 17:54:44 PDT 2009
On Aug 19, 2009, at 1:27 PM, Helmut Eller wrote:
> Is it possible to efficiently check the argument count and in case
> of a
> mismatch to call an error handler without unwinding the stack?
You can build this sort of thing on top of the primitives supplied by
JSR 292, but it doesn't need to be wired into the JVM. And, no, such
a feature would not be free; it would add significant overheads to
every method handle call. Using exceptions the way the JVM does keeps
hot paths clean. Any kind of "back up, coerce, and try again" logic
would require fast path code to preserve state for slow paths, which
translates to register pressure even if the feature is never used.
It's always easier on the optimizer if there is only one way forward.
More information about the mlvm-dev