harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r434076 [14/18] - in /incubator/harmony/enhanced/drlvm/trunk: build/make/components/ build/make/components/vm/ build/make/targets/ build/patches/lnx/ build/patches/lnx/APR/ build/patches/lnx/APR/threadproc/ build/patches/lnx/APR/threadproc/...
Date Wed, 23 Aug 2006 16:49:21 GMT
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_method.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_method.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_method.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_method.cpp Wed Aug 23 09:48:41 2006
@@ -34,13 +34,13 @@
 #include "object_handles.h"
 #include "open/vm_util.h"
 #include "vm_threads.h"
-#include "open/thread.h"
+
 #include "ini.h"
 #include "nogc.h"
 
 static bool ensure_initialised(JNIEnv* env, Class* clss)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if(clss->state != ST_Initialized) {
         class_initialize_from_jni(clss);
         if(clss->state == ST_Error) {
@@ -64,7 +64,7 @@
                               const char *descr)
 {
     TRACE2("jni", "GetMethodID called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     assert(clazz);
 
     Class* clss = jclass_to_struct_Class(clazz);
@@ -97,7 +97,7 @@
                                     const char *descr)
 {
     TRACE2("jni", "GetStaticMethodID called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class* clss = jclass_to_struct_Class(clazz);
 
     Method *method;
@@ -152,7 +152,7 @@
                                       jvalue *result,
                                       int non_virtual)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Method *method = (Method *)methodID;
 
     if ( !non_virtual && !method_is_private(method) ) {
@@ -189,7 +189,7 @@
 void JNICALL CallVoidMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallVoidMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     CallVoidMethodV(env, obj, methodID, args);
@@ -200,7 +200,7 @@
 void JNICALL CallVoidMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallVoidMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     CallVoidMethodA(env, obj, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -214,7 +214,7 @@
                              jvalue *args)
 {
     TRACE2("jni", "CallVoidMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     call_method_no_ref_result(env, obj, methodID, args, 0, FALSE);
 } //CallVoidMethodA
 
@@ -223,7 +223,7 @@
 jobject JNICALL CallObjectMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallObjectMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallObjectMethodV(env, obj, methodID, args);
@@ -234,7 +234,7 @@
 jobject JNICALL CallObjectMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallObjectMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jobject result = CallObjectMethodA(env, obj, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -249,7 +249,7 @@
                                   jvalue *args)
 {
     TRACE2("jni", "CallObjectMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     Method *method = (Method *)methodID; // resolve to actual vtable entry below
 
@@ -289,7 +289,7 @@
 jboolean JNICALL CallBooleanMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallBooleanMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallBooleanMethodV(env, obj, methodID, args);
@@ -300,7 +300,7 @@
 jboolean JNICALL CallBooleanMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallBooleanMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jboolean result = CallBooleanMethodA(env, obj, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -315,7 +315,7 @@
                                     jvalue *args)
 {
     TRACE2("jni", "CallBooleanMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, FALSE);
     return result.z;
@@ -326,7 +326,7 @@
 jbyte JNICALL CallByteMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallByteMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallByteMethodV(env, obj, methodID, args);
@@ -337,7 +337,7 @@
 jbyte JNICALL CallByteMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallByteMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jbyte result = CallByteMethodA(env, obj, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -352,7 +352,7 @@
                               jvalue *args)
 {
     TRACE2("jni", "CallByteMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, FALSE);
     return result.b;
@@ -364,7 +364,7 @@
 jchar JNICALL CallCharMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallCharMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallCharMethodV(env, obj, methodID, args);
@@ -375,7 +375,7 @@
 jchar JNICALL CallCharMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallCharMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jchar result = CallCharMethodA(env, obj, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -390,7 +390,7 @@
                               jvalue *args)
 {
     TRACE2("jni", "CallCharMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, FALSE);
     return result.c;
@@ -402,7 +402,7 @@
 jshort JNICALL CallShortMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallShortMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallShortMethodV(env, obj, methodID, args);
@@ -413,7 +413,7 @@
 jshort JNICALL CallShortMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallShortMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jshort result = CallShortMethodA(env, obj, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -428,7 +428,7 @@
                                 jvalue *args)
 {
     TRACE2("jni", "CallShortMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, FALSE);
     return result.s;
@@ -440,7 +440,7 @@
 jint JNICALL CallIntMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallIntMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallIntMethodV(env, obj, methodID, args);
@@ -451,7 +451,7 @@
 jint JNICALL CallIntMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallIntMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jint result = CallIntMethodA(env, obj, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -466,7 +466,7 @@
                               jvalue *args)
 {
     TRACE2("jni", "CallIntMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, FALSE);
     return result.i;
@@ -478,7 +478,7 @@
 jlong JNICALL CallLongMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallLongMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallLongMethodV(env, obj, methodID, args);
@@ -489,7 +489,7 @@
 jlong JNICALL CallLongMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallLongMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jlong result = CallLongMethodA(env, obj, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -504,7 +504,7 @@
                               jvalue *args)
 {
     TRACE2("jni", "CallLongMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, FALSE);
     return result.j;
@@ -516,7 +516,7 @@
 jfloat JNICALL CallFloatMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallFloatMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallFloatMethodV(env, obj, methodID, args);
@@ -527,7 +527,7 @@
 jfloat JNICALL CallFloatMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallFloatMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jfloat result = CallFloatMethodA(env, obj, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -542,7 +542,7 @@
                                 jvalue *args)
 {
     TRACE2("jni", "CallFloatMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, FALSE);
     return result.f;
@@ -554,7 +554,7 @@
 jdouble JNICALL CallDoubleMethod(JNIEnv *env, jobject obj, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallDoubleMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallDoubleMethodV(env, obj, methodID, args);
@@ -565,7 +565,7 @@
 jdouble JNICALL CallDoubleMethodV(JNIEnv *env, jobject obj, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallDoubleMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jdouble result = CallDoubleMethodA(env, obj, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -580,7 +580,7 @@
                                   jvalue *args)
 {
     TRACE2("jni", "CallDoubleMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, FALSE);
     return result.d;
@@ -605,7 +605,7 @@
                                        ...)
 {
     TRACE2("jni", "CallNonvirtualVoidMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     CallNonvirtualVoidMethodV(env, obj, clazz, methodID, args);
@@ -620,7 +620,7 @@
                                        va_list args)
 {
     TRACE2("jni", "CallNonvirtualVoidMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     CallNonvirtualVoidMethodA(env, obj, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -635,7 +635,7 @@
                                        jvalue *args)
 {
     TRACE2("jni", "CallNonvirtualVoidMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     call_method_no_ref_result(env, obj, methodID, args, 0, TRUE);
 } //CallNonvirtualVoidMethodA
 
@@ -648,7 +648,7 @@
                                            ...)
 {
     TRACE2("jni", "CallNonvirtualObjectMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallNonvirtualObjectMethodV(env, obj, clazz, methodID, args);
@@ -663,7 +663,7 @@
                                             va_list args)
 {
     TRACE2("jni", "CallNonvirtualObjectMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jobject result = CallNonvirtualObjectMethodA(env, obj, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -679,7 +679,7 @@
                                             jvalue *args)
 {
     TRACE2("jni", "CallNonvirtualObjectMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     Method *method = (Method *)methodID;
     if (!ensure_initialised(env, method->get_class()))
@@ -706,7 +706,7 @@
                                              ...)
 {
     TRACE2("jni", "CallNonvirtualBooleanMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallNonvirtualBooleanMethodV(env, obj, clazz, methodID, args);
@@ -721,7 +721,7 @@
                                               va_list args)
 {
     TRACE2("jni", "CallNonvirtualBooleanMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jboolean result = CallNonvirtualBooleanMethodA(env, obj, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -737,7 +737,7 @@
                                               jvalue *args)
 {
     TRACE2("jni", "CallNonvirtualBooleanMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, TRUE);
     return result.z;
@@ -752,7 +752,7 @@
                                        ...)
 {
     TRACE2("jni", "CallNonvirtualByteMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallNonvirtualByteMethodV(env, obj, clazz, methodID, args);
@@ -767,7 +767,7 @@
                                         va_list args)
 {
     TRACE2("jni", "CallNonvirtualByteMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jbyte result = CallNonvirtualByteMethodA(env, obj, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -783,7 +783,7 @@
                                         jvalue *args)
 {
     TRACE2("jni", "CallNonvirtualByteMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, TRUE);
     return result.b;
@@ -798,7 +798,7 @@
                                        ...)
 {
     TRACE2("jni", "CallNonvirtualCharMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallNonvirtualCharMethodV(env, obj, clazz, methodID, args);
@@ -813,7 +813,7 @@
                                         va_list args)
 {
     TRACE2("jni", "CallNonvirtualCharMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jchar result = CallNonvirtualCharMethodA(env, obj, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -829,7 +829,7 @@
                                         jvalue *args)
 {
     TRACE2("jni", "CallNonvirtualCharMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, TRUE);
     return result.c;
@@ -844,7 +844,7 @@
                                          ...)
 {
     TRACE2("jni", "CallNonvirtualShortMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallNonvirtualShortMethodV(env, obj, clazz, methodID, args);
@@ -859,7 +859,7 @@
                                           va_list args)
 {
     TRACE2("jni", "CallNonvirtualShortMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jshort result = CallNonvirtualShortMethodA(env, obj, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -875,7 +875,7 @@
                                           jvalue *args)
 {
     TRACE2("jni", "CallNonvirtualShortMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, TRUE);
     return result.s;
@@ -890,7 +890,7 @@
                                      ...)
 {
     TRACE2("jni", "CallNonvirtualIntMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallNonvirtualIntMethodV(env, obj, clazz, methodID, args);
@@ -905,7 +905,7 @@
                                       va_list args)
 {
     TRACE2("jni", "CallNonvirtualIntMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jint result = CallNonvirtualIntMethodA(env, obj, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -921,7 +921,7 @@
                                       jvalue *args)
 {
     TRACE2("jni", "CallNonvirtualIntMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result,  TRUE);
     return result.i;
@@ -936,7 +936,7 @@
                                        ...)
 {
     TRACE2("jni", "CallNonvirtualLongMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallNonvirtualLongMethodV(env, obj, clazz, methodID, args);
@@ -951,7 +951,7 @@
                                         va_list args)
 {
     TRACE2("jni", "CallNonvirtualLongMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jlong result = CallNonvirtualLongMethodA(env, obj, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -967,7 +967,7 @@
                                         jvalue *args)
 {
     TRACE2("jni", "CallNonvirtualLongMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, TRUE);
     return result.j;
@@ -982,7 +982,7 @@
                                          ...)
 {
     TRACE2("jni", "CallNonvirtualFloatMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallNonvirtualFloatMethodV(env, obj, clazz, methodID, args);
@@ -997,7 +997,7 @@
                                           va_list args)
 {
     TRACE2("jni", "CallNonvirtualFloatMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jfloat result = CallNonvirtualFloatMethodA(env, obj, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -1013,7 +1013,7 @@
                                             jvalue *args)
 {
     TRACE2("jni", "CallNonvirtualFloatMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, TRUE);
     return result.f;
@@ -1028,7 +1028,7 @@
                                            ...)
 {
     TRACE2("jni", "CallNonvirtualDoubleMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallNonvirtualDoubleMethodV(env, obj, clazz, methodID, args);
@@ -1043,7 +1043,7 @@
                                             va_list args)
 {
     TRACE2("jni", "CallNonvirtualDoubleMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jdouble result = CallNonvirtualDoubleMethodA(env, obj, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -1059,7 +1059,7 @@
                                             jvalue *args)
 {
     TRACE2("jni", "CallNonvirtualDoubleMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_method_no_ref_result(env, obj, methodID, args, &result, TRUE);
     return result.d;
@@ -1082,7 +1082,7 @@
                                              jvalue *args,
                                              jvalue *result)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Method *method = (Method *)methodID;
     if (!ensure_initialised(env, method->get_class()))
         return;
@@ -1096,7 +1096,7 @@
 jobject JNICALL CallStaticObjectMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallStaticObjectMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallStaticObjectMethodV(env, clazz, methodID, args);
@@ -1107,7 +1107,7 @@
 jobject JNICALL CallStaticObjectMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallStaticObjectMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jobject result = CallStaticObjectMethodA(env, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -1122,7 +1122,7 @@
                                         jvalue *args)
 {
     TRACE2("jni", "CallStaticObjectMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     Method *method = (Method *)methodID;
     if (!ensure_initialised(env, method->get_class()))
@@ -1143,7 +1143,7 @@
 jboolean JNICALL CallStaticBooleanMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallStaticBooleanMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallStaticBooleanMethodV(env, clazz, methodID, args);
@@ -1154,7 +1154,7 @@
 jboolean JNICALL CallStaticBooleanMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallStaticBooleanMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jboolean result = CallStaticBooleanMethodA(env, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -1169,7 +1169,7 @@
                                           jvalue *args)
 {
     TRACE2("jni", "CallStaticBooleanMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_static_method_no_ref_result(env, clazz, methodID, args, &result);
     return result.z;
@@ -1180,7 +1180,7 @@
 jbyte JNICALL CallStaticByteMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallStaticByteMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallStaticByteMethodV(env, clazz, methodID, args);
@@ -1191,7 +1191,7 @@
 jbyte JNICALL CallStaticByteMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallStaticByteMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jbyte result = CallStaticByteMethodA(env, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -1206,7 +1206,7 @@
                                     jvalue *args)
 {
     TRACE2("jni", "CallStaticByteMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_static_method_no_ref_result(env, clazz, methodID, args, &result);
     return result.b;
@@ -1217,7 +1217,7 @@
 jchar JNICALL CallStaticCharMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallStaticCharMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallStaticCharMethodV(env, clazz, methodID, args);
@@ -1228,7 +1228,7 @@
 jchar JNICALL CallStaticCharMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallStaticCharMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jchar result = CallStaticCharMethodA(env, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -1243,7 +1243,7 @@
                                     jvalue *args)
 {
     TRACE2("jni", "CallStaticCharMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_static_method_no_ref_result(env, clazz, methodID, args, &result);
     return result.c;
@@ -1254,7 +1254,7 @@
 jshort JNICALL CallStaticShortMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallStaticShortMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallStaticShortMethodV(env, clazz, methodID, args);
@@ -1265,7 +1265,7 @@
 jshort JNICALL CallStaticShortMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallStaticShortMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jshort result = CallStaticShortMethodA(env, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -1280,7 +1280,7 @@
                                       jvalue *args)
 {
     TRACE2("jni", "CallStaticShortMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_static_method_no_ref_result(env, clazz, methodID, args, &result);
     return result.s;
@@ -1291,7 +1291,7 @@
 jint JNICALL CallStaticIntMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallStaticIntMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallStaticIntMethodV(env, clazz, methodID, args);
@@ -1302,7 +1302,7 @@
 jint JNICALL CallStaticIntMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallStaticIntMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jint result = CallStaticIntMethodA(env, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -1317,7 +1317,7 @@
                                   jvalue *args)
 {
     TRACE2("jni", "CallStaticIntMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_static_method_no_ref_result(env, clazz, methodID, args, &result);
     return result.i;
@@ -1328,7 +1328,7 @@
 jlong JNICALL CallStaticLongMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallStaticLongMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallStaticLongMethodV(env, clazz, methodID, args);
@@ -1339,7 +1339,7 @@
 jlong JNICALL CallStaticLongMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallStaticLongMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jlong result = CallStaticLongMethodA(env, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -1354,7 +1354,7 @@
                                     jvalue *args)
 {
     TRACE2("jni", "CallStaticLongMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_static_method_no_ref_result(env, clazz, methodID, args, &result);
     return result.j;
@@ -1365,7 +1365,7 @@
 jfloat JNICALL CallStaticFloatMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallStaticFloatMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallStaticFloatMethodV(env, clazz, methodID, args);
@@ -1376,7 +1376,7 @@
 jfloat JNICALL CallStaticFloatMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallStaticFloatMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jfloat result = CallStaticFloatMethodA(env, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -1391,7 +1391,7 @@
                                       jvalue *args)
 {
     TRACE2("jni", "CallStaticFloatMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_static_method_no_ref_result(env, clazz, methodID, args, &result);
     return result.f;
@@ -1402,7 +1402,7 @@
 jdouble JNICALL CallStaticDoubleMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallStaticDoubleMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return CallStaticDoubleMethodV(env, clazz, methodID, args);
@@ -1413,7 +1413,7 @@
 jdouble JNICALL CallStaticDoubleMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallStaticDoubleMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jdouble result = CallStaticDoubleMethodA(env, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -1428,7 +1428,7 @@
                                         jvalue *args)
 {
     TRACE2("jni", "CallStaticDoubleMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue result;
     call_static_method_no_ref_result(env, clazz, methodID, args, &result);
     return result.d;
@@ -1439,7 +1439,7 @@
 void JNICALL CallStaticVoidMethod(JNIEnv *env, jclass clazz, jmethodID methodID, ...)
 {
     TRACE2("jni", "CallStaticVoidMethod called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     CallStaticVoidMethodV(env, clazz, methodID, args);
@@ -1450,7 +1450,7 @@
 void JNICALL CallStaticVoidMethodV(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args)
 {
     TRACE2("jni", "CallStaticVoidMethodV called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     CallStaticVoidMethodA(env, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -1464,7 +1464,7 @@
                                    jvalue *args)
 {
     TRACE2("jni", "CallStaticVoidMethodA called, id = " << methodID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     call_static_method_no_ref_result(env, clazz, methodID, args, 0);
 } //CallStaticVoidMethodA
 

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_utils.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_utils.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_utils.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_utils.cpp Wed Aug 23 09:48:41 2006
@@ -39,7 +39,7 @@
 #include "method_lookup.h"
 #include "nogc.h"
 #include "m2n.h"
-#include "open/thread.h"
+
 
 #include "exception.h"
 #include "stack_trace.h"
@@ -52,7 +52,7 @@
 jclass jni_class_from_handle(JNIEnv* UNREF jenv, Class_Handle clss)
 {
     if (!clss) return NULL;
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     return struct_Class_to_jclass((Class*)clss);
 }
 
@@ -452,7 +452,7 @@
 //We'd better use this routine
 jclass SignatureToClass (JNIEnv* env_ext, const char* sig, ClassLoader *class_loader)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     JNIEnv_Internal *env = (JNIEnv_Internal *)env_ext;
     assert (sig);
 
@@ -614,7 +614,7 @@
 
 jclass FindClassWithClassLoader(JNIEnv* jenv, String *name, ClassLoader *loader)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 
     Class* c = loader->LoadVerifyAndPrepareClass( VM_Global_State::loader_env, name);
     assert(!exn_raised());
@@ -696,7 +696,7 @@
 #endif
 
     JNIEnv_Internal *env = (JNIEnv_Internal *)env_ext;
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     // Determine loader
     StackTraceFrame stf;
     bool res = st_get_frame(0, &stf);
@@ -711,7 +711,7 @@
     if(clss) {
         class_initialize_from_jni(clss);
         if (exn_raised()) return NULL;
-        assert(tmn_is_suspend_enabled());
+        assert(hythread_is_suspend_enabled());
         return struct_Class_to_jclass(clss);
     } else {
         // The JNI spec says that we should throw one of: ClassFormatError,
@@ -730,7 +730,7 @@
 jobject CreateNewThrowable(JNIEnv* jenv, Class* clazz, 
                            const char * message, jthrowable cause = 0)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 
     if (!clazz) {
         return NULL;
@@ -773,7 +773,7 @@
         initArgs[1].l = cause;
         jvalue res;
 
-        assert(tmn_is_suspend_enabled());
+        assert(hythread_is_suspend_enabled());
         tmn_suspend_disable();
         vm_execute_java_method_array((jmethodID) initCause, &res, initArgs);
         tmn_suspend_enable();

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp Wed Aug 23 09:48:41 2006
@@ -33,7 +33,7 @@
 #include "environment.h"
 #include <string.h>
 #include "properties.h"
-#include "open/thread.h"
+
 #include "port_filepath.h"
 #include "port_dso.h"
 #include <apr_strings.h>

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break.cpp Wed Aug 23 09:48:41 2006
@@ -27,11 +27,15 @@
 #include "environment.h"
 #include "Class.h"
 #include "cxxlog.h"
-#include "open/thread.h"
+
 #include "interpreter_exports.h"
 #include "interpreter_imports.h"
 #include "suspend_checker.h"
 
+
+#include "open/jthread.h"
+#include "open/hythread_ext.h"
+
 // Called when current thread reached breakpoint.
 // Returns breakpoint ID received from executing engine on creating of the
 // breakpoint
@@ -41,7 +45,7 @@
     TRACE2("jvmti-break", "BREAKPOINT occured, location = " << location);
     NativeObjectHandles handles;
     ObjectHandle hThread = oh_allocate_local_handle();
-    hThread->object = (Java_java_lang_Thread *)p_TLS_vmthread->p_java_lang_thread;
+    hThread->object = (Java_java_lang_Thread *)jthread_get_java_thread(hythread_self())->object;
     tmn_suspend_enable();
 
     // FIXME: lock breakpoint table
@@ -76,7 +80,7 @@
             NULL != et; et = next_et)
         {
             next_et = et->next;
-            if (et->thread == p_TLS_vmthread)
+            if (et->thread == hythread_self())
             {
                 jvmtiEventBreakpoint func = (jvmtiEventBreakpoint)env->get_event_callback(JVMTI_EVENT_BREAKPOINT);
                 if (NULL != func)

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp Wed Aug 23 09:48:41 2006
@@ -33,7 +33,7 @@
 #include "vm_strings.h"
 #include "environment.h"
 #include "classloader.h"
-#include "open/thread.h"
+
 #include "suspend_checker.h"
 
 /*
@@ -54,7 +54,7 @@
 static inline Class* get_class_from_handle(jvmtiEnv* UNREF env, jvmtiPhase UNREF phase_mask,
                                            jclass handle, void* p1, void *p2, jvmtiError* errorCode)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 
     if (NULL == handle || p1 == NULL || p2 == NULL)
     {

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp Wed Aug 23 09:48:41 2006
@@ -27,12 +27,11 @@
 #include "jvmti_direct.h"
 #include "jvmti_internal.h"
 #include "jvmti_utils.h"
-#include "thread_generic.h"
 #include "environment.h"
 #include "interpreter_exports.h"
 #include "interpreter_imports.h"
 #include "classloader.h"
-#include "open/thread.h"
+#include "open/jthread.h"
 #include "suspend_checker.h"
 #include "jit_intf_cpp.h"
 #include "vm_log.h"
@@ -76,8 +75,8 @@
 jvmtiError add_event_to_thread(jvmtiEnv *env, jvmtiEvent event_type, jthread event_thread)
 {
     TIEnv *p_env = (TIEnv *)env;
-    JNIEnv *jni_env = jni_native_intf;
-    VM_thread *p_thread = get_vm_thread_ptr_safe(jni_env, event_thread);
+    //JNIEnv *jni_env = jni_native_intf;
+    hythread_t p_thread = jthread_get_native_thread(event_thread);
     TIEventThread *et = p_env->event_threads[event_type - JVMTI_MIN_EVENT_TYPE_VAL];
 
     // Find out if this environment is already registered on this thread on this event type
@@ -103,8 +102,8 @@
 void remove_event_from_thread(jvmtiEnv *env, jvmtiEvent event_type, jthread event_thread)
 {
     TIEnv *p_env = (TIEnv *)env;
-    JNIEnv *jni_env = jni_native_intf;
-    VM_thread *p_thread = get_vm_thread_ptr_safe(jni_env, event_thread);
+   // JNIEnv *jni_env = jni_native_intf;
+    hythread_t p_thread = jthread_get_native_thread(event_thread);
     TIEventThread *et = p_env->event_threads[event_type - JVMTI_MIN_EVENT_TYPE_VAL];
 
     if (NULL == et)
@@ -199,7 +198,9 @@
         if (!is_valid_thread_object(event_thread))
             return JVMTI_ERROR_INVALID_THREAD;
 
-        jint thread_state = thread_get_thread_state(event_thread);
+        jint thread_state;
+        IDATA UNUSED status = jthread_get_state(event_thread, &thread_state);
+        assert(status == TM_ERROR_NONE);
 
         if (!(thread_state & JVMTI_THREAD_STATE_ALIVE))
             return JVMTI_ERROR_THREAD_NOT_ALIVE;
@@ -352,7 +353,7 @@
 
 void jvmti_send_vm_init_event(Global_Env *env)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     // Switch phase to VM_Live event
     DebugUtilsTI *ti = env->TI;
     if (!ti->isEnabled())
@@ -362,7 +363,7 @@
     ti->nextPhase(JVMTI_PHASE_LIVE);
     tmn_suspend_disable();
     ObjectHandle hThread = oh_allocate_local_handle();
-    hThread->object = (Java_java_lang_Thread *)p_TLS_vmthread->p_java_lang_thread;
+    hThread->object = (Java_java_lang_Thread *)jthread_get_java_thread(hythread_self())->object;
     tmn_suspend_enable();
     // Send VM_INIT TI events
     TIEnv *ti_env = ti->getEnvironments();
@@ -383,7 +384,7 @@
         }
         ti_env = next_env;
     }
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     oh_discard_local_handle(hThread);
 }
 
@@ -583,7 +584,8 @@
         return;
 
     jvmtiEvent event_type = JVMTI_EVENT_METHOD_ENTRY;
-    VM_thread *curr_thread = p_TLS_vmthread;
+    hythread_t curr_thread = hythread_self();
+
     TIEnv *ti_env = ti->getEnvironments();
     TIEnv *next_env;
     while (NULL != ti_env)
@@ -631,7 +633,8 @@
         return;
 
     jvmtiEvent event_type = JVMTI_EVENT_METHOD_EXIT;
-    VM_thread *curr_thread = p_TLS_vmthread;
+    hythread_t curr_native_thread = hythread_self();
+
     TIEnv *ti_env = ti->getEnvironments();
     TIEnv *next_env;
     while (NULL != ti_env)
@@ -640,10 +643,8 @@
         // check that event is enabled in this environment.
         if (!ti_env->global_events[event_type - JVMTI_MIN_EVENT_TYPE_VAL]) {
             TIEventThread *thr = ti_env->event_threads[event_type - JVMTI_MIN_EVENT_TYPE_VAL];
-            while (thr)
-            {
-                if (thr->thread == curr_thread)
-                    break;
+            while (thr) {
+                if (thr->thread == curr_native_thread) break;
                 thr = thr->next;
             }
 
@@ -667,9 +668,10 @@
     if (interpreter_enabled())
         return;
 
+
     if (!ti->get_global_capability(DebugUtilsTI::TI_GC_ENABLE_FRAME_POP_NOTIFICATION))
         return;
-
+    VM_thread *curr_thread = p_TLS_vmthread;
     jvmti_frame_pop_listener *fpl = curr_thread->frame_pop_listener;
     jvmti_frame_pop_listener **prev_fpl = &curr_thread->frame_pop_listener;
     jint skip = 0;
@@ -722,7 +724,8 @@
         return;
 
     jvmtiEvent event_type = JVMTI_EVENT_SINGLE_STEP;
-    VM_thread *curr_thread = p_TLS_vmthread;
+    hythread_t curr_thread = hythread_self();
+
     TIEnv *ti_env = ti->getEnvironments();
     TIEnv *next_env;
     while (NULL != ti_env)
@@ -764,20 +767,20 @@
     Method *catch_method, jlocation catch_location)
 {
     assert(!exn_raised());
-    assert(!tmn_is_suspend_enabled());
-
-    DebugUtilsTI *ti = VM_Global_State::loader_env->TI;
-    assert(ti->isEnabled());
+    assert(!hythread_is_suspend_enabled());
 
     VM_thread *curr_thread = p_TLS_vmthread;
-
+    hythread_t curr_native_thread=hythread_self();
     curr_thread->ti_exception_callback_pending = false;
 
+    DebugUtilsTI *ti = VM_Global_State::loader_env->TI;
+    assert(ti->isEnabled());
+
     // Create local handles frame
     JNIEnv *jni_env = (JNIEnv *)jni_native_intf;
 
     ObjectHandle hThread = oh_allocate_local_handle();
-    hThread->object = (Java_java_lang_Thread *)curr_thread->p_java_lang_thread;
+    hThread->object = (Java_java_lang_Thread *)jthread_get_java_thread(curr_native_thread)->object;
 
     TIEnv *ti_env = ti->getEnvironments();
     TIEnv *next_env;
@@ -790,10 +793,9 @@
             TIEventThread *thr =
                 ti_env->event_threads[JVMTI_EVENT_EXCEPTION -
                 JVMTI_MIN_EVENT_TYPE_VAL];
-
             while (thr)
             {
-                if (thr->thread == curr_thread)
+                if (thr->thread == curr_native_thread)
                     break;
                 thr = thr->next;
             }
@@ -809,7 +811,7 @@
         if (NULL != func) {
 
             tmn_suspend_enable();
-            assert(tmn_is_suspend_enabled());
+            assert(hythread_is_suspend_enabled());
 
             func((jvmtiEnv *)ti_env, jni_env,
                 reinterpret_cast<jthread>(hThread),
@@ -857,7 +859,7 @@
 
     jvmti_send_exception_event(exn_object, method, location,
         catch_method, catch_location);
-    assert(!tmn_is_suspend_enabled());
+    assert(!hythread_is_suspend_enabled());
 
     if (!exn_raised())
         set_current_thread_exception(exn_object->object);
@@ -921,60 +923,13 @@
     jvmti_send_exception_event(exception, method, location,
         catch_method, catch_location);
 
-    assert(!tmn_is_suspend_enabled());
+    assert(!hythread_is_suspend_enabled());
     return exception->object;
 }
 
-void jvmti_send_contended_enter_or_entered_monitor_event(jobject obj,
-    bool isEnter)
-{
-    assert(tmn_is_suspend_enabled());
-    DebugUtilsTI *ti = VM_Global_State::loader_env->TI;
-    if (!ti->isEnabled()) {
-        return;
-    }
-
-    JNIEnv *jni_env = (JNIEnv *)jni_native_intf;
-
-    tmn_suspend_disable();
-    // Create local handles frame
-    NativeObjectHandles lhs;
-    ObjectHandle hThread = oh_allocate_local_handle();
-    hThread->object = (Java_java_lang_Thread *)p_TLS_vmthread->p_java_lang_thread;
-    tmn_suspend_enable();
-
-    TIEnv *ti_env = ti->getEnvironments();
-    TIEnv *next_env;
-    while (NULL != ti_env)
-    {
-        next_env = ti_env->next;
-        if (isEnter && ti_env->global_events[JVMTI_EVENT_MONITOR_CONTENDED_ENTER - 
-                JVMTI_MIN_EVENT_TYPE_VAL])
-        {
-            jvmtiEventMonitorContendedEnter func = (jvmtiEventMonitorContendedEnter)
-                ti_env->get_event_callback(JVMTI_EVENT_MONITOR_CONTENDED_ENTER);
-            if (NULL != func)
-            {
-                func((jvmtiEnv*)ti_env, jni_env, (jthread)hThread, obj);
-            }
-        }
-        else if (! isEnter && ti_env->global_events[JVMTI_EVENT_MONITOR_CONTENDED_ENTERED -
-                JVMTI_MIN_EVENT_TYPE_VAL])
-        {
-            jvmtiEventMonitorContendedEntered func = (jvmtiEventMonitorContendedEntered)
-                ti_env->get_event_callback(JVMTI_EVENT_MONITOR_CONTENDED_ENTERED);
-            if (NULL != func)
-            {
-                func((jvmtiEnv*)ti_env, jni_env, (jthread)hThread, obj);
-            }
-        }
-        ti_env = next_env;
-    }
-}
-
 void jvmti_send_class_load_event(const Global_Env* env, Class* clss)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if( clss->is_array || clss->is_primitive ) {
         // array class creation and creation of a primitive class
         // do not generate a class load event.
@@ -995,7 +950,7 @@
     tmn_suspend_disable();
     ObjectHandle hThread = oh_allocate_local_handle();
     ObjectHandle hClass = oh_allocate_local_handle();
-    hThread->object = (Java_java_lang_Thread *)p_TLS_vmthread->p_java_lang_thread;
+    hThread->object = (Java_java_lang_Thread *)jthread_get_java_thread(hythread_self())->object;
     hClass->object = struct_Class_to_java_lang_Class(clss);
     tmn_suspend_enable();
 
@@ -1020,12 +975,12 @@
             // fire local events
             for( TIEventThread* ti_et = ti_env->event_threads[JVMTI_EVENT_CLASS_LOAD - JVMTI_MIN_EVENT_TYPE_VAL];
                  ti_et != NULL; ti_et = ti_et->next )
-                if (ti_et->thread == p_TLS_vmthread)
+                if (ti_et->thread == hythread_self())
                 {
                     TRACE2("jvmti.class.cl", "Class load event, class name = " << clss->name->bytes);
                     tmn_suspend_disable();
                     ObjectHandle hThreadLocal = oh_allocate_local_handle();
-                    hThreadLocal->object = (Java_java_lang_Thread *)ti_et->thread->p_java_lang_thread;
+                    hThreadLocal->object = (Java_java_lang_Thread *)jthread_get_java_thread(ti_et->thread)->object;
                     tmn_suspend_enable();
                     func((jvmtiEnv *)ti_env, jni_env, (jthread)hThreadLocal, (jclass)hClass);
                     oh_discard_local_handle( hThreadLocal );
@@ -1044,7 +999,7 @@
     int classlen, unsigned char* classbytes,
     int* newclasslen, unsigned char** newclass)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     // Send Class Load event
     DebugUtilsTI* ti = env->TI;
     if (!ti->isEnabled())
@@ -1091,7 +1046,7 @@
             // fire local events
             for( TIEventThread* ti_et = ti_env->event_threads[JVMTI_EVENT_CLASS_FILE_LOAD_HOOK - JVMTI_MIN_EVENT_TYPE_VAL];
                  ti_et != NULL; ti_et = ti_et->next )
-                if (ti_et->thread == p_TLS_vmthread)
+                if (ti_et->thread == hythread_self())
                 {
                     // free memory from previous redefinition
                     if( last_redef && last_redef != input_class ) {
@@ -1118,7 +1073,7 @@
 
 void jvmti_send_class_prepare_event(Class* clss)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if( clss->is_array || clss->is_primitive ) {
         // class prepare events are not generated for primitive classes
         // and arrays
@@ -1139,7 +1094,7 @@
     tmn_suspend_disable(); // -----------vv
     ObjectHandle hThread = oh_allocate_local_handle();
     ObjectHandle hClass = oh_allocate_local_handle();
-    hThread->object = (Java_java_lang_Thread *)p_TLS_vmthread->p_java_lang_thread;
+    hThread->object = (Java_java_lang_Thread *)jthread_get_java_thread(hythread_self())->object;
     hClass->object = struct_Class_to_java_lang_Class(clss);
     tmn_suspend_enable(); // ------------^^
 
@@ -1164,12 +1119,12 @@
             // fire local events
             for(TIEventThread* ti_et = ti_env->event_threads[JVMTI_EVENT_CLASS_PREPARE - JVMTI_MIN_EVENT_TYPE_VAL];
                 ti_et != NULL; ti_et = ti_et->next )
-                if (ti_et->thread == p_TLS_vmthread)
+                if (ti_et->thread == hythread_self())
                 {
                     TRACE2("jvmti.class.cp", "Class prepare event, class name = " << clss->name->bytes);
                     tmn_suspend_disable(); // -------------------------------vv
                     ObjectHandle hThreadLocal = oh_allocate_local_handle();
-                    hThreadLocal->object = (Java_java_lang_Thread *)ti_et->thread->p_java_lang_thread;
+                    hThreadLocal->object = (Java_java_lang_Thread *)jthread_get_java_thread(hythread_self())->object;
                     tmn_suspend_enable(); // --------------------------------^^
                     func((jvmtiEnv *)ti_env, jni_env, (jthread)hThreadLocal, (jclass)hClass);
                     oh_discard_local_handle( hThreadLocal );
@@ -1179,47 +1134,105 @@
     }
     oh_discard_local_handle(hThread);
     oh_discard_local_handle(hClass);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 }
 
-void jvmti_send_thread_start_end_event(int is_start)
-{
-    assert(tmn_is_suspend_enabled());
+static void call_callback(jvmtiEvent event_type, JNIEnv *jni_env, TIEnv *ti_env, 
+        void *callback_func, va_list args) {
+    assert(hythread_is_suspend_enabled());
+    switch(event_type) {
+        case JVMTI_EVENT_THREAD_START:
+        case JVMTI_EVENT_THREAD_END: {
+            ((jvmtiEventThreadStart)callback_func)((jvmtiEnv*)ti_env, jni_env, 
+                    jthread_get_java_thread(hythread_self()));
+            break;
+        }
+        case JVMTI_EVENT_MONITOR_CONTENDED_ENTER: 
+        case JVMTI_EVENT_MONITOR_CONTENDED_ENTERED: {
+            jobject monitor = va_arg(args, jobject);
+            ((jvmtiEventMonitorContendedEnter) callback_func)((jvmtiEnv*)ti_env, 
+                    jni_env, jthread_get_java_thread(hythread_self()), monitor);
 
-    DebugUtilsTI *ti = VM_Global_State::loader_env->TI;
-    if (! ti->isEnabled()) return;
+            break;
+        }
 
-    JNIEnv *jni_env = (JNIEnv *)jni_native_intf;
+        case JVMTI_EVENT_MONITOR_WAIT: {
+            jobject monitor = va_arg(args, jobject);
+            jlong timeout   = va_arg(args, jlong);
+            ((jvmtiEventMonitorWait)callback_func)((jvmtiEnv*)ti_env, jni_env, 
+                    jthread_get_java_thread(hythread_self()), monitor, timeout);
+            break;
+        }
 
-    tmn_suspend_disable();
-    ObjectHandle hThread = oh_allocate_local_handle();
-    hThread->object = (Java_java_lang_Thread *)p_TLS_vmthread->p_java_lang_thread;
-    tmn_suspend_enable();
+        case JVMTI_EVENT_MONITOR_WAITED: {
+            jobject monitor = va_arg(args, jobject);
+            jboolean is_timed_out   = va_arg(args, jint); //jboolean);
+            ((jvmtiEventMonitorWait)callback_func)((jvmtiEnv*)ti_env, jni_env, 
+                    jthread_get_java_thread(hythread_self()), monitor, is_timed_out);
+            break;
+        }
+        default: 
+            break;
+    }
+    assert(hythread_is_suspend_enabled());
+}
 
-    TIEnv *ti_env = ti->getEnvironments();
-    TIEnv *next_env;
-    while (NULL != ti_env)
-    {
+static int is_interested_thread(TIEnv *ti_env, jvmtiEvent event_type) {
+    for( TIEventThread* ti_et = ti_env->event_threads[event_type - JVMTI_MIN_EVENT_TYPE_VAL];
+            ti_et != NULL; ti_et = ti_et->next) {
+        if (ti_et->thread == hythread_self()) return 1;
+    }
+    
+    return 0;    
+}
+
+static void process_jvmti_event(jvmtiEvent event_type, int per_thread, ...) {
+    va_list args;
+    JNIEnv *jni_env = (JNIEnv *)jni_native_intf;
+    TIEnv *ti_env, *next_env;
+    DebugUtilsTI *ti = VM_Global_State::loader_env->TI;
+    void *callback_func;
+    
+    if (! ti->isEnabled()) return;
+    ti_env = ti->getEnvironments();
+    va_start(args, per_thread);
+    while(ti_env) {
         next_env = ti_env->next;
-        if (is_start && ti_env->global_events[JVMTI_EVENT_THREAD_START - JVMTI_MIN_EVENT_TYPE_VAL])
-        {
-            jvmtiEventThreadStart func = (jvmtiEventThreadStart)ti_env->get_event_callback(JVMTI_EVENT_THREAD_START);
-            if (NULL != func)
-            {
-                func((jvmtiEnv*)ti_env, jni_env, (jthread)hThread);
+        if (!ti_env->global_events[event_type - JVMTI_MIN_EVENT_TYPE_VAL]
+                && (!per_thread || !is_interested_thread(ti_env, event_type))) {
+           ti_env = ti_env->next;
+           continue;   
+            }
+        
+        callback_func = ti_env->get_event_callback(event_type);
+        if (callback_func) call_callback(event_type, jni_env, ti_env, callback_func, args);
+        ti_env = next_env;
             }
+    va_end(args);
+        
         }
-        else if (! is_start && ti_env->global_events[JVMTI_EVENT_THREAD_END - JVMTI_MIN_EVENT_TYPE_VAL])
-        {
-            jvmtiEventThreadEnd func = (jvmtiEventThreadEnd)ti_env->get_event_callback(JVMTI_EVENT_THREAD_END);
-            if (NULL != func)
-            {
-                func((jvmtiEnv*)ti_env, jni_env, (jthread)hThread);
+
+void jvmti_send_thread_start_end_event(int is_start) {
+    is_start ? process_jvmti_event(JVMTI_EVENT_THREAD_START, 0, 0)
+        :process_jvmti_event(JVMTI_EVENT_THREAD_END, 1, 0);
             }
+
+void jvmti_send_wait_monitor_event(jobject monitor, jlong timeout) {
+    TRACE2("jvmti.monitor.wait", "Monitor wait event, monitor = " << monitor);
+    process_jvmti_event(JVMTI_EVENT_MONITOR_WAIT, 1, monitor, timeout);
         }
-        ti_env = next_env;
+
+void jvmti_send_waited_monitor_event(jobject monitor, jboolean is_timed_out) {
+    TRACE2("jvmti.monitor.waited", "Monitor wait event, monitor = " << monitor);
+    process_jvmti_event(JVMTI_EVENT_MONITOR_WAITED, 1, monitor, is_timed_out);
     }
-    assert(tmn_is_suspend_enabled());
+
+
+void jvmti_send_contended_enter_or_entered_monitor_event(jobject monitor,
+    int isEnter) {
+    TRACE2("jvmti.monitor.enter", "Monitor enter event, monitor = " << monitor << " is enter= " << isEnter);
+    (isEnter)?process_jvmti_event(JVMTI_EVENT_MONITOR_CONTENDED_ENTER, 1, monitor)
+            :process_jvmti_event(JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, 1, monitor);
 }
 
 void jvmti_send_vm_death_event()

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_field.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_field.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_field.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_field.cpp Wed Aug 23 09:48:41 2006
@@ -27,7 +27,7 @@
 #include "vm_strings.h"
 #include "jvmti_utils.h"
 #include "cxxlog.h"
-#include "open/thread.h"
+
 #include "suspend_checker.h"
 
 /*

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp Wed Aug 23 09:48:41 2006
@@ -26,7 +26,7 @@
 #include "cxxlog.h"
 
 #include "open/gc.h"
-#include "open/thread.h"
+
 #include "suspend_checker.h"
 
 /*
@@ -108,7 +108,7 @@
 
     CHECK_EVERYTHING();
 
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     // no matter how counter-intuitive,
     // gc_force_gc() expects gc_enabled_status == disabled,
     // but, obviously, at a GC safepoint.

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_locals.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_locals.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_locals.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_locals.cpp Wed Aug 23 09:48:41 2006
@@ -30,7 +30,7 @@
 #include "open/vm_util.h"
 #include "cxxlog.h"
 #include "thread_generic.h"
-#include "open/thread.h"
+#include "open/jthread.h"
 #include "suspend_checker.h"
 #include "stack_iterator.h"
 #include "stack_trace.h"
@@ -113,7 +113,7 @@
     if (si_is_native(si))                                                   \
     {                                                                       \
         if (thread_suspended)                                               \
-            thread_resume(thread);                                          \
+            jthread_resume(thread);                                          \
         si_free(si);                                                        \
         return JVMTI_ERROR_OPAQUE_FRAME;                                    \
     }                                                                       \
@@ -121,7 +121,7 @@
     if (si_is_past_end(si))                                                 \
     {                                                                       \
         if (thread_suspended)                                               \
-            thread_resume(thread);                                          \
+            jthread_resume(thread);                                          \
         si_free(si);                                                        \
         return JVMTI_ERROR_NO_MORE_FRAMES;                                  \
     }                                                                       \
@@ -166,7 +166,7 @@
         vm_thread = get_vm_thread_ptr_safe(jvmti_test_jenv, thread);
         if (vm_thread != p_TLS_vmthread)
         {
-            thread_suspend(thread);
+            jthread_suspend(thread);
             thread_suspended = true;
         }
     }
@@ -202,7 +202,7 @@
     }
 
     if (thread_suspended)
-        thread_resume(thread);
+        jthread_resume(thread);
 
     return err;
 }
@@ -242,7 +242,7 @@
         vm_thread = get_vm_thread_ptr_safe(jvmti_test_jenv, thread);
         if (vm_thread != p_TLS_vmthread)
         {
-            thread_suspend(thread);
+            jthread_suspend(thread);
             thread_suspended = true;
         }
     }
@@ -270,7 +270,7 @@
     }
 
     if (thread_suspended)
-        thread_resume(thread);
+        jthread_resume(thread);
 
     return err;
 }
@@ -310,7 +310,7 @@
         vm_thread = get_vm_thread_ptr_safe(jvmti_test_jenv, thread);
         if (vm_thread != p_TLS_vmthread)
         {
-            thread_suspend(thread);
+            jthread_suspend(thread);
             thread_suspended = true;
         }
     }
@@ -338,7 +338,7 @@
     }
 
     if (thread_suspended)
-        thread_resume(thread);
+        jthread_resume(thread);
 
     return err;
 }
@@ -423,7 +423,7 @@
         vm_thread = get_vm_thread_ptr_safe(jvmti_test_jenv, thread);
         if (vm_thread != p_TLS_vmthread)
         {
-            thread_suspend(thread);
+            jthread_suspend(thread);
             thread_suspended = true;
         }
     }
@@ -459,7 +459,7 @@
     }
 
     if (thread_suspended)
-        thread_resume(thread);
+        jthread_resume(thread);
 
     return err;
 }
@@ -499,7 +499,7 @@
         vm_thread = get_vm_thread_ptr_safe(jvmti_test_jenv, thread);
         if (vm_thread != p_TLS_vmthread)
         {
-            thread_suspend(thread);
+            jthread_suspend(thread);
             thread_suspended = true;
         }
     }
@@ -527,7 +527,7 @@
     }
 
     if (thread_suspended)
-        thread_resume(thread);
+        jthread_resume(thread);
 
     return err;
 }
@@ -567,7 +567,7 @@
         vm_thread = get_vm_thread_ptr_safe(jvmti_test_jenv, thread);
         if (vm_thread != p_TLS_vmthread)
         {
-            thread_suspend(thread);
+            jthread_suspend(thread);
             thread_suspended = true;
         }
     }
@@ -595,7 +595,7 @@
     }
 
     if (thread_suspended)
-        thread_resume(thread);
+        jthread_resume(thread);
 
     return err;
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_method.cpp Wed Aug 23 09:48:41 2006
@@ -29,7 +29,7 @@
 #include "object_handles.h"
 #include "jvmti_utils.h"
 #include "cxxlog.h"
-#include "open/thread.h"
+
 #include "jvmti_interface.h"
 #include "suspend_checker.h"
 #include "jvmti_internal.h"

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_object.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_object.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_object.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_object.cpp Wed Aug 23 09:48:41 2006
@@ -27,7 +27,7 @@
 #include "object_handles.h"
 #include "object_generic.h"
 #include "mon_enter_exit.h"
-#include "open/thread.h"
+
 #include "thread_manager.h"
 #include "suspend_checker.h"
 #include "open/vm.h"
@@ -144,6 +144,7 @@
     /*
      * Check given env & current phase.
      */
+    
     jvmtiPhase phases[] = {JVMTI_PHASE_LIVE};
     CHECK_EVERYTHING();
     CHECK_CAPABILITY(can_get_monitor_info);
@@ -153,63 +154,67 @@
     if (NULL == info_ptr)
         return JVMTI_ERROR_NULL_POINTER;
 
-    ManagedObject * obj;
     int enter_wait_count = 0;
     int notify_wait_count = 0;
-    tm_iterator_t * iterator = tm_iterator_create();
-    VM_thread *thread = tm_iterator_next(iterator);
+    jthread_iterator_t  iterator = jthread_iterator_create();
+    jthread thread = jthread_iterator_next(&iterator);
+    jobject monitor = NULL;
     assert(thread);
     while (thread)
     {
-        obj = mon_enter_array[thread->thread_index].p_obj;
-        if (obj == object->object)
+        jthread_get_contended_monitor(thread, &monitor);
+        if (monitor && monitor->object == object->object)
             enter_wait_count++;
-        obj = mon_wait_array[thread->thread_index].p_obj;
-        if (obj == object->object)
+        jthread_get_wait_monitor(thread, &monitor);
+        if (monitor && monitor->object == object->object)
             notify_wait_count++;
-        thread = tm_iterator_next(iterator);
+        
+        thread = jthread_iterator_next(&iterator);
     }
 
     jthread* enter_wait_array = NULL;
-    jvmtiError jvmti_error = _allocate(sizeof(jthread*) *
-            enter_wait_count, (unsigned char **)&enter_wait_array);
-    if (JVMTI_ERROR_NONE != jvmti_error)
-    {
-        tm_iterator_release(iterator);
-        return jvmti_error;
-    }
+ 	if (enter_wait_count > 0){
+		jvmtiError jvmti_error = _allocate(sizeof(jthread*) *
+				enter_wait_count, (unsigned char **)&enter_wait_array);
+		if (JVMTI_ERROR_NONE != jvmti_error)
+		{
+			jthread_iterator_release(&iterator);
+			return jvmti_error;
+		}
+	}
 
     jthread* notify_wait_array = NULL;
-    jvmti_error = _allocate(sizeof(jthread*) *
-            notify_wait_count, (unsigned char **)&notify_wait_array);
-    if (JVMTI_ERROR_NONE != jvmti_error)
-    {
-        tm_iterator_release(iterator);
-        return jvmti_error;
-    }
+	if (notify_wait_count > 0){
+		jvmtiError jvmti_error = _allocate(sizeof(jthread*) *
+				notify_wait_count, (unsigned char **)&notify_wait_array);
+		if (JVMTI_ERROR_NONE != jvmti_error)
+		{
+			jthread_iterator_release(&iterator);
+			return jvmti_error;
+		}
+	}
 
-    extern jobject get_jobject(VM_thread * thread);
     int ii = 0, jj = 0;
-    int stack_key = STACK_KEY(object->object);
     info_ptr->owner = NULL;
 
-    tm_iterator_reset(iterator);
-    thread = tm_iterator_next(iterator);
+    jthread_iterator_reset(&iterator);
+    thread = jthread_iterator_next(&iterator);
     while (thread)
     {
-        if (stack_key == thread->thread_index)
-            info_ptr->owner = get_jobject(thread);
-        obj = mon_enter_array[thread->thread_index].p_obj;
-        if (obj == object->object)
-            enter_wait_array[ii++] = get_jobject(thread);
-        obj = mon_wait_array[thread->thread_index].p_obj;
-        if (obj == object->object)
-            notify_wait_array[jj++] = get_jobject(thread);
-        thread = tm_iterator_next(iterator);
+        jthread_get_contended_monitor(thread, &monitor);
+        if (monitor && monitor->object == object->object)
+            enter_wait_array[ii++] = thread;
+        
+        jthread_get_wait_monitor(thread, &monitor);
+        if (monitor && monitor->object == object->object)
+            notify_wait_array[jj++] = thread;
+        
+        thread = jthread_iterator_next(&iterator);
     }
-    tm_iterator_release(iterator);
+    jthread_iterator_release(&iterator);
 
-    info_ptr->entry_count = RECURSION(object->object) + (info_ptr->owner != NULL);
+    jthread_get_lock_owner(object, &info_ptr->owner);
+    info_ptr->entry_count = jthread_get_lock_recursion(object, info_ptr->owner) + 1;
     info_ptr->waiter_count = enter_wait_count;
     info_ptr->waiters = enter_wait_array;
     info_ptr->notify_waiter_count = notify_wait_count;



Mime
View raw message