Interpret methods invoked via JNI in interpreter only mode.
This fixes the issue of Dhrystone having the same performance in
interpreter only mode. Main was executing compiled code since it
uses CallStaticVoidMethod directly. Now a check for interpreter
only mode in InvokeWithArgArray redirects it to the interpreter.
Change-Id: If6e6d8ede5cd0d8ad687d161667056373b1b031c
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 21725de..a89fb11 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -348,6 +348,13 @@
jresult = fn(soa.Env(), rcvr.get());
}
result->SetL(soa.Decode<Object*>(jresult));
+ } else if (shorty == "V") {
+ typedef void (fnptr)(JNIEnv*, jobject);
+ const fnptr* fn = reinterpret_cast<const fnptr*>(method->GetNativeMethod());
+ ScopedLocalRef<jobject> rcvr(soa.Env(),
+ soa.AddLocalReference<jobject>(receiver));
+ ScopedThreadStateChange tsc(self, kNative);
+ fn(soa.Env(), rcvr.get());
} else if (shorty == "LL") {
typedef jobject (fnptr)(JNIEnv*, jobject, jobject);
const fnptr* fn = reinterpret_cast<const fnptr*>(method->GetNativeMethod());