diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
commit | 65bf3316cf384588453604be6b4f0ed3751a8b0f (patch) | |
tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/prims.cc | |
parent | 8fc56618a84446beccd45b80381cdfe0e94050df (diff) | |
download | gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.tar.gz |
Merged gcj-eclipse branch to trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r-- | libjava/prims.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc index dfeb95766af..3f88fb7db76 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -1122,6 +1122,18 @@ namespace gcj // Thread stack size specified by the -Xss runtime argument. size_t stack_size = 0; + + // Start time of the VM + jlong startTime = 0; + + // Arguments passed to the VM + JArray<jstring>* vmArgs; + + // Currently loaded classes + jint loadedClasses = 0; + + // Unloaded classes + jlong unloadedClasses = 0; } // We accept all non-standard options accepted by Sun's java command, @@ -1422,6 +1434,9 @@ _Jv_CreateJavaVM (JvVMInitArgs* vm_args) if (runtimeInitialized) return -1; + runtimeInitialized = true; + startTime = _Jv_platform_gettimeofday(); + jint result = parse_init_args (vm_args); if (result < 0) return -1; @@ -1522,6 +1537,18 @@ _Jv_RunMain (JvVMInitArgs *vm_args, jclass klass, const char *name, int argc, fprintf (stderr, "libgcj: couldn't create virtual machine\n"); exit (1); } + + if (vm_args == NULL) + gcj::vmArgs = JvConvertArgv(0, NULL); + else + { + const char* vmArgs[vm_args->nOptions]; + const char** vmPtr = vmArgs; + struct _Jv_VMOption* optionPtr = vm_args->options; + for (int i = 0; i < vm_args->nOptions; ++i) + *vmPtr++ = (*optionPtr++).optionString; + gcj::vmArgs = JvConvertArgv(vm_args->nOptions, vmArgs); + } // Get the Runtime here. We want to initialize it before searching // for `main'; that way it will be set up if `main' is a JNI method. @@ -1599,6 +1626,12 @@ JvRunMain (jclass klass, int argc, const char **argv) _Jv_RunMain (klass, NULL, argc, argv, false); } +void +JvRunMainName (const char *name, int argc, const char **argv) +{ + _Jv_RunMain (NULL, name, argc, argv, false); +} + // Parse a string and return a heap size. |