From cd13adc60dd4cab3dac8f1a5738f68d89dc57d64 Mon Sep 17 00:00:00 2001 From: Nevo Date: Sun, 7 Sep 2008 23:53:22 +0200 Subject: [PATCH] Cannot use native methods directly, always use resolveNativeWrapper JEM has to manipulate the Java Operand Stack, so we cannot call native methods directly and have to use resolveNativeWrapper with them too. --- src/dll.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/dll.c b/src/dll.c index 426ef8c..144f28d 100644 --- a/src/dll.c +++ b/src/dll.c @@ -171,8 +171,17 @@ void *lookupInternal(MethodBlock *mb) { if(verbose) jam_printf("internal"); +#ifdef JEM + /* + * Since native method would be invoked in separate stack storage in + * JEM, still use resolveNativeWrapper as our native_invoker here, + * which would pay off the performance lost + */ + return (void*)methods[i].method; +#else /* Found it -- set the invoker to the native method */ return mb->native_invoker = (void*)methods[i].method; +#endif } } -- 2.11.4.GIT