+/**
+ * Invokes the static Java method getSystemClassLoader().
+ *
+ * @return Return value of the invocation or NULL in
+ * case of an exception.
+ */
+java_handle_t* java_lang_ClassLoader::invoke_getSystemClassLoader()
+{
+ methodinfo *m;
+ java_handle_t *clo;
+ classloader_t *cl;
+
+ assert(class_java_lang_Object);
+ assert(class_java_lang_ClassLoader);
+ assert(class_java_lang_ClassLoader->state & CLASS_LINKED);
+
+ m = class_resolveclassmethod(class_java_lang_ClassLoader,
+ utf_getSystemClassLoader,
+ utf_void__java_lang_ClassLoader,
+ class_java_lang_Object,
+ false);
+
+ if (m == NULL)
+ return NULL;
+
+ clo = vm_call_method(m, NULL);
+
+ if (clo == NULL)
+ return NULL;
+
+ cl = loader_hashtable_classloader_add(clo);
+
+ return cl;
+}
+
+
+/**
+ * Constructs a new instance of the class by calling the
+ * appropriate Java initializer.
+ */
+java_lang_management_MemoryUsage::java_lang_management_MemoryUsage(int64_t init, int64_t used, int64_t commited, int64_t maximum)
+{
+ // Load the class.
+ // XXX Maybe this should be made global at some points.
+ classinfo* class_java_lang_management_MemoryUsage;
+ if (!(class_java_lang_management_MemoryUsage = load_class_bootstrap(utf_new_char("java/lang/management/MemoryUsage"))))
+ return;
+
+ // Find the appropriate initializer.
+ // XXX Maybe this should be made global at some points.
+ methodinfo* m = class_findmethod(class_java_lang_management_MemoryUsage,
+ utf_init,
+ utf_new_char("(JJJJ)V"));
+
+ if (m == NULL)
+ return;
+
+ // Instantiate a new object.
+ _handle = builtin_new(class_java_lang_management_MemoryUsage);
+
+ if (is_null())
+ return;
+
+ // Call initializer.
+ (void) vm_call_method(m, _handle, init, used, commited, maximum);
+}
+
+