From eb9cfa88525fd748cd069069a80fe1ca6aec0bc3 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 5 Sep 2023 10:43:07 +0800 Subject: [PATCH] Avoid virtual function dispatch overhead * src/androidvfs.c (android_saf_move_document): Circumvent JNI dynamic function dispatch on call to final method. --- src/androidvfs.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/androidvfs.c b/src/androidvfs.c index e8777892bd3..858816908f8 100644 --- a/src/androidvfs.c +++ b/src/androidvfs.c @@ -4410,11 +4410,13 @@ android_saf_move_document (const char *uri, char **doc_id, /* Do the rename. */ method = service_class.move_document; - result = (*android_java_env)->CallObjectMethod (android_java_env, - emacs_service, - method, uri1, - doc_id1, dir_name1, - dst_id1, src_id1); + result + = (*android_java_env)->CallNonvirtualObjectMethod (android_java_env, + emacs_service, + service_class.class, + method, uri1, + doc_id1, dir_name1, + dst_id1, src_id1); if (android_saf_exception_check (5, src_id1, dst_id1, dir_name1, doc_id1, uri1)) { -- 2.39.2