harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r434076 [13/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/jit/jit_runtime_support.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp Wed Aug 23 09:48:41 2006
@@ -59,7 +59,7 @@
 #include "open/types.h"
 #include "open/bytecodes.h"
 #include "open/vm_util.h"
-#include "open/thread.h"
+
 #include "jvmti_interface.h"
 
 #include "compile.h"
@@ -173,10 +173,10 @@
     } 
     else if (cp_is_class(cp, cp_index)) 
     {
-        assert(!tmn_is_suspend_enabled());
-        tmn_suspend_enable();
+        assert(!hythread_is_suspend_enabled());
+        hythread_suspend_enable();
         Class *objClass = class_resolve_class(c, cp_index); 
-        tmn_suspend_disable();
+        hythread_suspend_disable();
         if (objClass) {
             return struct_Class_to_java_lang_Class(objClass);
         }
@@ -696,7 +696,7 @@
     vm_stats_total.num_is_class_initialized++;
     clss->num_class_init_checks++;
 #endif // VM_STATS
-    assert(!tmn_is_suspend_enabled());
+    assert(!hythread_is_suspend_enabled());
     return clss->state == ST_Initialized;
 } //is_class_initialized
 
@@ -1494,7 +1494,7 @@
     if (addr) {
         return addr;
     }
-    void (*tmn_safe_point_ptr)() = tmn_safe_point;
+    void (*hythread_safe_point_ptr)() = hythread_safe_point;
     LilCodeStub* cs = lil_parse_code_stub("entry 0:managed::void;");
     assert(cs);
     if (dyn_count) {
@@ -1507,7 +1507,7 @@
         "call %0i;"
         "pop_m2n;"
         "ret;",
-        tmn_safe_point_ptr);
+        hythread_safe_point_ptr);
     assert(cs && lil_is_valid(cs));
     addr = LilCodeGenerator::get_platform()->compile(cs, "rth_gc_safe_point", dump_stubs);
     lil_free_code_stub(cs);
@@ -1515,7 +1515,7 @@
 }
 
 static NativeCodePtr rth_get_lil_gc_thread_suspend_flag_ptr(int * dyn_count) {
-    static NativeCodePtr addr = NULL;
+    /*static NativeCodePtr addr = NULL;
     if (addr) {
         return addr;
     }
@@ -1536,7 +1536,9 @@
     addr = LilCodeGenerator::get_platform()->compile(cs, 
                         "rth_get_lil_gc_thread_suspend_flag_ptr", dump_stubs);
     lil_free_code_stub(cs);
-    return addr;
+    */
+    //assert(0);
+    return (NativeCodePtr)hythread_self;
 }
 
 static void * rth_resolve(Class_Handle klass, unsigned cp_idx,
@@ -1548,7 +1550,7 @@
     Compile_Handle ch = (Compile_Handle)&comp_handle;
     
     void * ret = NULL;
-    tmn_suspend_enable();
+    hythread_suspend_enable();
     switch(opcode) {
     case OPCODE_INVOKEINTERFACE:
         ret = resolve_interface_method(ch, klass, cp_idx);
@@ -1582,7 +1584,7 @@
                                    opcode == OPCODE_PUTSTATIC);
         if (ret != NULL) {
             Class_Handle that_class = method_get_class((Method_Handle)ret);
-            tmn_suspend_disable();
+            hythread_suspend_disable();
             if (class_needs_initialization(that_class)) {
                 assert(!exn_raised());
                 class_initialize_ex(that_class);
@@ -1594,7 +1596,7 @@
         ret = resolve_static_method(ch, klass, cp_idx);
         if (ret != NULL) {
             Class_Handle that_class = method_get_class((Method_Handle)ret);
-            tmn_suspend_disable();
+            hythread_suspend_disable();
             if (class_needs_initialization(that_class)) {
                 assert(!exn_raised());
                 class_initialize_ex(that_class);
@@ -1605,7 +1607,7 @@
     default:    assert(false);
     } // ~switch(opcode)
     
-    tmn_suspend_disable();
+    hythread_suspend_disable();
     if (ret == NULL) {
         class_throw_linking_error(klass, cp_idx, opcode);
         assert(false); // must be unreachanble
@@ -1831,7 +1833,7 @@
  */
 void *vm_malloc_with_thread_pointer(
         unsigned size, Allocation_Handle ah, void *tp) {
-    assert(!tmn_is_suspend_enabled());
+    assert(!hythread_is_suspend_enabled());
     void *result = gc_alloc(size,ah,tp);
     if (!result) {
         exn_throw(VM_Global_State::loader_env->java_lang_OutOfMemoryError);
@@ -1851,8 +1853,8 @@
 
 ManagedObject *class_alloc_new_object(Class *c)
 {
-    assert(!tmn_is_suspend_enabled());
-    //tmn_suspend_disable();
+    assert(!hythread_is_suspend_enabled());
+    //hythread_suspend_disable();
     assert(strcmp(c->name->bytes, "java/lang/Class")); 
 #ifdef VM_STATS
     vm_stats_total.num_class_alloc_new_object++;
@@ -1865,17 +1867,17 @@
     if (!o) {
         exn_throw(
             VM_Global_State::loader_env->java_lang_OutOfMemoryError);
-        //tmn_suspend_enable();
+        //hythread_suspend_enable();
         return 0; // whether this return is reached or not is solved via is_unwindable state
     }
-     //tmn_suspend_enable();
+     //hythread_suspend_enable();
      return o;
 } //class_alloc_new_object
 
 
 ManagedObject *class_alloc_new_object_using_vtable(VTable *vtable)
 {
-    assert(!tmn_is_suspend_enabled());
+    assert(!hythread_is_suspend_enabled());
     assert(strcmp(vtable->clss->name->bytes, "java/lang/Class")); 
 #ifdef VM_STATS
     vm_stats_total.num_class_alloc_new_object++;
@@ -1909,7 +1911,7 @@
                                            Method *constructor,
                                            uint8 *constructor_args)
 {
-    assert(!tmn_is_suspend_enabled());
+    assert(!hythread_is_suspend_enabled());
     assert(strcmp(clss->name->bytes, "java/lang/Class"));
  
     ObjectHandle obj = oh_allocate_local_handle();
@@ -1993,7 +1995,7 @@
         arg_num++;
         assert(arg_num <= num_args_estimate);
     }
-    assert(!tmn_is_suspend_enabled());
+    assert(!hythread_is_suspend_enabled());
     vm_execute_java_method_array((jmethodID) constructor, 0, args);
     
     if (exn_raised()) {
@@ -2520,7 +2522,7 @@
 VMEXPORT // temporary solution for interpreter unplug
 int __stdcall vm_instanceof(ManagedObject *obj, Class *c)
 {
-    assert(!tmn_is_suspend_enabled());
+    assert(!hythread_is_suspend_enabled());
 
 #ifdef VM_STATS
     vm_stats_total.num_instanceof++;
@@ -2680,13 +2682,13 @@
         "entry 0:stdcall:pint:pint;"    // the single argument is 'void*'
         "push_m2n 0, 0;"                // create m2n frame
         "out stdcall::void;"
-        "call %0i;"                     // call tmn_suspend_enable()
-        "in2out stdcall:pint;"          // reload input arg into output
+        "call %0i;"                     // call hythread_suspend_enable()
+        "in2out stdcall:pint;"          // reloads input arg into output
         "call %1i;"                     // call the foo
         "locals 2;"                     //
         "l0 = r;"                       // save result
         "out stdcall::void;"
-        "call %2i;"                     // call tmn_suspen_disable()
+        "call %2i;"                     // call hythread_suspend_disable()
         "l1 = ts;"
         "ld l1, [l1 + %3i:ref];"
         "jc l1 != 0,_exn_raised;"          // test whether an exception happened
@@ -2698,8 +2700,8 @@
         "call.noret %4i;";              // re-throw exception
 
     void * fptr_rethrow = (void*)&rethrow_current_thread_exception;
-    void * fptr_suspend_enable = (void*)&tmn_suspend_enable;
-    void * fptr_suspend_disable = (void*)&tmn_suspend_disable;
+    void * fptr_suspend_enable = (void*)&hythread_suspend_enable;
+    void * fptr_suspend_disable = (void*)&hythread_suspend_disable;
 
     LilCodeStub* cs = lil_parse_code_stub(
         lil_stub,

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp Wed Aug 23 09:48:41 2006
@@ -32,7 +32,8 @@
 #include "open/types.h"
 #include "open/vm_util.h"
 #include "vm_threads.h"
-#include "open/thread.h"
+#include "open/jthread.h"
+
 #include "vm_synch.h"
 #include "exceptions.h"
 #include "reflection.h"
@@ -376,7 +377,7 @@
                            jsize len)
 {
     TRACE2("jni", "DefineClass called, name = " << name);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Global_Env* env = VM_Global_State::loader_env;
     ClassLoader* cl;
     if (loader != NULL)
@@ -404,7 +405,7 @@
 
     if(clss && ld_result)
     {
-        assert(tmn_is_suspend_enabled());
+        assert(hythread_is_suspend_enabled());
         return struct_Class_to_jclass(clss);
     }
     else
@@ -431,6 +432,7 @@
 jclass JNICALL FindClass(JNIEnv* env_ext,
                          const char* name)
 {
+    if (exn_raised()) return NULL;
     TRACE2("jni", "FindClass called, name = " << name);
 
     char *ch = strchr(name, '.');
@@ -442,12 +444,13 @@
 
     String* cls_name = VM_Global_State::loader_env->string_pool.lookup(name);
     return FindClass(env_ext, cls_name);
+    
 } //FindClass
 
 jclass JNICALL GetSuperclass(JNIEnv * UNREF env, jclass clazz)
 {
     TRACE2("jni", "GetSuperclass called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class* clss = jclass_to_struct_Class(clazz);
     if(clss) {
         if(class_is_interface(clss)) {
@@ -455,7 +458,7 @@
         } else {
             Class *super_class = clss->super_class;
             if(super_class) {
-                assert(tmn_is_suspend_enabled());
+                assert(hythread_is_suspend_enabled());
                 return struct_Class_to_jclass(super_class);
             } else {
                 return 0;
@@ -471,7 +474,7 @@
                                   jclass clazz2)
 {
     TRACE2("jni", "IsAssignableFrom called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class* clss1 = jclass_to_struct_Class(clazz1);
     Class* clss2 = jclass_to_struct_Class(clazz2);
 
@@ -486,7 +489,7 @@
 jint JNICALL Throw(JNIEnv * UNREF env, jthrowable obj)
 {
     TRACE2("jni", "Throw called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if(obj) {
         tmn_suspend_disable();       //---------------------------------v
         set_current_thread_exception(((ObjectHandle)obj)->object);
@@ -500,7 +503,7 @@
 jint JNICALL ThrowNew(JNIEnv *env, jclass clazz, const char *message)
 {
     TRACE2("jni", "ThrowNew called, message = " << (message ? message : "<no message>"));
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if (!clazz) return -1;
 
     jstring str = (jstring)0;
@@ -544,7 +547,7 @@
 jthrowable JNICALL ExceptionOccurred(JNIEnv * UNREF env)
 {
     TRACE2("jni", "ExceptionOccurred called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 #ifdef _DEBUG
     tmn_suspend_disable();
     ManagedObject *obj = get_current_thread_exception();
@@ -569,7 +572,7 @@
 void JNICALL ExceptionDescribe(JNIEnv * UNREF env)
 {
     TRACE2("jni", "ExceptionDescribe called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if (exn_raised()) {
         tmn_suspend_disable();       //---------------------------------v
         ManagedObject* exn = get_current_thread_exception();
@@ -583,7 +586,7 @@
 void JNICALL ExceptionClear(JNIEnv * UNREF env)
 {
     TRACE2("jni", "ExceptionClear called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     tmn_suspend_disable();
 #ifdef _DEBUG
     ManagedObject *obj = get_current_thread_exception();
@@ -603,7 +606,7 @@
 void JNICALL FatalError(JNIEnv * UNREF env, const char *msg)
 {
     TRACE2("jni", "FatalError called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     fprintf(stderr, "\nFATAL error occurred in a JNI native method:\n\t%s\n", msg);
     vm_exit(109);
 } //FatalError
@@ -611,12 +614,12 @@
 jobject JNICALL NewGlobalRef(JNIEnv * UNREF env, jobject obj)
 {
     TRACE2("jni", "NewGlobalRef called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if(!obj) {
         return 0;
     }
 
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle new_handle = oh_allocate_global_handle();
     ObjectHandle old_handle = (ObjectHandle)obj;
 
@@ -633,7 +636,7 @@
 void JNICALL DeleteGlobalRef(JNIEnv * UNREF env, jobject globalRef)
 {
     TRACE2("jni", "DeleteGlobalRef called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 #ifdef _DEBUG
     tmn_suspend_disable();
     ObjectHandle h = (ObjectHandle)globalRef;
@@ -648,7 +651,7 @@
 jobject JNICALL NewLocalRef(JNIEnv *env, jobject ref)
 {
     TRACE2("jni", "NewLocalRef called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if (NULL == ref)
         return NULL;
 
@@ -671,7 +674,7 @@
 void JNICALL DeleteLocalRef(JNIEnv * UNREF env, jobject localRef)
 {
     TRACE2("jni", "DeleteLocalRef called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 #ifdef _DEBUG
     tmn_suspend_disable();
     ObjectHandle h = (ObjectHandle)localRef;
@@ -688,7 +691,7 @@
                               jobject ref2)
 {
     TRACE2("jni-same", "IsSameObject called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if(ref1 == ref2) {
         return JNI_TRUE;
     }
@@ -718,7 +721,7 @@
 VMEXPORT jint JNICALL PushLocalFrame(JNIEnv * UNREF env, jint UNREF cap)
 {
     TRACE2("jni", "PushLocalFrame called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     // 20020904: Not good for performance, but we can ignore local frames for now
     return 0;
 }
@@ -726,7 +729,7 @@
 VMEXPORT jobject JNICALL PopLocalFrame(JNIEnv * UNREF env, jobject res)
 {
     TRACE2("jni", "PopLocalFrame called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     // 20020904: Not good for performance, but we can ignore local frames for now
     return res;
 }
@@ -735,7 +738,7 @@
 jint JNICALL EnsureLocalCapacity(JNIEnv* UNREF env, jint UNREF cap)
 {
     TRACE2("jni", "EnsureLocalCapacity called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     return 0;
 }
 
@@ -744,7 +747,7 @@
                             jclass clazz)
 {
     TRACE2("jni", "AllocObject called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     assert(clazz);
     Class* clss = jclass_to_struct_Class(clazz);
 
@@ -776,7 +779,7 @@
                           ...)
 {
     TRACE2("jni", "NewObject called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     va_list args;
     va_start(args, methodID);
     return NewObjectV(env, clazz, methodID, args);
@@ -788,7 +791,7 @@
                            va_list args)
 {
     TRACE2("jni", "NewObjectV called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jvalue *jvalue_args = get_jvalue_arg_array((Method *)methodID, args);
     jobject result = NewObjectA(env, clazz, methodID, jvalue_args);
     STD_FREE(jvalue_args);
@@ -801,7 +804,7 @@
                            jvalue *args)
 {
     TRACE2("jni", "NewObjectA called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     // Allocate the object.
     jobject new_handle = AllocObject(env, clazz);
 
@@ -821,7 +824,7 @@
                               jobject obj)
 {
     TRACE2("jni", "GetObjectClass called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     // The spec guarantees that the reference is not null.
     assert(obj);
     ObjectHandle h = (ObjectHandle)obj;
@@ -845,7 +848,7 @@
                               jclass clazz)
 {
     TRACE2("jni", "IsInstanceOf called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if(!obj) {
         return JNI_TRUE;
     }
@@ -869,7 +872,7 @@
                           jsize length)
 {
     TRACE2("jni", "NewString called, length = " << length);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     return (jstring)string_create_from_unicode_h(unicodeChars, length);
 } //NewString
 
@@ -877,7 +880,7 @@
                               jstring string)
 {
     TRACE2("jni", "GetStringLength called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if(!string) return 0;
     return string_get_length_h((ObjectHandle)string);
 } //GetStringLength
@@ -887,7 +890,7 @@
                                     jboolean *isCopy)
 {
     TRACE2("jni", "GetStringChars called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     assert(string);
 
     tmn_suspend_disable();
@@ -903,7 +906,7 @@
                                 const jchar *chars)
 {
     TRACE2("jni", "ReleaseStringChars called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     STD_FREE((void*)chars);
 } //ReleaseStringChars
 
@@ -911,7 +914,7 @@
                              const char *bytes)
 {
     TRACE2("jni", "NewStringUTF called, bytes = " << bytes);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     return (jstring)string_create_from_utf8_h(bytes, (unsigned)strlen(bytes));
 } //NewStringUTF
 
@@ -919,7 +922,7 @@
                                  jstring string)
 {
     TRACE2("jni", "GetStringUTFLength called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     return string_get_utf8_length_h((ObjectHandle)string);
 } //GetStringUTFLength
 
@@ -928,7 +931,7 @@
                                       jboolean *isCopy)
 {
     TRACE2("jni", "GetStringUTFChars called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if(!string)
         return 0;
     const char* res = string_get_utf8_chars_h((ObjectHandle)string);
@@ -941,7 +944,7 @@
                                    const char *utf)
 {
     TRACE2("jni", "ReleaseStringUTFChars called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     STD_FREE((void*)utf);
 } //ReleaseStringUTFChars
 
@@ -951,7 +954,7 @@
                              jint nMethods)
 {
     TRACE2("jni", "RegisterNatives called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class_Handle clss = jclass_to_struct_Class(clazz);
     class_register_methods(clss, methods, nMethods);
     return class_register_methods(clss, methods, nMethods) ? -1 : 0;
@@ -960,7 +963,7 @@
 jint JNICALL UnregisterNatives(JNIEnv * UNREF env, jclass clazz)
 {
     TRACE2("jni", "UnregisterNatives called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class* clss = jclass_to_struct_Class(clazz);
     return class_unregister_methods(clss) ? -1 : 0;
 } //UnregisterNatives
@@ -968,8 +971,8 @@
 jint JNICALL MonitorEnter(JNIEnv * UNREF env, jobject obj)
 {
     TRACE2("jni", "MonitorEnter called");
-    assert(tmn_is_suspend_enabled());
-    vm_monitor_enter_slow_handle(obj);
+    assert(hythread_is_suspend_enabled());
+    jthread_monitor_enter(obj);
     return exn_raised() ? -1 : 0;
 } //MonitorEnter
 
@@ -978,8 +981,8 @@
 jint JNICALL MonitorExit(JNIEnv * UNREF env, jobject obj)
 {
     TRACE2("jni", "MonitorExit called");
-    assert(tmn_is_suspend_enabled());
-    vm_monitor_exit_handle(obj);
+    assert(hythread_is_suspend_enabled());
+    jthread_monitor_exit(obj);
     return exn_raised() ? -1 : 0;
 } //MonitorExit
 
@@ -988,7 +991,7 @@
 jint JNICALL GetJavaVM(JNIEnv *env_ext, JavaVM **vm)
 {
     TRACE2("jni", "GetJavaVM called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     JNIEnv_Internal *env = (JNIEnv_Internal *)env_ext;
     *vm = env->vm;
     return JNI_OK;
@@ -998,7 +1001,7 @@
 void JNICALL GetStringRegion(JNIEnv * UNREF env, jstring s, jsize off, jsize len, jchar *b)
 {
     TRACE2("jni", "GetStringRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     assert(s);
 
     string_get_unicode_region_h((ObjectHandle)s, off, len, b);
@@ -1007,14 +1010,14 @@
 void JNICALL GetStringUTFRegion(JNIEnv * UNREF env, jstring s, jsize off, jsize len, char *b)
 {
     TRACE2("jni", "GetStringUTFRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     string_get_utf8_region_h((ObjectHandle)s, off, len, b);
 }
 
 VMEXPORT void* JNICALL GetPrimitiveArrayCritical(JNIEnv* jenv, jarray array, jboolean* isCopy)
 {
     TRACE2("jni", "GetPrimitiveArrayCritical called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     tmn_suspend_disable();
     Class* array_clss = ((ObjectHandle)array)->object->vt()->clss;
     tmn_suspend_enable();
@@ -1038,7 +1041,7 @@
 VMEXPORT void JNICALL ReleasePrimitiveArrayCritical(JNIEnv* jenv, jarray array, void* carray, jint mode)
 {
     TRACE2("jni", "ReleasePrimitiveArrayCritical called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     tmn_suspend_disable();
     Class* array_clss = ((ObjectHandle)array)->object->vt()->clss;
     tmn_suspend_enable();
@@ -1063,35 +1066,35 @@
 const jchar* JNICALL GetStringCritical(JNIEnv *env, jstring s, jboolean* isCopy)
 {
     TRACE2("jni", "GetStringCritical called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     return GetStringChars(env, s, isCopy);
 }
 
 void JNICALL ReleaseStringCritical(JNIEnv *env, jstring s, const jchar* cstr)
 {
     TRACE2("jni", "ReleaseStringCritical called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ReleaseStringChars(env, s, cstr);
 }
 
 VMEXPORT jweak JNICALL NewWeakGlobalRef(JNIEnv *env, jobject obj)
 {
     TRACE2("jni", "NewWeakGlobalRef called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     return NewGlobalRef(env, obj);
 }
 
 VMEXPORT void JNICALL DeleteWeakGlobalRef(JNIEnv *env, jweak obj)
 {
     TRACE2("jni", "DeleteWeakGlobalRef called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     DeleteGlobalRef(env, obj);
 }
 
 jboolean JNICALL ExceptionCheck(JNIEnv * UNREF env)
 {
     TRACE2("jni", "ExceptionCheck called, exception status = " << exn_raised());
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if (exn_raised())
         return JNI_TRUE;
     else
@@ -1262,7 +1265,7 @@
 VMEXPORT jint JNICALL GetEnv(JavaVM* vm, void** penv, jint ver)
 {
     TRACE2("jni", "GetEnv called, ver = " << ver);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 
     if (p_TLS_vmthread == NULL)
         return JNI_EDETACHED;
@@ -1347,7 +1350,7 @@
 
 
 static void check_for_unexpected_exception(){
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     tmn_suspend_disable();
     ManagedObject * exc;
     if ((exc = get_current_thread_exception())) {
@@ -1419,10 +1422,10 @@
     gh_jldouble->object = struct_Class_to_java_lang_Class(jldouble);
     h_jlt->object= struct_Class_to_java_lang_Class(env->java_lang_Throwable_Class);
     tmn_suspend_enable(); //-------------------------------------------------------^
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 
     gid_throwable_traceinfo = jenv->GetFieldID((jclass)h_jlt, "vm_stacktrace", "[J");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 
     gid_boolean_value = jenv->GetFieldID((jclass)gh_jlboolean, "value", "Z");   
     gid_byte_value = jenv->GetFieldID((jclass)gh_jlbyte, "value", "B");        
@@ -1432,7 +1435,7 @@
     gid_long_value = jenv->GetFieldID((jclass)gh_jllong, "value", "J");       
     gid_float_value = jenv->GetFieldID((jclass)gh_jlfloat, "value", "F");     
     gid_double_value = jenv->GetFieldID((jclass)gh_jldouble, "value", "D");   
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 
     gid_doubleisNaN = jenv->GetStaticMethodID((jclass)gh_jldouble, "isNaN", "(D)Z");
 
@@ -1440,37 +1443,37 @@
     gid_string_field_value = jenv->GetFieldID((jclass)gh_jls, "value", "[C");
     if(env->strings_are_compressed)
         gid_string_field_bvalue = jenv->GetFieldID((jclass)gh_jls, "bvalue", "[B");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 
     gid_string_field_offset = jenv->GetFieldID((jclass)gh_jls, "offset", "I");
     gid_string_field_count = jenv->GetFieldID((jclass)gh_jls, "count", "I");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 
     oh_deallocate_global_handle(h_jlt);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 
 #ifdef USE_NATIVE_ISARRAY
     field_name = env->string_pool.lookup("isArray");
     field_descr = env->string_pool.lookup("()Z");
     gsig_ClassisArray = env->sig_table.lookup(field_name, field_descr);
 #endif //#ifndef USE_NATIVE_ISARRAY
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 }
 
 void unsafe_global_object_handles_init(){
-    assert(!tmn_is_suspend_enabled());
+    assert(!hythread_is_suspend_enabled());
     tmn_suspend_enable();
     JNIEnv_Internal *jenv = jni_native_intf;
    
     jfieldID POSITIVE_INFINITY_id = jenv->GetStaticFieldID((jclass)gh_jldouble, "POSITIVE_INFINITY", "D");
     gc_double_POSITIVE_INFINITY = jenv->GetStaticDoubleField((jclass)gh_jldouble, POSITIVE_INFINITY_id);
     check_for_unexpected_exception();
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     
     jfieldID NEGATIVE_INFINITY_id = jenv->GetStaticFieldID((jclass)gh_jldouble, "NEGATIVE_INFINITY", "D");      
     gc_double_NEGATIVE_INFINITY = jenv->GetStaticDoubleField((jclass)gh_jldouble, NEGATIVE_INFINITY_id);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
      check_for_unexpected_exception();
-     assert(tmn_is_suspend_enabled());
+     assert(hythread_is_suspend_enabled());
     tmn_suspend_disable();
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_array.cpp Wed Aug 23 09:48:41 2006
@@ -28,7 +28,7 @@
 #include "object_handles.h"
 #include "open/vm_util.h"
 #include "vm_threads.h"
-#include "open/thread.h"
+
 #include "ini.h"
 #include "vm_arrays.h"
 #include "nogc.h"
@@ -41,7 +41,7 @@
                              jarray array)
 {
     TRACE2("jni", "GetArrayLength called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
 
     tmn_suspend_disable();   //-----------------v
@@ -65,7 +65,7 @@
                               jobject initialElement)
 {
     TRACE2("jni", "NewObjectArray called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle elem_handle = (ObjectHandle)initialElement;
 
     Class* clss = jclass_to_struct_Class(elementClass);
@@ -136,7 +136,7 @@
 jobject JNICALL GetObjectArrayElement(JNIEnv *env, jobjectArray array, jsize index)
 {
     TRACE2("jni", "GetObjectArrayElement called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if (array == NULL) {
         // This should not happen.
         ASSERT(0, "Input parameter 'array' is NULL");
@@ -176,7 +176,7 @@
                                    jobject value)
 {
     TRACE2("jni", "SetObjectArrayElement called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     if (array == NULL) {
         // This should not happen.
         ASSERT(0, "Input parameter 'array' is NULL");
@@ -235,7 +235,7 @@
 jbooleanArray JNICALL NewBooleanArray(JNIEnv * UNREF env, jsize length)
 {
     TRACE2("jni", "NewBooleanArray called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class *clss = VM_Global_State::loader_env->ArrayOfBoolean_Class;
     
     unsigned sz = vm_array_size(clss->vtable, length);
@@ -267,7 +267,7 @@
 jbyteArray JNICALL NewByteArray(JNIEnv * UNREF env, jsize length)
 {
     TRACE2("jni", "NewByteArray called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class *clss = VM_Global_State::loader_env->ArrayOfByte_Class;
     assert(clss);
  
@@ -300,7 +300,7 @@
 jcharArray JNICALL NewCharArray(JNIEnv * UNREF env, jsize length)
 {
     TRACE2("jni", "NewCharArray called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class *clss = VM_Global_State::loader_env->ArrayOfChar_Class;
  
     unsigned sz = vm_array_size(clss->vtable, length);
@@ -332,7 +332,7 @@
 jshortArray JNICALL NewShortArray(JNIEnv * UNREF env, jsize length)
 {
     TRACE2("jni", "NewShortArray called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class *clss = VM_Global_State::loader_env->ArrayOfShort_Class;
  
     unsigned sz = vm_array_size(clss->vtable, length);
@@ -365,7 +365,7 @@
 jintArray JNICALL NewIntArray(JNIEnv * UNREF env, jsize length)
 {
     TRACE2("jni", "NewIntArray called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class *clss = VM_Global_State::loader_env->ArrayOfInt_Class;
     unsigned sz = vm_array_size(clss->vtable, length);
     tmn_suspend_disable();       //---------------------------------v
@@ -396,7 +396,7 @@
 jlongArray JNICALL NewLongArray(JNIEnv * UNREF env, jsize length)
 {
     TRACE2("jni", "NewLongArray called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class *clss = VM_Global_State::loader_env->ArrayOfLong_Class;
     unsigned sz = vm_array_size(clss->vtable, length);
     tmn_suspend_disable();       //---------------------------------v
@@ -427,7 +427,7 @@
 jfloatArray JNICALL NewFloatArray(JNIEnv * UNREF env, jsize length)
 {
     TRACE2("jni", "NewFloatArray called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class *clss = VM_Global_State::loader_env->ArrayOfFloat_Class;
     unsigned sz = vm_array_size(clss->vtable, length);
     tmn_suspend_disable();       //---------------------------------v
@@ -458,7 +458,7 @@
 jdoubleArray JNICALL NewDoubleArray(JNIEnv * UNREF env, jsize length)
 {
     TRACE2("jni", "NewDoubleArray called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class *clss = VM_Global_State::loader_env->ArrayOfDouble_Class;
     unsigned sz = vm_array_size(clss->vtable, length);
     tmn_suspend_disable();       //---------------------------------v
@@ -499,7 +499,7 @@
                                           jboolean *isCopy)
 {
     TRACE2("jni", "GetBooleanArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -539,7 +539,7 @@
                                     jboolean *isCopy)
 {
     TRACE2("jni", "GetByteArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -579,7 +579,7 @@
                                     jboolean *isCopy)
 {
     TRACE2("jni", "GetCharArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -619,7 +619,7 @@
                                       jboolean *isCopy)
 {
     TRACE2("jni", "GetShortArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -659,7 +659,7 @@
                                   jboolean *isCopy)
 {
     TRACE2("jni", "GetIntArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -700,7 +700,7 @@
                                     jboolean *isCopy)
 {
     TRACE2("jni", "GetLongArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -740,7 +740,7 @@
                                       jboolean *isCopy)
 {
     TRACE2("jni", "GetFloatArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -781,7 +781,7 @@
                                         jboolean *isCopy)
 {
     TRACE2("jni", "GetDoubleArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -831,7 +831,7 @@
                                          jint mode)
 {
     TRACE2("jni", "ReleaseBooleanArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
     tmn_suspend_disable();       //---------------------------------v
 
@@ -881,7 +881,7 @@
                                       jint mode)
 {
     TRACE2("jni", "ReleaseByteArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -931,7 +931,7 @@
                                       jint mode)
 {
     TRACE2("jni", "ReleaseCharArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
     tmn_suspend_disable();       //---------------------------------v
 
@@ -981,7 +981,7 @@
                                        jint mode)
 {
     TRACE2("jni", "ReleaseShortArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
     tmn_suspend_disable();       //---------------------------------v
 
@@ -1031,7 +1031,7 @@
                                      jint mode)
 {
     TRACE2("jni", "ReleaseIntArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
     tmn_suspend_disable();       //---------------------------------v
 
@@ -1081,7 +1081,7 @@
                                       jint mode)
 {
     TRACE2("jni", "ReleaseLongArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
     tmn_suspend_disable();       //---------------------------------v
 
@@ -1131,7 +1131,7 @@
                                        jint mode)
 {
     TRACE2("jni", "ReleaseFloatArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
     tmn_suspend_disable();       //---------------------------------v
 
@@ -1182,7 +1182,7 @@
                                         jint mode)
 {
     TRACE2("jni", "ReleaseDoubleArrayElements called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)array;
     tmn_suspend_disable();       //---------------------------------v
 
@@ -1242,7 +1242,7 @@
                                     jboolean *buf)
 {
     TRACE2("jni", "GetBooleanArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1271,7 +1271,7 @@
                                     jbyte *buf)
 {
     TRACE2("jni", "GetByteArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1300,7 +1300,7 @@
                                 jchar *buf)
 {
     TRACE2("jni", "GetCharArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1329,7 +1329,7 @@
                                  jshort *buf)
 {
     TRACE2("jni", "GetShortArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1358,7 +1358,7 @@
                                jint *buf)
 {
     TRACE2("jni", "GetIntArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1387,7 +1387,7 @@
                                 jlong *buf)
 {
     TRACE2("jni", "GetLongArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1416,7 +1416,7 @@
                                  jfloat *buf)
 {
     TRACE2("jni", "GetFloatArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1445,7 +1445,7 @@
                                   jdouble *buf)
 {
     TRACE2("jni", "GetDoubleArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1482,7 +1482,7 @@
                                    jboolean *buf)
 {
     TRACE2("jni", "SetBooleanArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1513,7 +1513,7 @@
                                 jbyte *buf)
 {
     TRACE2("jni", "SetByteArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1544,7 +1544,7 @@
                                 jchar *buf)
 {
     TRACE2("jni", "SetCharArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1575,7 +1575,7 @@
                                  jshort *buf)
 {
     TRACE2("jni", "SetShortArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1606,7 +1606,7 @@
                                jint *buf)
 {
     TRACE2("jni", "SetIntArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1637,7 +1637,7 @@
                                 jlong *buf)
 {
     TRACE2("jni", "SetLongArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1668,7 +1668,7 @@
                                  jfloat *buf)
 {
     TRACE2("jni", "SetFloatArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {
@@ -1699,7 +1699,7 @@
                                   jdouble *buf)
 {
     TRACE2("jni", "SetDoubleArrayRegion called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     jsize length = GetArrayLength(env, array);
     jsize end = start + len;
     if(start < 0 || len < 0 || end > length) {

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_field.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_field.cpp?rev=434076&r1=434075&r2=434076&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_field.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni_field.cpp Wed Aug 23 09:48:41 2006
@@ -31,14 +31,14 @@
 #include "object_handles.h"
 #include "open/vm_util.h"
 #include "vm_threads.h"
-#include "open/thread.h"
+
 #include "ini.h"
 #include "exceptions.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) {
@@ -60,7 +60,7 @@
                             const char *sig)
 {
     TRACE2("jni", "GetFieldID called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class* clss = jclass_to_struct_Class(clazz);
     Field *field = class_lookup_field_recursive(clss, name, sig);
     if (NULL == field || field->is_static())
@@ -82,9 +82,9 @@
                                   const char *field_name,
                                   const char *sig)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     String *class_string = VM_Global_State::loader_env->string_pool.lookup(class_name);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Class *clss =
         class_load_verify_prepare_from_jni(VM_Global_State::loader_env, class_string);
     if(!clss) {
@@ -100,7 +100,7 @@
                                   const char *sig)
 {
     TRACE2("jni", "GetStaticFieldID called");
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
 
     Class* clss = jclass_to_struct_Class(clazz);
     Field *field = class_lookup_field_recursive(clss, name, sig);
@@ -121,7 +121,7 @@
 
 jobject JNICALL GetObjectFieldOffset(JNIEnv* UNREF env, jobject obj, jint offset)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -145,7 +145,7 @@
                                jfieldID fieldID)
 {
     TRACE2("jni", "GetObjectField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -158,7 +158,7 @@
 
 jboolean JNICALL GetBooleanFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -176,7 +176,7 @@
                                  jfieldID fieldID)
 {
     TRACE2("jni", "GetBooleanField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return 0;
@@ -187,7 +187,7 @@
 
 jbyte JNICALL GetByteFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -205,7 +205,7 @@
                            jfieldID fieldID)
 {
     TRACE2("jni", "GetByteField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -218,7 +218,7 @@
 
 jchar JNICALL GetCharFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();     //---------------------------------v
@@ -236,7 +236,7 @@
                            jfieldID fieldID)
 {
     TRACE2("jni", "GetCharField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -249,7 +249,7 @@
 
 jshort JNICALL GetShortFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -267,7 +267,7 @@
                              jfieldID fieldID)
 {
     TRACE2("jni", "GetShortField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -280,7 +280,7 @@
 
 jint JNICALL GetIntFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -298,7 +298,7 @@
                          jfieldID fieldID)
 {
     TRACE2("jni", "GetIntField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -311,7 +311,7 @@
 
 jlong JNICALL GetLongFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -329,7 +329,7 @@
                            jfieldID fieldID)
 {
     TRACE2("jni", "GetLongField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -342,7 +342,7 @@
 
 jfloat JNICALL GetFloatFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -360,7 +360,7 @@
                              jfieldID fieldID)
 {
     TRACE2("jni", "GetFloatField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -373,7 +373,7 @@
 
 jdouble JNICALL GetDoubleFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -391,7 +391,7 @@
                                jfieldID fieldID)
 {
     TRACE2("jni", "GetDoubleField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -414,7 +414,7 @@
 
 void JNICALL SetObjectFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset, jobject value)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
     ObjectHandle v = (ObjectHandle)value;
 
@@ -441,7 +441,7 @@
                             jobject value)
 {
     TRACE2("jni", "SetObjectField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -454,7 +454,7 @@
 
 void JNICALL SetBooleanFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset, jboolean value)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -471,7 +471,7 @@
                              jboolean value)
 {
     TRACE2("jni", "SetBooleanField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return;
@@ -482,7 +482,7 @@
 
 void JNICALL SetByteFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset, jbyte value)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -502,7 +502,7 @@
                           jbyte value)
 {
     TRACE2("jni", "SetByteField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -515,7 +515,7 @@
 
 void JNICALL SetCharFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset, jchar value)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -532,7 +532,7 @@
                           jchar value)
 {
     TRACE2("jni", "SetCharField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -545,7 +545,7 @@
 
 void JNICALL SetShortFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset, jshort value)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -565,7 +565,7 @@
                            jshort value)
 {
     TRACE2("jni", "SetShortField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -578,7 +578,7 @@
 
 void JNICALL SetIntFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset, jint value)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -595,7 +595,7 @@
                          jint value)
 {
     TRACE2("jni", "SetIntField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -608,7 +608,7 @@
 
 void JNICALL SetLongFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset, jlong value)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -625,7 +625,7 @@
                           jlong value)
 {
     TRACE2("jni", "SetLongField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -637,7 +637,7 @@
 
 void JNICALL SetFloatFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset, jfloat value)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -654,7 +654,7 @@
                            jfloat value)
 {
     TRACE2("jni", "SetFloatField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -667,7 +667,7 @@
 
 void JNICALL SetDoubleFieldOffset(JNIEnv * UNREF env, jobject obj, jint offset, jdouble value)
 {
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     ObjectHandle h = (ObjectHandle)obj;
 
     tmn_suspend_disable();       //---------------------------------v
@@ -684,7 +684,7 @@
                             jdouble value)
 {
     TRACE2("jni", "SetDoubleField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     assert(IsInstanceOf(env, obj, struct_Class_to_jclass(f->get_class())));
@@ -713,7 +713,7 @@
                                      jfieldID fieldID)
 {
     TRACE2("jni", "GetStaticObjectField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return 0;
@@ -741,7 +741,7 @@
                                        jfieldID fieldID)
 {
     TRACE2("jni", "GetStaticBooleanField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return 0;
@@ -755,7 +755,7 @@
                                  jfieldID fieldID)
 {
     TRACE2("jni", "GetStaticByteField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return 0;
@@ -769,7 +769,7 @@
                                  jfieldID fieldID)
 {
     TRACE2("jni", "GetStaticCharField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return 0;
@@ -783,7 +783,7 @@
                                    jfieldID fieldID)
 {
     TRACE2("jni", "GetStaticShortField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return 0;
@@ -797,7 +797,7 @@
                                jfieldID fieldID)
 {
     TRACE2("jni", "GetStaticIntField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return 0;
@@ -811,7 +811,7 @@
                                  jfieldID fieldID)
 {
     TRACE2("jni", "GetStaticLongField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return 0;
@@ -825,7 +825,7 @@
                                   jfieldID fieldID)
 {
     TRACE2("jni", "GetStaticFloatField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return 0;
@@ -839,7 +839,7 @@
                                      jfieldID fieldID)
 {
     TRACE2("jni", "GetStaticDoubleField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return 0;
@@ -866,7 +866,7 @@
                                   jobject value)
 {
     TRACE2("jni", "SetStaticObjectField called, id = " << fieldID);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return;
@@ -892,7 +892,7 @@
                                    jboolean value)
 {
     TRACE2("jni", "SetStaticBooleanField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return;
@@ -908,7 +908,7 @@
                                 jbyte value)
 {
     TRACE2("jni", "SetStaticByteField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return;
@@ -928,7 +928,7 @@
                                 jchar value)
 {
     TRACE2("jni", "SetStaticCharField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return;
@@ -944,7 +944,7 @@
                                  jshort value)
 {
     TRACE2("jni", "SetStaticShortField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return;
@@ -964,7 +964,7 @@
                                jint value)
 {
     TRACE2("jni", "SetStaticIntField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return;
@@ -981,7 +981,7 @@
                                 jlong value)
 {
     TRACE2("jni", "SetStaticLongField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return;
@@ -997,7 +997,7 @@
                                  jfloat value)
 {
     TRACE2("jni", "SetStaticFloatField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return;
@@ -1013,7 +1013,7 @@
                                   jdouble value)
 {
     TRACE2("jni", "SetStaticDoubleField called, id = " << fieldID << " value = " << value);
-    assert(tmn_is_suspend_enabled());
+    assert(hythread_is_suspend_enabled());
     Field *f = (Field *)fieldID;
     assert(f);
     if (!ensure_initialised(env, f->get_class())) return;



Mime
View raw message