X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fnative%2Fvm%2Fopenjdk%2Fjvm.cpp;h=0d365146f0e398fb44aa2bdfa738b5a9b414d024;hb=2d0318e8ef5490edb37dd0727e0b58f2feb2c3bf;hp=6c12ba268455f620590a2788c41571fc241e85db;hpb=bcd7224290822a4217fd5f3f944730b3061fd5c6;p=cacao.git diff --git a/src/native/vm/openjdk/jvm.cpp b/src/native/vm/openjdk/jvm.cpp index 6c12ba268..0d365146f 100644 --- a/src/native/vm/openjdk/jvm.cpp +++ b/src/native/vm/openjdk/jvm.cpp @@ -1,6 +1,6 @@ /* 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. @@ -38,8 +38,6 @@ #include #endif -#include -#include #include // Include our JNI header before the JVM headers, because the JVM @@ -655,6 +653,25 @@ void JVM_ResolveClass(JNIEnv* env, jclass cls) } +/* 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) @@ -2147,7 +2164,23 @@ jboolean JVM_IsThreadAlive(JNIEnv* env, jobject jthread) 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); } @@ -2155,7 +2188,23 @@ void JVM_SuspendThread(JNIEnv* env, jobject jthread) 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); } @@ -3201,7 +3250,7 @@ jobjectArray JVM_GetAllThreads(JNIEnv *env, jclass dummy) for (List::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); @@ -3560,7 +3609,7 @@ jobjectArray JVM_GetThreadStateNames(JNIEnv* env, jint javaThreadState, jintArra 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);