Remove small duplicate code in Generic JNI handling, add comments
Change-Id: Ib276fa63b6a00480eaaff6c352d37917c61e966c
diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
index a4491d4..36dc1cb 100644
--- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc
@@ -1498,7 +1498,11 @@
// Retrieve the stored native code.
const void* nativeCode = called->GetNativeMethod();
- // Check whether it's the stub to retrieve the native code, we should call that directly.
+ // There are two cases for the content of nativeCode:
+ // 1) Pointer to the native function.
+ // 2) Pointer to the trampoline for native code binding.
+ // In the second case, we need to execute the binding and continue with the actual native function
+ // pointer.
DCHECK(nativeCode != nullptr);
if (nativeCode == GetJniDlsymLookupStub()) {
nativeCode = artFindNativeMethod();