On 9/7/11 1:10 AM, John Rose wrote:

That's true, except that exceptions tend to be imprecise: It's hard to tell which sub-expression cause the exception, out of a complex statement.

Addressing both the precision and pre-allocation problems, you could ask the application to create the exception:

  public static <X extends Throwable>
  int addDetectingOverflow(int x, int y, X onOverflow) throws X
This would probably also mean that the exception object created for capturing the slow-case program state needs to be escape-analyzed and removed in the optimized code that deoptimizes on overflow?

- thomas

_______________________________________________
mlvm-dev mailing list
mlvm-dev@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev

Reply via email to