aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Fitzsimmons <fitzsim@redhat.com>2005-02-23 17:36:26 +0000
committerThomas Fitzsimmons <fitzsim@gcc.gnu.org>2005-02-23 17:36:26 +0000
commitbc71e4a22b8d2b894a283f34974aeba11a28bb96 (patch)
tree9b2cca6c033589c537e103cd0b5bbf64f75f3359 /gcc
parentc150a271b1fa7ad02b245dea1579b3f2e981e85a (diff)
downloadgcc-bc71e4a22b8d2b894a283f34974aeba11a28bb96.zip
gcc-bc71e4a22b8d2b894a283f34974aeba11a28bb96.tar.gz
gcc-bc71e4a22b8d2b894a283f34974aeba11a28bb96.tar.bz2
re PR libgcj/16923 (-D* Options passed to JNI_CreateJavaVM are ignored)
2005-02-23 Thomas Fitzsimmons <fitzsim@redhat.com> PR libgcj/16923 * gcj.texi (Invocation): Add descriptions of JvVMInitArgs and JvVMOption. 2005-02-23 Thomas Fitzsimmons <fitzsim@redhat.com> PR libgcj/16923 * jni.cc (JNI_CreateJavaVM): Check JNI version. Cast args to JvVMInitArgs. Pass args to _Jv_CreateJavaVM and check return value. Move argument parsing code to prims.cc. * prims.cc (no_properties): Remove. (_Jv_Compiler_Properties): Initialize to NULL. (_Jv_Properties_Count): Initialize to 0. (parse_verbose_args): New function. (parse_init_args): New function. (_Jv_CreateJavaVM): Call parse_init_args. (_Jv_RunMain): Check return value of _Jv_CreateJavaVM. * gcj/cni.h (JvVMOption): New struct. (JvVMInitArgs): Likewise. (JvCreateJavaVM): Declare vm_args as JvVMInitArgs* rather than void*. * libjava/gcj/javaprims.h (_Jv_VMOption): New struct. (_Jv_VMInitArgs): Likewise. * include/java-props.h (_Jv_Properties_Count): Declare. * java/lang/natRuntime.cc (insertSystemProperties): Use _Jv_Properties_Count in for loop exit condition. * testsuite/libjava.jni/jni.exp (gcj_invocation_compile_c_to_binary): New procedure. (gcj_invocation_test_one): Likewise. (gcj_jni_run): Run JNI invocation API tests. * testsuite/libjava.jni/invocation/PR16923.c, testsuite/libjava.jni/invocation/PR16923.java, testsuite/libjava.jni/invocation/PR16923.out: New test. From-SVN: r95459
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/gcj.texi40
2 files changed, 41 insertions, 5 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 54dc009..5f9cd4a 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,9 @@
+2005-02-23 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ PR libgcj/16923
+ * gcj.texi (Invocation): Add descriptions of JvVMInitArgs and
+ JvVMOption.
+
2005-02-22 Tom Tromey <tromey@redhat.com>
PR java/20056:
diff --git a/gcc/java/gcj.texi b/gcc/java/gcj.texi
index 6853156..b270b6f 100644
--- a/gcc/java/gcj.texi
+++ b/gcc/java/gcj.texi
@@ -2110,7 +2110,8 @@ CNI permits C++ applications to make calls into Java classes, in addition to
allowing Java code to call into C++. Several functions, known as the
@dfn{invocation API}, are provided to support this.
-@deftypefun jint JvCreateJavaVM (void* @var{vm_args})
+@deftypefun jint JvCreateJavaVM (JvVMInitArgs* @var{vm_args})
+
Initializes the Java runtime. This function performs essential initialization
of the threads interface, garbage collector, exception handling and other key
aspects of the runtime. It must be called once by an application with
@@ -2119,11 +2120,40 @@ It is safe, but not recommended, to call @code{JvCreateJavaVM()} more than
once provided it is only called from a single thread.
The @var{vmargs} parameter can be used to specify initialization parameters
for the Java runtime. It may be @code{NULL}.
-This function returns @code{0} upon success, or @code{-1} if the runtime is
-already initialized.
-@emph{Note:} In GCJ 3.1, the @code{vm_args} parameter is ignored. It may be
-used in a future release.
+JvVMInitArgs represents a list of virtual machine initialization
+arguments. @code{JvCreateJavaVM()} ignores the version field.
+
+@example
+typedef struct JvVMOption
+@{
+ // a VM initialization option
+ char* optionString;
+ // extra information associated with this option
+ void* extraInfo;
+@} JvVMOption;
+
+typedef struct JvVMInitArgs
+@{
+ // for compatibility with JavaVMInitArgs
+ jint version;
+
+ // number of VM initialization options
+ jint nOptions;
+
+ // an array of VM initialization options
+ JvVMOption* options;
+
+ // true if the option parser should ignore unrecognized options
+ jboolean ignoreUnrecognized;
+@} JvVMInitArgs;
+@end example
+
+@code{JvCreateJavaVM()} returns @code{0} upon success, or @code{-1} if
+the runtime is already initialized.
+
+@emph{Note:} In GCJ 3.1, the @code{vm_args} parameter is ignored. It
+is recognized and used as of release 4.0.
@end deftypefun
@deftypefun java::lang::Thread* JvAttachCurrentThread (jstring @var{name}, java::lang::ThreadGroup* @var{group})