javaCalls::call and pending_exception
Deneau, Tom
tom.deneau at amd.com
Thu Feb 13 19:56:33 PST 2014
Gilles --
Question about the special javaCalls::call we are using to help with deoptimization.
We are trying to test a case where more than one workitem will deopt.
I have a test case which basically looks like
try {
int index = (gid % N == 0 ? num+1 : gid); // num + 1 forces an arrayOutOfBounds deopt
outArray[index] = outval;
} catch (ArrayIndexOutOfBoundsException e) {
// do some activities in catch block
}
So every Nth workitem will deopt. And we catch the exceptions in the same method.
When we run our range of workitems, we end up with several deopting and several others that are unable to run because the deopt save slots have been used up.
On return from the kernel dispatch, we are trying to do the following to handle
the workitems that were unable to run:
a) for the ones that deopted, use the javaCalls::call to call the special alternative
method to help with the deopt.
b) for the ones that didn't run at all use a normal javaCalls:call_virtual to
start at the beginning of the method like this
JavaCalls::call_virtual(&result, methKlass, mh->name(), mh->signature(), &javaArgs, THREAD);
As we process these workitems that didn't finish running on the gpu, we see that
all of the workitems in case a and some of the workitems in case b will
generate an ArrayIndexOutOfBoundsException which should get immediately caught.
For the javacalls of type b) above, we can see that all the workitems that
generate an ArrayIndexOutOfBoundsException did indeed execute the catch block.
However, for the special javacalls of type a) above, only the first such workitem
executes the catch block. After the second deopting workitem executes, we see
the thread->_pending_exception is set.
It seems like the type b) behavior is more correct since the exceptions are not
really pending but are being handled in the catch block. Why would the two
javaCalls cases behave differently?
-- Tom
More information about the graal-dev
mailing list