merged volatile memory barriers
[cacao.git] / src / vm / vm.hpp
index e09f3a518fed381a4d44028bf2f8d5dafbd8c05c..0430fa4d6a30be141f7a43469bd9cd9352ecca36 100644 (file)
@@ -33,6 +33,7 @@
 
 // We need the JNI types for the VM class.
 #include "native/jni.hpp"
+#include "native/native.hpp"
 
 #if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
 # include "native/vm/openjdk/hpi.hpp"
@@ -40,6 +41,7 @@
 #endif
 
 #include "vm/properties.hpp"
+#include "vm/suck.hpp"
 
 #include "vm/jit/optimizing/recompiler.hpp"
 
@@ -63,16 +65,23 @@ private:
        bool    _created;
        bool    _exiting;
        int64_t _starttime;
+       int64_t _inittime;
 
        // Subsystems.
-       Properties _properties; ///< Commandline properties.
+       Properties      _properties;      ///< Commandline properties.
 #if defined(ENABLE_THREADS)
-       Recompiler _recompiler; ///< JIT recompilation framework.
+       Recompiler      _recompiler;      ///< JIT recompilation framework.
 #endif
 #if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
-       HPI        _hpi;
-       Management _management;
+       HPI             _hpi;             ///< Host Porting Interface.
+       Management      _management;      ///< Java management interface.
 #endif
+       NativeLibraries _nativelibraries; ///< Native library table.
+       NativeMethods   _nativemethods;   ///< Native methods table.
+#if defined(ENABLE_JVMTI)
+       NativeAgents    _nativeagents;    ///< Native agents table.
+#endif
+       SuckClasspath   _suckclasspath;   ///< Classpath entries list.
 
 public:
        // Constructor, Destructor.
@@ -93,29 +102,33 @@ public:
        bool    is_created()      { return _created; }
        bool    is_exiting()      { return _exiting; }
        int64_t get_starttime()   { return _starttime; }
+       int64_t get_inittime()    { return _inittime; }
 
-       Properties& get_properties() { return _properties; }
-       Recompiler& get_recompiler() { return _recompiler; } // REMOVEME
+       Properties&      get_properties     () { return _properties; }
+       Recompiler&      get_recompiler     () { return _recompiler; } // REMOVEME
 #if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
-       HPI&        get_hpi       () { return _hpi; }
-       Management& get_management() { return _management; }
+       HPI&             get_hpi            () { return _hpi; }
+       Management&      get_management     () { return _management; }
 #endif
+       NativeLibraries& get_nativelibraries() { return _nativelibraries; }
+       NativeMethods&   get_nativemethods  () { return _nativemethods; }
+       SuckClasspath&   get_suckclasspath  () { return _suckclasspath; }
+
+private:
+       // Internal helper methods.
+       bool start_runtime_agents();
 };
 
 #else
 
-JavaVM* VM_get_javavm();
 JNIEnv* VM_get_jnienv();
-bool    VM_is_initializing();
-bool    VM_is_created();
-int64_t VM_get_starttime();
 
 #endif
 
 
 // Includes.
 #include "vm/global.h"
-#include "vm/method.h"
+#include "vm/method.hpp"
 
 
 /* These C methods are the exported interface. ********************************/
@@ -144,9 +157,6 @@ extern uint8_t* intrp_main_stack;
 extern "C" {
 #endif
 
-void usage(void);
-
-bool vm_create(JavaVMInitArgs *vm_args);
 void vm_run(JavaVM *vm, JavaVMInitArgs *vm_args);
 int32_t   vm_destroy(JavaVM *vm);
 void vm_exit(int32_t status);
@@ -185,8 +195,6 @@ java_handle_t *vm_call_method_objectarray(methodinfo *m, java_handle_t *o, java_
 
 // Legacy C interface.
 void vm_abort(const char* text, ...);
-void vm_abort_errnum(int errnum, const char* text, ...);
-void vm_abort_errno(const char* text, ...);
 
 #ifdef __cplusplus
 }