diff -Nru openjdk-6-6b24-1.11.5/aclocal.m4 openjdk-6-6b24-1.11.5/aclocal.m4 --- openjdk-6-6b24-1.11.5/aclocal.m4 2012-10-17 11:45:19.000000000 +0100 +++ openjdk-6-6b24-1.11.5/aclocal.m4 2012-10-27 22:32:01.000000000 +0100 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.11.6 -*- Autoconf -*- +# generated automatically by aclocal 1.11.5 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, @@ -198,7 +198,7 @@ [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.6], [], +m4_if([$1], [1.11.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -214,7 +214,7 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.6])dnl +[AM_AUTOMAKE_VERSION([1.11.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) diff -Nru openjdk-6-6b24-1.11.5/arm_port/hotspot/src/cpu/zero/vm/cppInterpreter_arm.S openjdk-6-6b24-1.11.5/arm_port/hotspot/src/cpu/zero/vm/cppInterpreter_arm.S --- openjdk-6-6b24-1.11.5/arm_port/hotspot/src/cpu/zero/vm/cppInterpreter_arm.S 2012-04-14 15:52:22.000000000 +0100 +++ openjdk-6-6b24-1.11.5/arm_port/hotspot/src/cpu/zero/vm/cppInterpreter_arm.S 2012-10-26 12:23:22.000000000 +0100 @@ -583,13 +583,13 @@ .arch armv4 #else - .arch armv7-a + .arch armv6 #endif #ifdef HW_FP #ifdef __ARM_PCS_VFP - .fpu vfpv3-d16 + .fpu vfpv2 .eabi_attribute Tag_ABI_HardFP_use, 3 .eabi_attribute Tag_ABI_VFP_args, 1 #else // __ARM_PCS_VFP @@ -5046,7 +5046,7 @@ SUB_DISPATCH_TABLES - .arch armv7-a + .arch armv6 ALIGN_CODE .global Thumb2_stubs diff -Nru openjdk-6-6b24-1.11.5/debian/changelog openjdk-6-6b24-1.11.5/debian/changelog --- openjdk-6-6b24-1.11.5/debian/changelog 2013-03-01 20:11:25.000000000 +0000 +++ openjdk-6-6b24-1.11.5/debian/changelog 2012-10-27 01:16:02.000000000 +0100 @@ -1,3 +1,12 @@ +openjdk-6 (6b24-1.11.5-1+rpi1) wheezy; urgency=low + + * Alter arm_port/hotspot/src/cpu/zero/vm/cppInterpreter_arm.S for armv6 + * Update jamvm to 4617da717ecb05654ea5bb9572338061106a414d + * Build as native package since otherwise dpkg-source won't like new + Jamvm tarball + + -- Peter Michael Green Fri, 26 Oct 2012 11:21:02 +0000 + openjdk-6 (6b24-1.11.5-1) unstable; urgency=low * Upload to unstable. diff -Nru openjdk-6-6b24-1.11.5/debian/openjdk-6-jre-zero/usr/share/lintian/overrides/openjdk-6-jre-zero openjdk-6-6b24-1.11.5/debian/openjdk-6-jre-zero/usr/share/lintian/overrides/openjdk-6-jre-zero --- openjdk-6-6b24-1.11.5/debian/openjdk-6-jre-zero/usr/share/lintian/overrides/openjdk-6-jre-zero 1970-01-01 01:00:00.000000000 +0100 +++ openjdk-6-6b24-1.11.5/debian/openjdk-6-jre-zero/usr/share/lintian/overrides/openjdk-6-jre-zero 2012-10-27 14:33:37.000000000 +0100 @@ -0,0 +1,6 @@ +# the doc directory and the symlink are in openjdk-6-jre-headless +openjdk-6-jre-zero binary: no-copyright-file +openjdk-6-jre-zero binary: usr-share-doc-symlink-without-dependency + +# Strip libjvm.so with --strip-debug instead of --strip-unneeded. LP: #574997. +openjdk-6-jre-zero binary: unstripped-binary-or-object Binary files /tmp/qolOyOjQ8X/openjdk-6-6b24-1.11.5/jamvm-4617da717ecb05654ea5bb9572338061106a414d.tar.gz and /tmp/v1pR03Aeh3/openjdk-6-6b24-1.11.5/jamvm-4617da717ecb05654ea5bb9572338061106a414d.tar.gz differ Binary files /tmp/qolOyOjQ8X/openjdk-6-6b24-1.11.5/jamvm-e70f2450890b82c37422616cc85e1a23385f03cd.tar.gz and /tmp/v1pR03Aeh3/openjdk-6-6b24-1.11.5/jamvm-e70f2450890b82c37422616cc85e1a23385f03cd.tar.gz differ diff -Nru openjdk-6-6b24-1.11.5/Makefile.am openjdk-6-6b24-1.11.5/Makefile.am --- openjdk-6-6b24-1.11.5/Makefile.am 2012-10-17 11:37:56.000000000 +0100 +++ openjdk-6-6b24-1.11.5/Makefile.am 2012-10-27 01:16:36.000000000 +0100 @@ -11,8 +11,8 @@ CACAO_URL = $(CACAO_BASE_URL)/$(CACAO_VERSION).tar.gz CACAO_SRC_ZIP = cacao-$(CACAO_VERSION).tar.gz -JAMVM_VERSION = 4617da717ecb05654ea5bb9572338061106a414d -JAMVM_SHA256SUM = 47fce7bd556c1b1d29a93b8c45497e0d872b48b7f535066b303336f29d0f0d8d +JAMVM_VERSION = e70f2450890b82c37422616cc85e1a23385f03cd +JAMVM_SHA256SUM = 3ca7e297ef4daa56c3dd733e21bce795d57ab071243369aa9400c0384ada8a4c JAMVM_BASE_URL = http://icedtea.classpath.org/download/drops/jamvm JAMVM_URL = $(JAMVM_BASE_URL)/jamvm-$(JAMVM_VERSION).tar.gz JAMVM_SRC_ZIP = jamvm-$(JAMVM_VERSION).tar.gz @@ -1922,7 +1922,7 @@ if BUILD_JAMVM cd jamvm/jamvm && \ LDFLAGS="-Xlinker -z -Xlinker noexecstack" \ - ./autogen.sh --with-java-runtime-library=openjdk \ + ./autogen.sh --with-java-runtime-library=openjdk6 \ --prefix=$(abs_top_builddir)/jamvm/install ; \ $(MAKE) ; \ $(MAKE) install diff -Nru openjdk-6-6b24-1.11.5/Makefile.in openjdk-6-6b24-1.11.5/Makefile.in --- openjdk-6-6b24-1.11.5/Makefile.in 2012-10-17 11:45:21.000000000 +0100 +++ openjdk-6-6b24-1.11.5/Makefile.in 2012-10-27 22:32:14.000000000 +0100 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. +# Makefile.in generated by automake 1.11.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -382,8 +382,8 @@ CACAO_BASE_URL = http://icedtea.classpath.org/download/drops/cacao CACAO_URL = $(CACAO_BASE_URL)/$(CACAO_VERSION).tar.gz CACAO_SRC_ZIP = cacao-$(CACAO_VERSION).tar.gz -JAMVM_VERSION = 4617da717ecb05654ea5bb9572338061106a414d -JAMVM_SHA256SUM = 47fce7bd556c1b1d29a93b8c45497e0d872b48b7f535066b303336f29d0f0d8d +JAMVM_VERSION = e70f2450890b82c37422616cc85e1a23385f03cd +JAMVM_SHA256SUM = 3ca7e297ef4daa56c3dd733e21bce795d57ab071243369aa9400c0384ada8a4c JAMVM_BASE_URL = http://icedtea.classpath.org/download/drops/jamvm JAMVM_URL = $(JAMVM_BASE_URL)/jamvm-$(JAMVM_VERSION).tar.gz JAMVM_SRC_ZIP = jamvm-$(JAMVM_VERSION).tar.gz @@ -1044,7 +1044,7 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod u+w $(distdir) + chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) @@ -2356,7 +2356,7 @@ stamps/jamvm.stamp: $(OPENJDK_TREE) stamps/rt.stamp @BUILD_JAMVM_TRUE@ cd jamvm/jamvm && \ @BUILD_JAMVM_TRUE@ LDFLAGS="-Xlinker -z -Xlinker noexecstack" \ -@BUILD_JAMVM_TRUE@ ./autogen.sh --with-java-runtime-library=openjdk \ +@BUILD_JAMVM_TRUE@ ./autogen.sh --with-java-runtime-library=openjdk6 \ @BUILD_JAMVM_TRUE@ --prefix=$(abs_top_builddir)/jamvm/install ; \ @BUILD_JAMVM_TRUE@ $(MAKE) ; \ @BUILD_JAMVM_TRUE@ $(MAKE) install diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/configure.ac openjdk-6-6b24-1.11.5/=unpacked-tar2=/configure.ac --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/configure.ac 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/configure.ac 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ ## -## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 +## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 ## Robert Lougher . ## ## This file is part of JamVM. @@ -211,16 +211,25 @@ [AS_HELP_STRING(--enable-profile-stubs,JNI stubs support profiling)],,) AC_ARG_WITH(java-runtime-library, - [AS_HELP_STRING(--with-java-runtime-library=[[[gnuclasspath|openjdk]]],which Java runtime + [AS_HELP_STRING(--with-java-runtime-library=[[[gnuclasspath|openjdk6|openjdk7]]],which Java runtime library interface to use (default gnuclasspath))], - [if test "$withval" != gnuclasspath -a "$withval" != openjdk; then + [if test "$withval" != gnuclasspath -a "$withval" != openjdk6 -a "$withval" != openjdk7; then AC_MSG_ERROR($withval Java runtime library is not supported) fi], [with_java_runtime_library=gnuclasspath]) -classlib="$with_java_runtime_library" +if test "$with_java_runtime_library" != gnuclasspath; then + classlib=openjdk +else + classlib=gnuclasspath +fi + AC_SUBST(classlib) +if test "$with_java_runtime_library" != openjdk7; then + AC_DEFINE([SHARED_CHAR_BUFFERS],1,[java.lang.String uses shared char buffers]) +fi + AC_ARG_WITH(classpath-install-dir, [AS_HELP_STRING(--with-classpath-install-dir=,installation directory of GNU classpath (default /usr/local/classpath))],, diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/arch/arm.h openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/arch/arm.h --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/arch/arm.h 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/arch/arm.h 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 * Robert Lougher . * * This file is part of JamVM. @@ -52,7 +52,7 @@ /* Needed for i386 -- empty here */ #define FPU_HACK -#ifdef __ARM_ARCH_7A__ +#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) #define COMPARE_AND_SWAP_32(addr, old_val, new_val) \ ({ \ int result, read_val; \ diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/arch/powerpc.h openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/arch/powerpc.h --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/arch/powerpc.h 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/arch/powerpc.h 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 * Robert Lougher . * * This file is part of JamVM. @@ -132,4 +132,8 @@ #define MBARRIER() __asm__ __volatile__ ("sync" ::: "memory") #define JMM_LOCK_MBARRIER() __asm__ __volatile__ ("isync" ::: "memory") +#ifdef __NO_LWSYNC__ +#define JMM_UNLOCK_MBARRIER() __asm__ __volatile__ ("sync" ::: "memory") +#else #define JMM_UNLOCK_MBARRIER() __asm__ __volatile__ ("lwsync" ::: "memory") +#endif diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/classlib/openjdk/jvm.c openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/classlib/openjdk/jvm.c --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/classlib/openjdk/jvm.c 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/classlib/openjdk/jvm.c 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010, 2011 Robert Lougher . + * Copyright (C) 2010, 2011, 2012 Robert Lougher . * * This file is part of JamVM. * @@ -1650,6 +1650,13 @@ } +/* JVM_SetNativeThreadName */ + +void JVM_SetNativeThreadName(JNIEnv *env, jclass cls, jobject name) { + UNIMPLEMENTED("JVM_SetNativeThreadName"); +} + + /* JVM_SetThreadPriority */ void JVM_SetThreadPriority(JNIEnv* env, jobject jthread, jint prio) { diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/dll.c openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/dll.c --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/dll.c 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/dll.c 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 * Robert Lougher . * * This file is part of JamVM. @@ -36,6 +36,7 @@ #include "class.h" #include "thread.h" #include "classlib.h" +#include "jni-internal.h" /* Set by call to initialise -- if true, prints out results of dynamic method resolution */ @@ -497,6 +498,25 @@ mb->code, mb->args_count); } +uintptr_t *callJNIWrapperRefReturn(Class *class, MethodBlock *mb, + uintptr_t *ostack) { + uintptr_t *ret; + + TRACE("\n", CLASS_CB(class)->name, + mb->name, mb->type); + + if(!initJNILrefs()) + return NULL; + + ret = callJNIMethod(&jni_env, + (mb->access_flags & ACC_STATIC) ? class : NULL, + mb->simple_sig, mb->native_extra_arg, ostack, + mb->code, mb->args_count); + + *ostack = (uintptr_t)REF_TO_OBJ(*ostack); + return ret; +} + NativeMethod findJNIStub(char *sig, JNIStub *stubs) { int i; @@ -527,7 +547,11 @@ sysFree(simple); mb->native_extra_arg = nativeExtraArg(mb); - invoker = &callJNIWrapper; + + if(mb->simple_sig[strlen(mb->simple_sig)-1] == 'L') + invoker = &callJNIWrapperRefReturn; + else + invoker = &callJNIWrapper; } else sysFree(simple); diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/init.c openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/init.c --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/init.c 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/init.c 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011 + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2012 * Robert Lougher . * * This file is part of JamVM. @@ -170,16 +170,22 @@ #define OPT_NOARG 2 static CompatOptions compat[] = { - {"-XX", OPT_ARG}, - {"-Xverify", OPT_ARG}, - {"-esa", OPT_NOARG}, - {"-dsa", OPT_NOARG}, - {"-Xint", OPT_NOARG}, - {"-Xcomp", OPT_NOARG}, - {"-Xbatch", OPT_NOARG}, - {"-Xmixed", OPT_NOARG}, - {"-ea", OPT_NOARG | OPT_ARG}, - {"-da", OPT_NOARG | OPT_ARG}, + {"-XX", OPT_ARG}, + {"-Xverify", OPT_ARG}, + {"-esa", OPT_NOARG}, + {"-dsa", OPT_NOARG}, + {"-Xint", OPT_NOARG}, + {"-Xcomp", OPT_NOARG}, + {"-Xbatch", OPT_NOARG}, + {"-Xmixed", OPT_NOARG}, + {"-Xrs", OPT_NOARG}, + {"-Xcheck:jni", OPT_NOARG}, + {"-enablesystemassertions", OPT_NOARG}, + {"-disablesystemassertions", OPT_NOARG}, + {"-ea", OPT_NOARG | OPT_ARG}, + {"-da", OPT_NOARG | OPT_ARG}, + {"-enableassertions", OPT_NOARG | OPT_ARG}, + {"-disableassertions", OPT_NOARG | OPT_ARG}, {NULL, 0} }; diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/jam.c openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/jam.c --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/jam.c 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/jam.c 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 * Robert Lougher . * * This file is part of JamVM. @@ -98,7 +98,7 @@ void showVersionAndCopyright() { printf("java version \"%s\"\n", JAVA_COMPAT_VERSION); printf("JamVM version %s\n", VERSION); - printf("Copyright (C) 2003-2011 Robert Lougher \n\n"); + printf("Copyright (C) 2003-2012 Robert Lougher \n\n"); printf("This program is free software; you can redistribute it and/or\n"); printf("modify it under the terms of the GNU General Public License\n"); printf("as published by the Free Software Foundation; either version 2,\n"); diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/jni.c openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/jni.c --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/jni.c 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/jni.c 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 * Robert Lougher . * * This file is part of JamVM. @@ -799,7 +799,7 @@ void Jam_SetObjectArrayElement(JNIEnv *env, jobjectArray array, jsize index, jobject value) { - ARRAY_DATA(REF_TO_OBJ(array), Object*)[index] = value; + ARRAY_DATA(REF_TO_OBJ(array), Object*)[index] = REF_TO_OBJ(value); } jint Jam_RegisterNatives(JNIEnv *env, jclass clazz, @@ -942,7 +942,7 @@ Object *ob = REF_TO_OBJ(obj); FieldBlock *fb = fieldID; - INST_DATA(ob, jobject, fb->u.offset) = value; + INST_DATA(ob, jobject, fb->u.offset) = REF_TO_OBJ(value); } jobject Jam_GetStaticObjectField(JNIEnv *env, jclass clazz, jfieldID fieldID) { diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/jni-stubs.c openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/jni-stubs.c --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/jni-stubs.c 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/jni-stubs.c 2012-08-15 03:51:32.000000000 +0100 @@ -5,6 +5,7 @@ #ifndef USE_MD_STUBS #include "stubs.h" #include "properties.h" +#include "jni-internal.h" extern void *jni_env; @@ -34,6 +35,18 @@ return ostack + 2; } +/* ()L */ +static uintptr_t *static__L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*))mb->code) ( + &jni_env, + class)); + + return ostack + 1; +} + /* ()V */ static uintptr_t *static__V(Class *class, MethodBlock *mb, uintptr_t *ostack) { if(!initJNILrefs()) @@ -138,6 +151,19 @@ return ostack + 1; } +/* (I)L */ +static uintptr_t *static_I_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, uintptr_t))mb->code) ( + &jni_env, + class, + *(uintptr_t *)&ostack[0])); + + return ostack + 1; +} + /* (II)I */ static uintptr_t *static_II_I(Class *class, MethodBlock *mb, uintptr_t *ostack) { if(!initJNILrefs()) @@ -152,6 +178,20 @@ return ostack + 1; } +/* (II)L */ +static uintptr_t *static_II_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, uintptr_t, uintptr_t))mb->code) ( + &jni_env, + class, + *(uintptr_t *)&ostack[0], + *(uintptr_t *)&ostack[1])); + + return ostack + 1; +} + /* (III)I */ static uintptr_t *static_III_I(Class *class, MethodBlock *mb, uintptr_t *ostack) { if(!initJNILrefs()) @@ -167,6 +207,21 @@ return ostack + 1; } +/* (III)L */ +static uintptr_t *static_III_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, uintptr_t, uintptr_t, uintptr_t))mb->code) ( + &jni_env, + class, + *(uintptr_t *)&ostack[0], + *(uintptr_t *)&ostack[1], + *(uintptr_t *)&ostack[2])); + + return ostack + 1; +} + /* (IIII)I */ static uintptr_t *static_IIII_I(Class *class, MethodBlock *mb, uintptr_t *ostack) { if(!initJNILrefs()) @@ -183,6 +238,23 @@ return ostack + 1; } +/* (IIIII)L */ +static uintptr_t *static_IIIII_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))mb->code) ( + &jni_env, + class, + *(uintptr_t *)&ostack[0], + *(uintptr_t *)&ostack[1], + *(uintptr_t *)&ostack[2], + *(uintptr_t *)&ostack[3], + *(uintptr_t *)&ostack[4])); + + return ostack + 1; +} + /* (IIIII)V */ static uintptr_t *static_IIIII_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { if(!initJNILrefs()) @@ -283,6 +355,19 @@ return ostack + 2; } +/* (J)L */ +static uintptr_t *static_J_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0])); + + return ostack + 1; +} + /* (J)V */ static uintptr_t *static_J_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { if(!initJNILrefs()) @@ -415,6 +500,20 @@ return ostack + 2; } +/* (JJ)L */ +static uintptr_t *static_JJ_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, int64_t, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2])); + + return ostack + 1; +} + /* (JJ)V */ static uintptr_t *static_JJ_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { if(!initJNILrefs()) @@ -543,6 +642,18 @@ return ostack + 2; } +/* ()L */ +static uintptr_t *__L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*))mb->code) ( + &jni_env, + (void*)ostack[0])); + + return ostack + 1; +} + /* ()V */ static uintptr_t *__V(Class *class, MethodBlock *mb, uintptr_t *ostack) { if(!initJNILrefs()) @@ -608,6 +719,19 @@ return ostack + 2; } +/* (I)L */ +static uintptr_t *_I_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(uintptr_t *)&ostack[1])); + + return ostack + 1; +} + /* (I)V */ static uintptr_t *_I_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { if(!initJNILrefs()) @@ -635,6 +759,20 @@ return ostack + 1; } +/* (II)L */ +static uintptr_t *_II_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, uintptr_t, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(uintptr_t *)&ostack[1], + *(uintptr_t *)&ostack[2])); + + return ostack + 1; +} + /* (II)V */ static uintptr_t *_II_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { if(!initJNILrefs()) @@ -713,6 +851,24 @@ return ostack + 1; } +/* (IIIIII)L */ +static uintptr_t *_IIIIII_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(uintptr_t *)&ostack[1], + *(uintptr_t *)&ostack[2], + *(uintptr_t *)&ostack[3], + *(uintptr_t *)&ostack[4], + *(uintptr_t *)&ostack[5], + *(uintptr_t *)&ostack[6])); + + return ostack + 1; +} + /* (IIIIII)V */ static uintptr_t *_IIIIII_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { if(!initJNILrefs()) @@ -842,6 +998,21 @@ return ostack + 2; } +/* (IJJ)L */ +static uintptr_t *_IJJ_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, uintptr_t, int64_t, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(uintptr_t *)&ostack[1], + *(int64_t *)&ostack[2], + *(int64_t *)&ostack[4])); + + return ostack + 1; +} + /* (IJJI)J */ static uintptr_t *_IJJI_J(Class *class, MethodBlock *mb, uintptr_t *ostack) { if(!initJNILrefs()) @@ -871,6 +1042,19 @@ return ostack + 2; } +/* (J)L */ +static uintptr_t *_J_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1])); + + return ostack + 1; +} + /* (J)V */ static uintptr_t *_J_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { if(!initJNILrefs()) @@ -960,6 +1144,7 @@ JNIStub jni_static_stubs[] = { {"()I", static__I}, {"()J", static__J}, + {"()L", static__L}, {"()V", static__V}, {"(D)D", static_D_D}, {"(D)J", static_D_J}, @@ -968,15 +1153,20 @@ {"(I)B", static_I_B}, {"(I)F", static_I_F}, {"(I)I", static_I_I}, + {"(I)L", static_I_L}, {"(II)I", static_II_I}, + {"(II)L", static_II_L}, {"(III)I", static_III_I}, + {"(III)L", static_III_L}, {"(IIII)I", static_IIII_I}, + {"(IIIII)L", static_IIIII_L}, {"(IIIII)V", static_IIIII_V}, {"(IIIIIIIIIIIIIIIJJ)V", static_IIIIIIIIIIIIIIIJJ_V}, {"(IJI)I", static_IJI_I}, {"(J)D", static_J_D}, {"(J)I", static_J_I}, {"(J)J", static_J_J}, + {"(J)L", static_J_L}, {"(J)V", static_J_V}, {"(JI)I", static_JI_I}, {"(JI)J", static_JI_J}, @@ -986,6 +1176,7 @@ {"(JIJJ)V", static_JIJJ_V}, {"(JJ)B", static_JJ_B}, {"(JJ)J", static_JJ_J}, + {"(JJ)L", static_JJ_L}, {"(JJ)V", static_JJ_V}, {"(JJJIII)I", static_JJJIII_I}, {"(JJJJ)V", static_JJJJ_V}, @@ -998,26 +1189,32 @@ {"()B", __B}, {"()I", __I}, {"()J", __J}, + {"()L", __L}, {"()V", __V}, {"(FF)V", _FF_V}, {"(I)B", _I_B}, {"(I)I", _I_I}, {"(I)J", _I_J}, + {"(I)L", _I_L}, {"(I)V", _I_V}, {"(II)B", _II_B}, + {"(II)L", _II_L}, {"(II)V", _II_V}, {"(III)I", _III_I}, {"(III)V", _III_V}, {"(IIII)V", _IIII_V}, {"(IIIIII)I", _IIIIII_I}, + {"(IIIIII)L", _IIIIII_L}, {"(IIIIII)V", _IIIIII_V}, {"(IIIIIIII)V", _IIIIIIII_V}, {"(IIIIIIIIII)V", _IIIIIIIIII_V}, {"(IIIIIIIIIIIII)V", _IIIIIIIIIIIII_V}, {"(IIIIIIIIIIIIIIIIII)V", _IIIIIIIIIIIIIIIIII_V}, {"(IJ)J", _IJ_J}, + {"(IJJ)L", _IJJ_L}, {"(IJJI)J", _IJJI_J}, {"(J)J", _J_J}, + {"(J)L", _J_L}, {"(J)V", _J_V}, {"(JIII)I", _JIII_I}, {"(JJII)V", _JJII_V}, diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/callNativeEABIHardARM.S openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/callNativeEABIHardARM.S --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/callNativeEABIHardARM.S 1970-01-01 01:00:00.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/callNativeEABIHardARM.S 2012-08-15 03:51:32.000000000 +0100 @@ -0,0 +1,266 @@ +/* + * Copyright (C) 2011, 2012 Robert Lougher . + * + * This file is part of JamVM. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2, + * or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + .text + .align 2 + .global callJNIMethod + .type callJNIMethod,function + +/* + * Arguments passed in: + * + * r0 JNIEnv + * r1 class or NULL + * r2 sig + * r3 extra arg + * sp + 0 ostack + * sp + 4 function pntr + * sp + 8 args count + */ + +/* Register usage : + * + * lr ostack pntr + * ip scratch + * r11 function pntr + * r10 fp backfill + * r8 fp reg + * r7 int reg + * r6 args pntr + * r5 sig pntr + * r4 extra stack + * r3, r2 outgoing int args + * r1 outgoing class or this pntr + * r0 outgoing JNIEnv (as passed in) + * + * s0 - s16 (d0 - d7) outgoing float args + */ + +callJNIMethod: + stmfd sp!, {r4, r5, r6, r7, r8, r10, r11, lr} + ldr lr, [sp, #32] /* get ostack pntr */ + ldr r11, [sp, #36] /* get function pntr */ + + cmp r1, #0 /* is method non-static? */ + ldreq r1, [lr], #4 /* yes, load r1 with "this" */ + + mov r4, r3 + sub sp, sp, r4 /* allocate room for stacked */ + add r5, r2, #1 /* init sig pntr -- skipping '(' */ + + mov r6, sp /* init loop pntr */ + + mov r7, #2 + mov r8, #16 + mov r10, #0 + +scan_sig: + ldrb ip, [r5], #1 + + cmp ip, #41 /* ')' */ + beq done + + cmp ip, #70 /* 'F' */ + beq float + + cmp ip, #68 /* 'D' */ + beq double + + cmp ip, #74 /* 'J' */ + beq long + +skip_brackets: + cmp ip, #91 /* '[' */ + ldreqb ip, [r5], #1 + beq skip_brackets + + cmp ip, #76 /* 'L' */ + bne int + +skip_ref: + ldrb ip, [r5], #1 + cmp ip, #59 /* ';' */ + bne skip_ref + +int: + cmp r7, #0 + beq stack_int + + subs r7, r7, #1 + + ldrne r2, [lr], #4 + ldreq r3, [lr], #4 + + b scan_sig + +stack_int: + ldr ip, [lr], #4 + str ip, [r6], #4 + b scan_sig + +float: + cmp r10, #0 + beq no_backfill + + sub ip, r10, #1 + mov r10, #0 + b load_float + +no_backfill: + cmp r8, #0 + beq stack_int + + sub r8, r8, #1 + mov ip, r8 + +load_float: + add lr, lr, #4 + add pc, pc, ip, lsl #3 + nop + + flds s15, [lr, #-4] + b scan_sig + flds s14, [lr, #-4] + b scan_sig + flds s13, [lr, #-4] + b scan_sig + flds s12, [lr, #-4] + b scan_sig + flds s11, [lr, #-4] + b scan_sig + flds s10, [lr, #-4] + b scan_sig + flds s9, [lr, #-4] + b scan_sig + flds s8, [lr, #-4] + b scan_sig + flds s7, [lr, #-4] + b scan_sig + flds s6, [lr, #-4] + b scan_sig + flds s5, [lr, #-4] + b scan_sig + flds s4, [lr, #-4] + b scan_sig + flds s3, [lr, #-4] + b scan_sig + flds s2, [lr, #-4] + b scan_sig + flds s1, [lr, #-4] + b scan_sig + flds s0, [lr, #-4] + b scan_sig + +long: + cmp r7, #2 + mov r7, #0 + bne stack_long + + ldr r2, [lr], #4 + ldr r3, [lr], #4 + b scan_sig + +double: + lsrs ip, r8, #1 + movcs r10, r8 + + lsls r8, ip, #1 + beq stack_double + + sub r8, r8, #2 + add lr, lr, #8 + add pc, pc, ip, lsl #3 + nop + nop + nop + + fldd d7, [lr, #-8] + b scan_sig + fldd d6, [lr, #-8] + b scan_sig + fldd d5, [lr, #-8] + b scan_sig + fldd d4, [lr, #-8] + b scan_sig + fldd d3, [lr, #-8] + b scan_sig + fldd d2, [lr, #-8] + b scan_sig + fldd d1, [lr, #-8] + b scan_sig + fldd d0, [lr, #-8] + b scan_sig + +stack_double: + mov r10, #0 + +stack_long: + /* Ensure address is 8 byte aligned */ + add r6, r6, #7 + bic r6, r6, #7 + + ldr ip, [lr], #4 + str ip, [r6], #4 + ldr ip, [lr], #4 + str ip, [r6], #4 + b scan_sig + +done: + /* Call the function */ +#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) + mov lr, pc + bx r11 +#else + blx r11 +#endif + + add sp, sp, r4 /* Pop argument area */ + ldr r4, [sp, #32] /* Reload ostack for */ + /* address of return value */ + ldrb ip, [r5] /* Return type */ + + cmp ip, #86 /* 'V' */ + beq return + + cmp ip, #68 /* 'D' */ + beq return_double + + cmp ip, #70 /* 'F' */ + beq return_float + + str r0, [r4], #4 /* Low word */ + + cmp ip, #74 /* 'J' */ + streq r1, [r4], #4 /* High word */ + +return: + mov r0, r4 /* return ostack */ + ldmfd sp!, {r4, r5, r6, r7, r8, r10, r11, lr} + bx lr + +return_float: + add r4, r4, #4 + fsts s0, [r4, #-4] + b return + +return_double: + add r4, r4, #8 + fstd d0, [r4, #-8] + b return diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/callNativeEABIHard.S openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/callNativeEABIHard.S --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/callNativeEABIHard.S 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/callNativeEABIHard.S 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Robert Lougher . + * Copyright (C) 2011, 2012 Robert Lougher . * * This file is part of JamVM. * @@ -67,7 +67,7 @@ mov r10, r3 subs sp, sp, r3 /* allocate room for stacked */ - add r8, r2, #1 /* init sig pntr -- skr5ping '(' */ + add r8, r2, #1 /* init sig pntr -- skipping '(' */ mov ip, sp /* init loop pntr */ diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/callNative.S openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/callNative.S --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/callNative.S 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/callNative.S 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2011 + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2011, 2012 * Robert Lougher . * * This file is part of JamVM. @@ -24,8 +24,12 @@ #ifndef USE_FFI #ifdef __ARM_EABI__ #ifdef __ARM_PCS_VFP +#ifdef __ARM_ARCH_7A__ #include "callNativeEABIHard.S" #else +#include "callNativeEABIHardARM.S" +#endif +#else #include "callNativeEABI.S" #endif #else diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/Makefile.am openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/Makefile.am --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/Makefile.am 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/arm/Makefile.am 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ ## -## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010, 2011 +## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010, 2011, 2012 ## Robert Lougher . ## ## This file is part of JamVM. @@ -19,7 +19,8 @@ ## Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ## -EXTRA_DIST = callNativeOABI.S callNativeEABI.S callNativeEABIHard.S +EXTRA_DIST = callNativeOABI.S callNativeEABI.S callNativeEABIHard.S \ + callNativeEABIHardARM.S noinst_LTLIBRARIES = libnative.la libnative_la_SOURCES = init.c dll_md.c callNative.S diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/i386/jni-stubs.c openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/i386/jni-stubs.c --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/i386/jni-stubs.c 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/i386/jni-stubs.c 2012-08-15 03:51:32.000000000 +0100 @@ -1,22 +1,927 @@ -/* Generated by gen-stubs.c from signature file empty_stubs */ +/* Generated by gen-stubs.c from signature file sigs (profiling off) */ #include "jam.h" #ifdef USE_MD_STUBS #include "stubs.h" +#include "properties.h" +#include "jni-internal.h" extern void *jni_env; /* Static signatures */ +/* ()I */ +static uintptr_t *static__I(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(uintptr_t (*)(void*, void*))mb->code) ( + &jni_env, + class); + + return ostack + 1; +} + +/* ()J */ +static uintptr_t *static__J(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *(int64_t*)ostack = (*(int64_t (*)(void*, void*))mb->code) ( + &jni_env, + class); + + return ostack + 2; +} + +/* ()L */ +static uintptr_t *static__L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*))mb->code) ( + &jni_env, + class)); + + return ostack + 1; +} + +/* ()V */ +static uintptr_t *static__V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*))mb->code) ( + &jni_env, + class); + + return ostack + 0; +} + +/* (I)B */ +static uintptr_t *static_I_B(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(int8_t (*)(void*, void*, uintptr_t))mb->code) ( + &jni_env, + class, + *(uintptr_t *)&ostack[0]); + + return ostack + 1; +} + +/* (I)F */ +static uintptr_t *static_I_F(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *((float*)ostack + IS_BE64) = (*(float (*)(void*, void*, uintptr_t))mb->code) ( + &jni_env, + class, + *(uintptr_t *)&ostack[0]); + + return ostack + 1; +} + +/* (I)I */ +static uintptr_t *static_I_I(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(uintptr_t (*)(void*, void*, uintptr_t))mb->code) ( + &jni_env, + class, + *(uintptr_t *)&ostack[0]); + + return ostack + 1; +} + +/* (I)L */ +static uintptr_t *static_I_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, uintptr_t))mb->code) ( + &jni_env, + class, + *(uintptr_t *)&ostack[0])); + + return ostack + 1; +} + +/* (J)D */ +static uintptr_t *static_J_D(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *(double*)ostack = (*(double (*)(void*, void*, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0]); + + return ostack + 2; +} + +/* (J)I */ +static uintptr_t *static_J_I(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(uintptr_t (*)(void*, void*, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0]); + + return ostack + 1; +} + +/* (J)J */ +static uintptr_t *static_J_J(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *(int64_t*)ostack = (*(int64_t (*)(void*, void*, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0]); + + return ostack + 2; +} + +/* (J)L */ +static uintptr_t *static_J_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0])); + + return ostack + 1; +} + +/* (J)V */ +static uintptr_t *static_J_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0]); + + return ostack + 0; +} + +/* (JI)I */ +static uintptr_t *static_JI_I(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(uintptr_t (*)(void*, void*, int64_t, uintptr_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(uintptr_t *)&ostack[2]); + + return ostack + 1; +} + +/* (JI)J */ +static uintptr_t *static_JI_J(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *(int64_t*)ostack = (*(int64_t (*)(void*, void*, int64_t, uintptr_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(uintptr_t *)&ostack[2]); + + return ostack + 2; +} + +/* (JI)L */ +static uintptr_t *static_JI_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, int64_t, uintptr_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(uintptr_t *)&ostack[2])); + + return ostack + 1; +} + +/* (JI)V */ +static uintptr_t *static_JI_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, uintptr_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(uintptr_t *)&ostack[2]); + + return ostack + 0; +} + +/* (JJ)B */ +static uintptr_t *static_JJ_B(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(int8_t (*)(void*, void*, int64_t, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2]); + + return ostack + 1; +} + +/* (JJ)D */ +static uintptr_t *static_JJ_D(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *(double*)ostack = (*(double (*)(void*, void*, int64_t, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2]); + + return ostack + 2; +} + +/* (JJ)I */ +static uintptr_t *static_JJ_I(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(uintptr_t (*)(void*, void*, int64_t, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2]); + + return ostack + 1; +} + +/* (JJ)J */ +static uintptr_t *static_JJ_J(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *(int64_t*)ostack = (*(int64_t (*)(void*, void*, int64_t, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2]); + + return ostack + 2; +} + +/* (JJ)L */ +static uintptr_t *static_JJ_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, int64_t, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2])); + + return ostack + 1; +} + +/* (JJ)V */ +static uintptr_t *static_JJ_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2]); + + return ostack + 0; +} + +/* (JJI)L */ +static uintptr_t *static_JJI_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, int64_t, int64_t, uintptr_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2], + *(uintptr_t *)&ostack[4])); + + return ostack + 1; +} + +/* (JJI)V */ +static uintptr_t *static_JJI_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, int64_t, uintptr_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2], + *(uintptr_t *)&ostack[4]); + + return ostack + 0; +} + +/* (JJJI)V */ +static uintptr_t *static_JJJI_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, int64_t, int64_t, uintptr_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2], + *(int64_t *)&ostack[4], + *(uintptr_t *)&ostack[6]); + + return ostack + 0; +} + +/* (JJJJ)V */ +static uintptr_t *static_JJJJ_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, int64_t, int64_t, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2], + *(int64_t *)&ostack[4], + *(int64_t *)&ostack[6]); + + return ostack + 0; +} + +/* (JJJJI)I */ +static uintptr_t *static_JJJJI_I(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(uintptr_t (*)(void*, void*, int64_t, int64_t, int64_t, int64_t, uintptr_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2], + *(int64_t *)&ostack[4], + *(int64_t *)&ostack[6], + *(uintptr_t *)&ostack[8]); + + return ostack + 1; +} + +/* (JJJJJJ)V */ +static uintptr_t *static_JJJJJJ_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2], + *(int64_t *)&ostack[4], + *(int64_t *)&ostack[6], + *(int64_t *)&ostack[8], + *(int64_t *)&ostack[10]); + + return ostack + 0; +} + +/* (JJJJJJJJJI)V */ +static uintptr_t *static_JJJJJJJJJI_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, uintptr_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2], + *(int64_t *)&ostack[4], + *(int64_t *)&ostack[6], + *(int64_t *)&ostack[8], + *(int64_t *)&ostack[10], + *(int64_t *)&ostack[12], + *(int64_t *)&ostack[14], + *(int64_t *)&ostack[16], + *(uintptr_t *)&ostack[18]); + + return ostack + 0; +} + +/* (JJJJJJJJJJJJ)I */ +static uintptr_t *static_JJJJJJJJJJJJ_I(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(uintptr_t (*)(void*, void*, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t))mb->code) ( + &jni_env, + class, + *(int64_t *)&ostack[0], + *(int64_t *)&ostack[2], + *(int64_t *)&ostack[4], + *(int64_t *)&ostack[6], + *(int64_t *)&ostack[8], + *(int64_t *)&ostack[10], + *(int64_t *)&ostack[12], + *(int64_t *)&ostack[14], + *(int64_t *)&ostack[16], + *(int64_t *)&ostack[18], + *(int64_t *)&ostack[20], + *(int64_t *)&ostack[22]); + + return ostack + 1; +} + /* Non-static signatures */ +/* ()B */ +static uintptr_t *__B(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(int8_t (*)(void*, void*))mb->code) ( + &jni_env, + (void*)ostack[0]); + + return ostack + 1; +} + +/* ()I */ +static uintptr_t *__I(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(uintptr_t (*)(void*, void*))mb->code) ( + &jni_env, + (void*)ostack[0]); + + return ostack + 1; +} + +/* ()J */ +static uintptr_t *__J(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *(int64_t*)ostack = (*(int64_t (*)(void*, void*))mb->code) ( + &jni_env, + (void*)ostack[0]); + + return ostack + 2; +} + +/* ()L */ +static uintptr_t *__L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*))mb->code) ( + &jni_env, + (void*)ostack[0])); + + return ostack + 1; +} + +/* ()V */ +static uintptr_t *__V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*))mb->code) ( + &jni_env, + (void*)ostack[0]); + + return ostack + 0; +} + +/* (I)B */ +static uintptr_t *_I_B(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(int8_t (*)(void*, void*, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(uintptr_t *)&ostack[1]); + + return ostack + 1; +} + +/* (I)I */ +static uintptr_t *_I_I(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(uintptr_t (*)(void*, void*, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(uintptr_t *)&ostack[1]); + + return ostack + 1; +} + +/* (I)J */ +static uintptr_t *_I_J(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *(int64_t*)ostack = (*(int64_t (*)(void*, void*, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(uintptr_t *)&ostack[1]); + + return ostack + 2; +} + +/* (I)L */ +static uintptr_t *_I_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(uintptr_t *)&ostack[1])); + + return ostack + 1; +} + +/* (I)V */ +static uintptr_t *_I_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(uintptr_t *)&ostack[1]); + + return ostack + 0; +} + +/* (J)B */ +static uintptr_t *_J_B(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(int8_t (*)(void*, void*, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1]); + + return ostack + 1; +} + +/* (J)J */ +static uintptr_t *_J_J(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *(int64_t*)ostack = (*(int64_t (*)(void*, void*, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1]); + + return ostack + 2; +} + +/* (J)L */ +static uintptr_t *_J_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1])); + + return ostack + 1; +} + +/* (J)V */ +static uintptr_t *_J_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1]); + + return ostack + 0; +} + +/* (JI)I */ +static uintptr_t *_JI_I(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(uintptr_t (*)(void*, void*, int64_t, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(uintptr_t *)&ostack[3]); + + return ostack + 1; +} + +/* (JI)J */ +static uintptr_t *_JI_J(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *(int64_t*)ostack = (*(int64_t (*)(void*, void*, int64_t, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(uintptr_t *)&ostack[3]); + + return ostack + 2; +} + +/* (JI)V */ +static uintptr_t *_JI_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(uintptr_t *)&ostack[3]); + + return ostack + 0; +} + +/* (JJ)V */ +static uintptr_t *_JJ_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(int64_t *)&ostack[3]); + + return ostack + 0; +} + +/* (JJI)I */ +static uintptr_t *_JJI_I(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(uintptr_t (*)(void*, void*, int64_t, int64_t, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(int64_t *)&ostack[3], + *(uintptr_t *)&ostack[5]); + + return ostack + 1; +} + +/* (JJI)L */ +static uintptr_t *_JJI_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, int64_t, int64_t, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(int64_t *)&ostack[3], + *(uintptr_t *)&ostack[5])); + + return ostack + 1; +} + +/* (JJJ)I */ +static uintptr_t *_JJJ_I(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (*(uintptr_t (*)(void*, void*, int64_t, int64_t, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(int64_t *)&ostack[3], + *(int64_t *)&ostack[5]); + + return ostack + 1; +} + +/* (JJJ)J */ +static uintptr_t *_JJJ_J(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *(int64_t*)ostack = (*(int64_t (*)(void*, void*, int64_t, int64_t, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(int64_t *)&ostack[3], + *(int64_t *)&ostack[5]); + + return ostack + 2; +} + +/* (JJJ)L */ +static uintptr_t *_JJJ_L(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + *ostack = (uintptr_t)REF_TO_OBJ((*(uintptr_t (*)(void*, void*, int64_t, int64_t, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(int64_t *)&ostack[3], + *(int64_t *)&ostack[5])); + + return ostack + 1; +} + +/* (JJJ)V */ +static uintptr_t *_JJJ_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, int64_t, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(int64_t *)&ostack[3], + *(int64_t *)&ostack[5]); + + return ostack + 0; +} + +/* (JJJJ)V */ +static uintptr_t *_JJJJ_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, int64_t, int64_t, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(int64_t *)&ostack[3], + *(int64_t *)&ostack[5], + *(int64_t *)&ostack[7]); + + return ostack + 0; +} + +/* (JJJJJ)V */ +static uintptr_t *_JJJJJ_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, int64_t, int64_t, int64_t, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(int64_t *)&ostack[3], + *(int64_t *)&ostack[5], + *(int64_t *)&ostack[7], + *(int64_t *)&ostack[9]); + + return ostack + 0; +} + +/* (JJJJJJI)V */ +static uintptr_t *_JJJJJJI_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, uintptr_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(int64_t *)&ostack[3], + *(int64_t *)&ostack[5], + *(int64_t *)&ostack[7], + *(int64_t *)&ostack[9], + *(int64_t *)&ostack[11], + *(uintptr_t *)&ostack[13]); + + return ostack + 0; +} + +/* (JJJJJJJJJ)V */ +static uintptr_t *_JJJJJJJJJ_V(Class *class, MethodBlock *mb, uintptr_t *ostack) { + if(!initJNILrefs()) + return NULL; + + (*(void (*)(void*, void*, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t))mb->code) ( + &jni_env, + (void*)ostack[0], + *(int64_t *)&ostack[1], + *(int64_t *)&ostack[3], + *(int64_t *)&ostack[5], + *(int64_t *)&ostack[7], + *(int64_t *)&ostack[9], + *(int64_t *)&ostack[11], + *(int64_t *)&ostack[13], + *(int64_t *)&ostack[15], + *(int64_t *)&ostack[17]); + + return ostack + 0; +} + JNIStub jni_static_stubs[] = { + {"()I", static__I}, + {"()J", static__J}, + {"()L", static__L}, + {"()V", static__V}, + {"(I)B", static_I_B}, + {"(I)F", static_I_F}, + {"(I)I", static_I_I}, + {"(I)L", static_I_L}, + {"(J)D", static_J_D}, + {"(J)I", static_J_I}, + {"(J)J", static_J_J}, + {"(J)L", static_J_L}, + {"(J)V", static_J_V}, + {"(JI)I", static_JI_I}, + {"(JI)J", static_JI_J}, + {"(JI)L", static_JI_L}, + {"(JI)V", static_JI_V}, + {"(JJ)B", static_JJ_B}, + {"(JJ)D", static_JJ_D}, + {"(JJ)I", static_JJ_I}, + {"(JJ)J", static_JJ_J}, + {"(JJ)L", static_JJ_L}, + {"(JJ)V", static_JJ_V}, + {"(JJI)L", static_JJI_L}, + {"(JJI)V", static_JJI_V}, + {"(JJJI)V", static_JJJI_V}, + {"(JJJJ)V", static_JJJJ_V}, + {"(JJJJI)I", static_JJJJI_I}, + {"(JJJJJJ)V", static_JJJJJJ_V}, + {"(JJJJJJJJJI)V", static_JJJJJJJJJI_V}, + {"(JJJJJJJJJJJJ)I", static_JJJJJJJJJJJJ_I}, {NULL, NULL} }; JNIStub jni_stubs[] = { + {"()B", __B}, + {"()I", __I}, + {"()J", __J}, + {"()L", __L}, + {"()V", __V}, + {"(I)B", _I_B}, + {"(I)I", _I_I}, + {"(I)J", _I_J}, + {"(I)L", _I_L}, + {"(I)V", _I_V}, + {"(J)B", _J_B}, + {"(J)J", _J_J}, + {"(J)L", _J_L}, + {"(J)V", _J_V}, + {"(JI)I", _JI_I}, + {"(JI)J", _JI_J}, + {"(JI)V", _JI_V}, + {"(JJ)V", _JJ_V}, + {"(JJI)I", _JJI_I}, + {"(JJI)L", _JJI_L}, + {"(JJJ)I", _JJJ_I}, + {"(JJJ)J", _JJJ_J}, + {"(JJJ)L", _JJJ_L}, + {"(JJJ)V", _JJJ_V}, + {"(JJJJ)V", _JJJJ_V}, + {"(JJJJJ)V", _JJJJJ_V}, + {"(JJJJJJI)V", _JJJJJJI_V}, + {"(JJJJJJJJJ)V", _JJJJJJJJJ_V}, {NULL, NULL} }; #endif diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/i386/stubs_md.c openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/i386/stubs_md.c --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/i386/stubs_md.c 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/os/linux/i386/stubs_md.c 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Robert Lougher . + * Copyright (C) 2010, 2012 Robert Lougher . * * This file is part of JamVM. * @@ -22,52 +22,42 @@ #include "jam.h" #endif -#ifdef USE_MD_STUBS +#if defined(GEN_STUBS_INC) || defined(USE_MD_STUBS) #include +#include "sig.h" char *convertSig2Simple(char *sig) { - char *simple_sig = sysMalloc(strlen(sig) * 2); - char *simple_pntr = simple_sig; - char *sig_pntr = sig; + char *simple_sig, *simple_pntr; + int count = 0; + int i; - *simple_pntr++ = '('; - while(*++sig_pntr != ')') { - *simple_pntr++ = 'I'; + SCAN_SIG(sig, count+=2, count++); + simple_sig = simple_pntr = sysMalloc((count + 1)/2 + 4); - if(*sig_pntr == 'J' || *sig_pntr == 'D') - *simple_pntr++ = 'I'; - else { - if(*sig_pntr == '[') - while(*++sig_pntr == '['); - if(*sig_pntr == 'L') - while(*++sig_pntr != ';'); - } - } + *simple_pntr++ = '('; + for(i = 0; i < count/2; i++) + *simple_pntr++ = 'J'; + if(count&0x1) + *simple_pntr++ = 'I'; *simple_pntr++ = ')'; - switch(*++sig_pntr) { - case 'B': + switch(*sig) { case 'Z': *simple_pntr++ = 'B'; break; - case 'C': - case 'S': - case 'J': - case 'D': - case 'F': - case 'V': - *simple_pntr++ = *sig_pntr; + case '[': + *simple_pntr++ = 'L'; break; default: - *simple_pntr++ = 'I'; + *simple_pntr++ = *sig; break; } - *simple_pntr++ = '\0'; - return sysRealloc(simple_sig, simple_pntr - simple_sig); + *simple_pntr = '\0'; + return simple_sig; } #endif diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/string.c openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/string.c --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/string.c 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/string.c 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011 + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 * Robert Lougher . * * This file is part of JamVM. @@ -34,16 +34,24 @@ #define SCAVENGE(ptr) FALSE #define FOUND(ptr1, ptr2) ptr2 +static HashTable hash_table; + static Class *string_class; -static int count_offset; static int value_offset; -static int offset_offset; -static HashTable hash_table; +#ifdef SHARED_CHAR_BUFFERS +static int count_offset; +static int offset_offset; +#define STRING_LEN(string) INST_DATA(string, int, count_offset) +#define STRING_OFFSET(string) INST_DATA(string, int, offset_offset) +#else +#define STRING_LEN(string) ARRAY_LEN(INST_DATA(string, Object*, value_offset)) +#define STRING_OFFSET(string) 0 +#endif int stringHash(Object *ptr) { - int len = INST_DATA(ptr, int, count_offset); - int offset = INST_DATA(ptr, int, offset_offset); + int len = STRING_LEN(ptr); + int offset = STRING_OFFSET(ptr); Object *array = INST_DATA(ptr, Object*, value_offset); unsigned short *dpntr = ARRAY_DATA(array, unsigned short) + offset; int hash = 0; @@ -55,14 +63,14 @@ } int stringComp(Object *ptr, Object *ptr2) { - int len = INST_DATA(ptr, int, count_offset); - int len2 = INST_DATA(ptr2, int, count_offset); + int len = STRING_LEN(ptr); + int len2 = STRING_LEN(ptr2); if(len == len2) { + int offset = STRING_OFFSET(ptr); + int offset2 = STRING_OFFSET(ptr2); Object *array = INST_DATA(ptr, Object*, value_offset); Object *array2 = INST_DATA(ptr2, Object*, value_offset); - int offset = INST_DATA(ptr, int, offset_offset); - int offset2 = INST_DATA(ptr2, int, offset_offset); unsigned short *src = ARRAY_DATA(array, unsigned short) + offset; unsigned short *dst = ARRAY_DATA(array2, unsigned short) + offset2; @@ -88,7 +96,9 @@ data = ARRAY_DATA(array, unsigned short); convertUtf8(utf8, data); +#ifdef SHARED_CHAR_BUFFERS INST_DATA(ob, int, count_offset) = len; +#endif INST_DATA(ob, Object*, value_offset) = array; return ob; @@ -141,7 +151,7 @@ } char *String2Buff0(Object *string, char *buff, int len) { - int offset = INST_DATA(string, int, offset_offset); + int offset = STRING_OFFSET(string); Object *array = INST_DATA(string, Object*, value_offset); unsigned short *str = ARRAY_DATA(array, unsigned short) + offset; char *pntr; @@ -154,45 +164,55 @@ } char *String2Buff(Object *string, char *buff, int buff_len) { - int str_len = INST_DATA(string, int, count_offset); + int str_len = STRING_LEN(string); int len = buff_len-1 < str_len ? buff_len-1 : str_len; return String2Buff0(string, buff, len); } char *String2Cstr(Object *string) { - int len = INST_DATA(string, int, count_offset); + int len = STRING_LEN(string); char *buff = sysMalloc(len + 1); return String2Buff0(string, buff, len); } int initialiseString() { - FieldBlock *count = NULL, *value = NULL, *offset = NULL; + FieldBlock *value; string_class = findSystemClass0(SYMBOL(java_lang_String)); + if(string_class == NULL) + goto error; + + value = findField(string_class, SYMBOL(value), SYMBOL(array_C)); + if(value == NULL) + goto error; + registerStaticClassRef(&string_class); + value_offset = value->u.offset; - if(string_class != NULL) { - count = findField(string_class, SYMBOL(count), SYMBOL(I)); - value = findField(string_class, SYMBOL(value), SYMBOL(array_C)); - offset = findField(string_class, SYMBOL(offset), SYMBOL(I)); - } +#ifdef SHARED_CHAR_BUFFERS + { + FieldBlock *count = findField(string_class, SYMBOL(count), SYMBOL(I)); + FieldBlock *offset = findField(string_class, SYMBOL(offset), + SYMBOL(I)); - /* findField doesn't throw an exception... */ - if((count == NULL) || (value == NULL) || (offset == NULL)) { - jam_fprintf(stderr, "Error initialising VM (initialiseString)\n"); - return FALSE; - } + if(count == NULL || offset == NULL) + goto error; - count_offset = count->u.offset; - value_offset = value->u.offset; - offset_offset = offset->u.offset; + count_offset = count->u.offset; + offset_offset = offset->u.offset; + } +#endif /* Init hash table and create lock */ initHashTable(hash_table, HASHTABSZE, TRUE); return TRUE; + +error: + jam_fprintf(stderr, "Error initialising VM (initialiseString)\n"); + return FALSE; } #ifndef NO_JNI @@ -206,8 +226,11 @@ unsigned short *data = ARRAY_DATA(array, unsigned short); memcpy(data, unicode, len * sizeof(unsigned short)); +#ifdef SHARED_CHAR_BUFFERS INST_DATA(ob, int, count_offset) = len; +#endif INST_DATA(ob, Object*, value_offset) = array; + return ob; } return NULL; @@ -218,13 +241,13 @@ } unsigned short *getStringChars(Object *string) { + int offset = STRING_OFFSET(string); Object *array = INST_DATA(string, Object*, value_offset); - int offset = INST_DATA(string, int, offset_offset); return ARRAY_DATA(array, unsigned short) + offset; } int getStringLen(Object *string) { - return INST_DATA(string, int, count_offset); + return STRING_LEN(string); } int getStringUtf8Len(Object *string) { diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/stubs.c openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/stubs.c --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/stubs.c 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/stubs.c 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Robert Lougher . + * Copyright (C) 2011, 2012 Robert Lougher . * * This file is part of JamVM. * @@ -43,8 +43,7 @@ return 'B'; case '[': - case 'L': - return 'I'; + return 'L'; default: return element; diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/thread.c openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/thread.c --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/thread.c 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/thread.c 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 * Robert Lougher . * * This file is part of JamVM. @@ -24,6 +24,7 @@ #include #include #include +#include #include "jam.h" #include "thread.h" @@ -566,7 +567,7 @@ signalThreadRunning(thread); /* We're now attached to the VM...*/ - TRACE("Thread 0x%x id: %d attached\n", thread, thread->id); + TRACE("Thread %p id: %d attached\n", thread, thread->id); return thread; } @@ -687,7 +688,7 @@ /* Finally, clear the thread local data */ setThreadSelf(NULL); - TRACE("Thread 0x%x id: %d detached from VM\n", thread, thread->id); + TRACE("Thread %p id: %d detached from VM\n", thread, thread->id); } void *threadStart(void *arg) { @@ -714,7 +715,7 @@ /* Run has completed. Detach the thread from the VM and exit */ detachThread(thread); - TRACE("Thread 0x%x id: %d exited\n", thread, thread->id); + TRACE("Thread %p id: %d exited\n", thread, thread->id); return NULL; } @@ -867,14 +868,14 @@ MBARRIER(); if(thread->suspend_state == SUSP_NONE) { - TRACE("Sending suspend signal to thread 0x%x id: %d\n", + TRACE("Sending suspend signal to thread %p id: %d\n", thread, thread->id); pthread_kill(thread->tid, SIGUSR1); } while(thread->suspend_state != SUSP_BLOCKING && thread->suspend_state != SUSP_SUSPENDED) { - TRACE("Waiting for thread 0x%x id: %d to suspend\n", + TRACE("Waiting for thread %p id: %d to suspend\n", thread, thread->id); sched_yield(); } @@ -885,13 +886,13 @@ MBARRIER(); if(thread->suspend_state == SUSP_SUSPENDED) { - TRACE("Sending resume signal to thread 0x%x id: %d\n", + TRACE("Sending resume signal to thread %p id: %d\n", thread, thread->id); pthread_kill(thread->tid, SIGUSR1); } while(thread->suspend_state == SUSP_SUSPENDED) { - TRACE("Waiting for thread 0x%x id: %d to resume\n", thread, + TRACE("Waiting for thread %p id: %d to resume\n", thread, thread->id); sched_yield(); } @@ -900,7 +901,7 @@ void suspendAllThreads(Thread *self) { Thread *thread; - TRACE("Thread 0x%x id: %d is suspending all threads\n", self, self->id); + TRACE("Thread %p id: %d is suspending all threads\n", self, self->id); pthread_mutex_lock(&lock); for(thread = &main_thread; thread != NULL; thread = thread->next) { @@ -911,9 +912,22 @@ MBARRIER(); if(thread->suspend_state == SUSP_NONE) { - TRACE("Sending suspend signal to thread 0x%x id: %d\n", + TRACE("Sending suspend signal to thread %p id: %d\n", thread, thread->id); - pthread_kill(thread->tid, SIGUSR1); + if(pthread_kill(thread->tid, SIGUSR1) == ESRCH) { + /* ESRCH indicates that the thread has died. This can only + occur when an external thread has been attached to the VM + via JNI and it has exited without detaching. Although it + is a user error, it will deadlock the suspension code as it + will hang waiting for the thread to suspend. Set the state + to BLOCKING, to ignore the thread. Note, no attempt is made + to clean-up the error; the thread will still appear to be + "live" (as with Hotspot). We simply stop the thread from + hanging the VM. */ + TRACE("Setting thread %p id: %d state to BLOCKING " + "as it has died\n", thread, thread->id); + thread->suspend_state = SUSP_BLOCKING; + } } } @@ -923,7 +937,7 @@ while(thread->suspend_state != SUSP_BLOCKING && thread->suspend_state != SUSP_SUSPENDED) { - TRACE("Waiting for thread 0x%x id: %d to suspend\n", + TRACE("Waiting for thread %p id: %d to suspend\n", thread, thread->id); sched_yield(); } @@ -938,7 +952,7 @@ void resumeAllThreads(Thread *self) { Thread *thread; - TRACE("Thread 0x%x id: %d is resuming all threads\n", self, self->id); + TRACE("Thread %p id: %d is resuming all threads\n", self, self->id); pthread_mutex_lock(&lock); for(thread = &main_thread; thread != NULL; thread = thread->next) { @@ -949,7 +963,7 @@ MBARRIER(); if(thread->suspend_state == SUSP_SUSPENDED) { - TRACE("Sending resume signal to thread 0x%x id: %d\n", + TRACE("Sending resume signal to thread %p id: %d\n", thread, thread->id); pthread_kill(thread->tid, SIGUSR1); } @@ -957,7 +971,7 @@ for(thread = &main_thread; thread != NULL; thread = thread->next) { while(thread->suspend_state == SUSP_SUSPENDED) { - TRACE("Waiting for thread 0x%x id: %d to resume\n", + TRACE("Waiting for thread %p id: %d to resume\n", thread, thread->id); sched_yield(); } @@ -1022,9 +1036,9 @@ MBARRIER(); if(thread->suspend) { - TRACE("Thread 0x%x id: %d is self suspending\n", thread, thread->id); + TRACE("Thread %p id: %d is self suspending\n", thread, thread->id); suspendLoop(thread); - TRACE("Thread 0x%x id: %d resumed\n", thread, thread->id); + TRACE("Thread %p id: %d resumed\n", thread, thread->id); } sigemptyset(&mask); @@ -1050,12 +1064,12 @@ sigaddset(&mask, SIGUSR1); pthread_sigmask(SIG_BLOCK, &mask, NULL); - TRACE("Thread 0x%x id: %d is fast self suspending\n", + TRACE("Thread %p id: %d is fast self suspending\n", thread, thread->id); suspendLoop(thread); - TRACE("Thread 0x%x id: %d resumed\n", thread, thread->id); + TRACE("Thread %p id: %d resumed\n", thread, thread->id); pthread_sigmask(SIG_UNBLOCK, &mask, NULL); } diff -Nru openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/tools/gen-stubs.c openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/tools/gen-stubs.c --- openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/tools/gen-stubs.c 2011-10-07 09:19:05.000000000 +0100 +++ openjdk-6-6b24-1.11.5/=unpacked-tar2=/src/tools/gen-stubs.c 2012-08-15 03:51:32.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010, 2011 Robert Lougher . + * Copyright (C) 2010, 2011, 2012 Robert Lougher . * * This file is part of JamVM. * @@ -304,6 +304,10 @@ fprintf(fd, " return NULL;\n\n"); fprintf(fd, " %s", sigElement2StackCast(ret)); + + if(ret == 'L') + fprintf(fd, "(uintptr_t)REF_TO_OBJ("); + fprintf(fd, "(*(%s (*)(void*, void*", sigElement2Type(ret)); for(pntr = sig + 1; *pntr != ')'; pntr++) @@ -326,6 +330,9 @@ sp += sigElement2Size(*pntr); } + if(ret == 'L') + fprintf(fd, ")"); + fprintf(fd, ");\n\n"); fprintf(fd, " return ostack + %d;\n", sigElement2Size(*++pntr)); @@ -364,6 +371,7 @@ fprintf(fd, "#include \"jam.h\"\n"); fprintf(fd, "#include \"stubs.h\"\n"); fprintf(fd, "#include \"properties.h\"\n"); + fprintf(fd, "#include \"jni-internal.h\"\n"); fprintf(fd, "\nextern void *jni_env;\n\n"); fprintf(fd, "/* Static signatures */\n\n");