harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r504560 - in /harmony/enhanced/drlvm/trunk/vm/vmcore: include/environment.h src/class_support/Environment.cpp src/jit/compile.cpp src/jvmti/jvmti_event.cpp src/util/native_stack.cpp
Date Wed, 07 Feb 2007 14:28:47 GMT
Author: gshimansky
Date: Wed Feb  7 06:28:46 2007
New Revision: 504560

URL: http://svn.apache.org/viewvc?view=rev&rev=504560
Log:
Applied HARMONY-2933 [drlvm][vmcore][jit] Unsynchronized linked list modification

Tests passed on Ubuntu6 x86, Windows 2003 server x86 and SuSE9 x86_64


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/environment.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Environment.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/native_stack.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/environment.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/environment.h?view=diff&rev=504560&r1=504559&r2=504560
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/environment.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/environment.h Wed Feb  7 06:28:46 2007
@@ -78,6 +78,7 @@
     Lock_Manager *p_meth_addr_table_lock;
     Lock_Manager *p_method_call_lock;
     Lock_Manager *p_handle_lock;
+    Lock_Manager *p_dclist_lock;
 
     /**
      * If set to true by the <code>-compact_fields</code> command-line option,

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Environment.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Environment.cpp?view=diff&rev=504560&r1=504559&r2=504560
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Environment.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Environment.cpp Wed Feb  7 06:28:46
2007
@@ -145,6 +145,7 @@
     p_meth_addr_table_lock = new Lock_Manager();
     p_handle_lock = new Lock_Manager();
     p_method_call_lock = new Lock_Manager();
+    p_dclist_lock = new Lock_Manager();
 
     //
     // preloaded classes
@@ -245,6 +246,7 @@
     delete p_meth_addr_table_lock;
     delete p_handle_lock;
     delete p_method_call_lock;
+    delete p_dclist_lock;
 
     // Unload jit instances.
     vm_delete_all_jits();

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp?view=diff&rev=504560&r1=504559&r2=504560
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp Wed Feb  7 06:28:46 2007
@@ -807,13 +807,16 @@
 // Adding dynamic generated code info to global list
 void compile_add_dynamic_generated_code_chunk(const char* name, const void* address, jint
length)
 {
-    DynamicCode** pdcList = &VM_Global_State::loader_env->dcList;
-    // FIXME linked list modification without synchronization
     DynamicCode *dc = (DynamicCode *)STD_MALLOC(sizeof(DynamicCode));
     assert(dc);
     dc->name = name;
     dc->address = address;
     dc->length = length;
+
+    // Synchronizing access to dynamic code list
+    LMAutoUnlock dcll(VM_Global_State::loader_env->p_dclist_lock);
+
+    DynamicCode** pdcList = &VM_Global_State::loader_env->dcList;
     dc->next = *pdcList;
     *pdcList = dc;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp?view=diff&rev=504560&r1=504559&r2=504560
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp Wed Feb  7 06:28:46 2007
@@ -611,10 +611,15 @@
     }
     else
     {
-        // FIXME: linked list usage without sync
+        Lock_Manager* dclock = VM_Global_State::loader_env->p_dclist_lock;
+        // Synchronizing access to dynamic code list
+        dclock->_lock();
+
         for (DynamicCode *dcList = compile_get_dynamic_code_list();
             NULL != dcList; dcList = dcList->next)
             jvmti_send_dynamic_code_generated_event(dcList->name, dcList->address,
dcList->length);
+
+        dclock->_unlock();
     }
 
     return JVMTI_ERROR_NONE;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/native_stack.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/native_stack.cpp?view=diff&rev=504560&r1=504559&r2=504560
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/native_stack.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/native_stack.cpp Wed Feb  7 06:28:46 2007
@@ -80,6 +80,9 @@
 
 bool native_is_ip_stub(void* ip)
 {
+    // Synchronizing access to dynamic code list
+    LMAutoUnlock dcll(VM_Global_State::loader_env->p_dclist_lock);
+
     for (DynamicCode *dcList = compile_get_dynamic_code_list();
          NULL != dcList; dcList = dcList->next)
     {



Mime
View raw message