re PR java/29812 (env->klass value is not updated during the native calls)
PR java/29812: * testsuite/libjava.jni/pr29812.java: New file. * testsuite/libjava.jni/pr29812_injar.java: New file. * testsuite/libjava.jni/pr29812_injar.jar: New file. * testsuite/libjava.jni/pr29812.out: New file. * testsuite/libjava.jni/pr29812_injar.c: New file. * testsuite/libjava.jni/pr29812_injar.h: New file. * testsuite/libjava.jni/pr29812.jar: New file. * testsuite/libjava.jni/pr29812.c: New file. * testsuite/libjava.jni/pr29812.h: New file. * testsuite/libjava.jni/jni.exp (gcj_jni_get_cxxflags_invocation): New proc. (gcj_jni_invocation_test_one): Use it. (gcj_jni_pr29812): New proc. (gcj_jni_run): Use it. * java/lang/natRuntime.cc (_load): Push a new system frame before calling JNI_OnLoad. * include/jvm.h (_Jv_JNI_PopSystemFrame): Declare. (_Jv_GetJNIEnvNewFrameWithLoader): Likewise. * jni.cc (struct _Jv_JNI_LocalFrame) <marker>: Now unsigned char. <allocated_p>: Now bool. <loader>: New field. (_Jv_JNI_EnsureLocalCapacity): Updated. (_Jv_JNI_NewLocalRef): Likewise. (_Jv_JNI_NewLocalRef): Likewise. (_Jv_JNI_PopLocalFrame): Likewise. (_Jv_JNI_FindClass): Likewise. (_Jv_GetJNIEnvNewFrame): Likewise. (_Jv_JNI_AttachCurrentThread): Likewise. (_Jv_GetJNIEnvNewFrameWithLoader): New function. (_Jv_GetJNIEnvNewFrame): Use it. * include/jni_md.h (_CLASSPATH_JNIENV_CONTENTS): Removed 'klass'. From-SVN: r121064
This commit is contained in:
parent
c8832aae41
commit
262fa8a4b5
15 changed files with 255 additions and 54 deletions
25
libjava/testsuite/libjava.jni/pr29812.java
Normal file
25
libjava/testsuite/libjava.jni/pr29812.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
import java.io.File;
|
||||
import java.net.*;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class pr29812
|
||||
{
|
||||
static {
|
||||
System.loadLibrary("pr29812");
|
||||
}
|
||||
|
||||
public static native void baseN();
|
||||
|
||||
public static void main(String[] args) throws Throwable
|
||||
{
|
||||
// Make sure JNI environment is initialized.
|
||||
baseN();
|
||||
|
||||
File jar = new File(args[0]);
|
||||
URL u = jar.toURL();
|
||||
URLClassLoader uc = new URLClassLoader(new URL[] { u });
|
||||
Class k = uc.loadClass("pr29812_injar");
|
||||
Method m = k.getMethod("doit", (Class[]) null);
|
||||
m.invoke(null, (Object[]) null);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue