* src/native/vm/nativevm.cpp (nativevm_init): Return boolean to indicate error.
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Wed, 25 Feb 2009 08:38:31 +0000 (09:38 +0100)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Wed, 25 Feb 2009 08:38:31 +0000 (09:38 +0100)
* src/native/vm/nativevm.hpp (nativevm_init): Adapted signature accordignly.
* src/vm/vm.cpp (VM::VM): Check for above error flag.

src/native/vm/nativevm.cpp
src/native/vm/nativevm.hpp
src/vm/vm.cpp

index 675bacb8518215d0ff0fe8ca071ebe3efaa76817..837b4a0b76338fd5c9ba7760948fc5755ca01bdb 100644 (file)
@@ -30,6 +30,7 @@
 #include "native/vm/nativevm.hpp"
 
 #include "vm/class.hpp"
+#include "vm/exceptions.hpp"
 #include "vm/initialize.hpp"
 #include "vm/method.hpp"
 #include "vm/options.h"
@@ -161,7 +162,7 @@ void nativevm_preinit(void)
 
 *******************************************************************************/
 
-void nativevm_init(void)
+bool nativevm_init(void)
 {
        TRACESUBSYSTEMINITIALIZATION("nativevm_init");
 
@@ -180,10 +181,13 @@ void nativevm_init(void)
                                                                                         false);
 
        if (m == NULL)
-               os::abort("nativevm_init: Error resolving java.lang.System.initializeSystemClass()");
+               return false;
 
        (void) vm_call_method(m, NULL);
 
+       if (exceptions_get_exception() != NULL)
+               return false;
+
 # else
 #  error unknown classpath configuration
 # endif
@@ -195,6 +199,8 @@ void nativevm_init(void)
 #else
 # error unknown Java configuration
 #endif
+
+       return true;
 }
 
 
index 826643f6104b67d7728db8e578cee325d61781ba..9f651a6cec99c0b7de0b6531dc69fbb7882241af 100644 (file)
@@ -31,7 +31,7 @@
 /* function prototypes ********************************************************/
 
 void nativevm_preinit(void);
-void nativevm_init(void);
+bool nativevm_init(void);
 
 #if defined(ENABLE_JAVASE)
 # if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
index 43fb31c9a402ac613579e143935f44c9c5dc6d4a..349ab9a3b0955ef446a428c4bb6eab90aaae9934 100644 (file)
@@ -1472,7 +1472,8 @@ VM::VM(JavaVMInitArgs* vm_args)
        /* Initialize the native VM subsystem. */
        /* AFTER: threads_init (at least for SUN's classes) */
 
-       nativevm_init();
+       if (!nativevm_init())
+               os::abort("vm_create: nativevm_init failed");
 
 #if defined(ENABLE_PROFILING)
        /* initialize profiling */