+
+ // When true, print debugging information about class loading.
+ bool verbose_class_flag;
+
+ // When true, enable the bytecode verifier and BC-ABI type verification.
+ bool verifyClasses = true;
+
+ // 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,
+// for compatibility with existing application launch scripts.
+static jint
+parse_x_arg (char* option_string)
+{
+ if (strlen (option_string) <= 0)
+ return -1;
+
+ if (! strcmp (option_string, "int"))
+ {
+ // FIXME: this should cause the vm to never load shared objects
+ }
+ else if (! strcmp (option_string, "mixed"))
+ {
+ // FIXME: allow interpreted and native code
+ }
+ else if (! strcmp (option_string, "batch"))
+ {
+ // FIXME: disable background JIT'ing
+ }
+ else if (! strcmp (option_string, "debug"))
+ {
+ remoteDebug = true;
+ }
+#ifdef INTERPRETER
+ else if (! strncmp (option_string, "runjdwp:", 8))
+ {
+ if (strlen (option_string) > 8)
+ jdwpOptions = &option_string[8];
+ else
+ {
+ fprintf (stderr,
+ "libgcj: argument required for JDWP options");
+ return -1;
+ }
+ }
+#endif // INTERPRETER
+ else if (! strncmp (option_string, "bootclasspath:", 14))
+ {
+ // FIXME: add a parse_bootclasspath_arg function
+ }
+ else if (! strncmp (option_string, "bootclasspath/a:", 16))
+ {
+ }
+ else if (! strncmp (option_string, "bootclasspath/p:", 16))
+ {
+ }
+ else if (! strcmp (option_string, "check:jni"))
+ {
+ // FIXME: enable strict JNI checking
+ }
+ else if (! strcmp (option_string, "future"))
+ {
+ // FIXME: enable strict class file format checks
+ }
+ else if (! strcmp (option_string, "noclassgc"))
+ {
+ // FIXME: disable garbage collection for classes
+ }
+ else if (! strcmp (option_string, "incgc"))
+ {
+ // FIXME: incremental garbage collection
+ }
+ else if (! strncmp (option_string, "loggc:", 6))
+ {
+ if (option_string[6] == '\0')
+ {
+ fprintf (stderr,
+ "libgcj: filename argument expected for loggc option\n");
+ return -1;
+ }
+ // FIXME: set gc logging filename
+ }
+ else if (! strncmp (option_string, "ms", 2))
+ {
+ // FIXME: ignore this option until PR 20699 is fixed.
+ // _Jv_SetInitialHeapSize (option_string + 2);
+ }
+ else if (! strncmp (option_string, "mx", 2))
+ _Jv_SetMaximumHeapSize (option_string + 2);
+ else if (! strcmp (option_string, "prof"))
+ {
+ // FIXME: enable profiling of program running in vm
+ }
+ else if (! strncmp (option_string, "runhprof:", 9))
+ {
+ // FIXME: enable specific type of vm profiling. add a
+ // parse_runhprof_arg function
+ }
+ else if (! strcmp (option_string, "rs"))
+ {
+ // FIXME: reduced system signal usage. disable thread dumps,
+ // only terminate in response to user-initiated calls,
+ // e.g. System.exit()
+ }
+ else if (! strncmp (option_string, "ss", 2))
+ {
+ _Jv_SetStackSize (option_string + 2);
+ }
+ else if (! strcmp (option_string, "X:+UseAltSigs"))
+ {
+ // FIXME: use signals other than SIGUSR1 and SIGUSR2
+ }
+ else if (! strcmp (option_string, "share:off"))
+ {
+ // FIXME: don't share class data
+ }
+ else if (! strcmp (option_string, "share:auto"))
+ {
+ // FIXME: share class data where possible
+ }
+ else if (! strcmp (option_string, "share:on"))
+ {
+ // FIXME: fail if impossible to share class data
+ }
+ else
+ {
+ // Unrecognized.
+ return -1;
+ }
+ return 0;