From fd3077e4b9ebadd281777310d26e64443858f653 Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Wed, 23 Apr 2014 10:32:43 +0200 Subject: Refactor exception handling for deoptimization 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 --- runtime/Android.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime/Android.mk') diff --git a/runtime/Android.mk b/runtime/Android.mk index d433fd5..bc971a9 100644 --- a/runtime/Android.mk +++ b/runtime/Android.mk @@ -36,10 +36,10 @@ LIBART_COMMON_SRC_FILES := \ base/unix_file/string_file.cc \ check_jni.cc \ catch_block_stack_visitor.cc \ - catch_finder.cc \ class_linker.cc \ common_throws.cc \ debugger.cc \ + deoptimize_stack_visitor.cc \ dex_file.cc \ dex_file_verifier.cc \ dex_instruction.cc \ @@ -129,6 +129,7 @@ LIBART_COMMON_SRC_FILES := \ os_linux.cc \ parsed_options.cc \ primitive.cc \ + quick_exception_handler.cc \ quick/inline_method_analyser.cc \ reference_table.cc \ reflection.cc \ -- cgit v1.1