X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fnative%2Fvm%2Fopenjdk%2Fjvm.cpp;h=945f22157a3d6556bc1e28753fa81e496a0d661b;hb=735bdda890a385d1fa9cc532faadbbc96f2d1218;hp=596b3df83a79471947865036e66b7c0727768683;hpb=b6fac998138b04cbb49a787bf6d673cc6480719c;p=cacao.git diff --git a/src/native/vm/openjdk/jvm.cpp b/src/native/vm/openjdk/jvm.cpp index 596b3df83..945f22157 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 + Copyright (C) 2007, 2008, 2009 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 @@ -2147,7 +2145,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 +2169,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); } @@ -3186,8 +3216,8 @@ jboolean JVM_CX8Field(JNIEnv *env, jobject obj, jfieldID fid, jlong oldVal, jlon jobjectArray JVM_GetAllThreads(JNIEnv *env, jclass dummy) { // Get a list of all active threads. - list active_threads; - ThreadList::get_active_threads(active_threads); + List active_threads; + ThreadList::get_active_java_threads(active_threads); // Allocate array to hold the java.lang.Thread objects. int32_t length = active_threads.size(); @@ -3560,7 +3590,15 @@ jobjectArray JVM_GetThreadStateNames(JNIEnv* env, jint javaThreadState, jintArra void JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size) { - log_println("JVM_GetVersionInfo: IMPLEMENT ME!"); + TRACEJVMCALLS(("JVM_GetVersionInfo(env=%p, info=%p, info_size=%zd)", env, info, info_size)); + + memset(info, 0, info_size); + + info->jvm_version = ((VERSION_MAJOR & 0xff) << 24) | ((VERSION_MINOR & 0xff) << 16) | (VERSION_MICRO & 0xff); + info->update_version = 0; + info->special_update_version = 0; + info->is_attach_supported = 0; + info->is_kernel_jvm = 0; }