JNI compiler: Rewrite exception polling.
Make the slow path explicit in the JNI compiler. Fix the
CFI data for the exceptional path of synchronized methods.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: run-gtests.sh
Test: testrunner.py --target --optimizing
Bug: 172332525
Change-Id: If64965eef15c063e36b78dd8bb6cba5af34ab4fa
diff --git a/compiler/utils/jni_macro_assembler.h b/compiler/utils/jni_macro_assembler.h
index a9d9f54..5da70c1 100644
--- a/compiler/utils/jni_macro_assembler.h
+++ b/compiler/utils/jni_macro_assembler.h
@@ -243,8 +243,10 @@
virtual void CallFromThread(ThreadOffset<kPointerSize> offset) = 0;
// Generate code to check if Thread::Current()->exception_ is non-null
- // and branch to a ExceptionSlowPath if it is.
- virtual void ExceptionPoll(size_t stack_adjust) = 0;
+ // and branch to the `label` if it is.
+ virtual void ExceptionPoll(JNIMacroLabel* label) = 0;
+ // Deliver pending exception.
+ virtual void DeliverPendingException() = 0;
// Create a new label that can be used with Jump/Bind calls.
virtual std::unique_ptr<JNIMacroLabel> CreateLabel() = 0;