Fix deoptimization with pending exception
When deoptimizing the stack, we set a fake exception in the current
Thread* (see method Thread::GetDeoptimizationException). On the next
exception check, the QuickExceptionHandler will deoptimize the stack.
The issue is when we deoptimize while an exception is already pending
in the current Thread*: setting the fake exception will clobber the
pending exception which is not correct. This happens in the
artQuickToInterpreterBridge when returning from the interpreter and
we want to deoptimize the stack for debugging (like single-stepping).
This CL saves the pending exception before asking for deoptimization.
Then the exception is restored just before executing the deoptimized
frames with the interpreter.
Also cleans up the way we save deoptimization context (return value
and pending exception).
Bug: 23371176
Bug: 19944235
Change-Id: I7f4c8347b328817c452beda3399e210eba3a88a4
10 files changed