summaryrefslogtreecommitdiffstats
path: root/runtime/catch_block_stack_visitor.cc
Commit message (Collapse)AuthorAgeFilesLines
* Refactor exception handling for deoptimizationSebastien Hertz2014-04-251-59/+11
| | | | | | | | | | | | | | | | | | | | | | This CL refactors the exception handling (on the quick side) by isolating the search of catch handler and the preparation of deoptimization. We rename the CatchFinder class to QuickExceptionHandler so it's less specific to catch handler search. Finding catch handler happens in QuickExceptionHandler::FindCatch. Since the CatchBlockStackVisitor resolves exception types, it may cause thread suspension and breaks the assertion current thread can't be suspended. Therefore, we place the exception in a SirtRef (while it is detached from the current thread) and remove the thread suspension assertion. Deoptimization now happens in QuickExceptionHandler::DeoptimizeStack. It uses the new DeoptimizeStackVisitor class to create shadow frames. We also add the Thread::GetDeoptimizationException method to get the definition of the fake exception in only one place. Change-Id: I01b19fa72af64329b5c3b6c7f0c3339d2d724978
* Fix FindCatchBlock to work in -Xverify:none mode.Jeff Hao2014-04-221-1/+3
| | | | | | | | FindCatchBlock now uses ResolveType to get the exception type, since it might not be able to find it in the dex cache. Bug: 13948502 Change-Id: Ia6f1c7dc743206ae1c8551bf6239f48ee4d3a784
* Avoid instrumentation stack corruption.Sebastien Hertz2014-01-101-0/+111
While debugging a throwing exception, we may end up updating instrumentation stack frame after having already walked the native stack. This leads to not pop instrumentation frames prior to catch handler (or upcall if exception is not caught) and get it desynchronized with the native stack. To solve this issue, we need to walk the stack again after having reporting the exception to the instrumentation listener (for example: the debugger) which may push new instrumentation stack frames. However we do it only when we know instrumentation is enabled to not slow down exception delivery when executing code without instrumentation. Here are the main changes: - Creates InstrumentationStackVisitor to compute the number of instrumentation frames to pop (previously done in CatchBlockStackVisitor). We only count frames prior to catch handler (or upcall). Popping instrumentation frames is done after having reported the exception to the instrumentation listener. - Updates the CatchBlockStackVisitor to remove instrumentation frame handling and focus only on finding the catch handler and prepare deoptimization. - Creates CatchFinder class to control both visitors and do the long jump. Change-Id: I29b3871403f297bfb8c087e27f1330b002f5d56d