/* src/native/vm/openjdk/jvm.cpp - HotSpot VM interface functions
- Copyright (C) 2007, 2008, 2009
+ Copyright (C) 1996-2011
CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
Copyright (C) 2009 Theobroma Systems Ltd.
#include <sys/ioctl.h>
#endif
-#include <sys/socket.h>
-#include <sys/stat.h>
#include <sys/types.h>
// Include our JNI header before the JVM headers, because the JVM
}
+/* JVM_FindClassFromBootLoader */
+
+jclass JVM_FindClassFromBootLoader(JNIEnv* env, const char* name)
+{
+ classinfo *c;
+ utf *u;
+
+ TRACEJVMCALLS(("JVM_FindClassFromBootLoader(name=%s)", name));
+
+ u = utf_new_char(name);
+ c = load_class_from_classloader(u, NULL);
+
+ if (c == NULL)
+ return NULL;
+
+ return (jclass) LLNI_classinfo_wrap(c);
+}
+
+
/* JVM_FindClassFromClassLoader */
jclass JVM_FindClassFromClassLoader(JNIEnv* env, const char* name, jboolean init, jobject loader, jboolean throwError)
void JVM_SuspendThread(JNIEnv* env, jobject jthread)
{
- log_println("JVM_SuspendThread: Deprecated. Not implemented.");
+ java_handle_t *h;
+ threadobject *t;
+
+ TRACEJVMCALLS(("JVM_SuspendThread(env=%p, jthread=%p)", env, jthread));
+
+ if (opt_PrintWarnings)
+ log_println("JVM_SuspendThread: Deprecated, do not use!");
+
+ h = (java_handle_t *) jthread;
+ t = thread_get_thread(h);
+
+ /* The threadobject is null when a thread is created in Java. */
+
+ if (t == NULL)
+ return;
+
+ threads_suspend_thread(t, SUSPEND_REASON_JAVA);
}
void JVM_ResumeThread(JNIEnv* env, jobject jthread)
{
- log_println("JVM_ResumeThread: Deprecated. Not implemented.");
+ java_handle_t *h;
+ threadobject *t;
+
+ TRACEJVMCALLS(("JVM_ResumeThread(env=%p, jthread=%p)", env, jthread));
+
+ if (opt_PrintWarnings)
+ log_println("JVM_ResumeThread: Deprecated, do not use!");
+
+ h = (java_handle_t *) jthread;
+ t = thread_get_thread(h);
+
+ /* The threadobject is null when a thread is created in Java. */
+
+ if (t == NULL)
+ return;
+
+ threads_resume_thread(t, SUSPEND_REASON_JAVA);
}
for (List<threadobject*>::iterator it = active_threads.begin(); it != active_threads.end(); it++) {
threadobject* t = *it;
- java_handle_t* h = thread_get_object(t);
+ java_handle_t* h = LLNI_WRAP(t->object);
assert(h != NULL);
oa.set_element(index, h);
void JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size)
{
- TRACEJVMCALLS(("JVM_GetVersionInfo(env=%p, info=%p, info_size=%d)", env, info, info_size));
+ TRACEJVMCALLS(("JVM_GetVersionInfo(env=%p, info=%p, info_size=%zd)", env, info, info_size));
memset(info, 0, info_size);