harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r586380 - in /harmony/enhanced/drlvm/trunk/vm/vmcore: include/ src/class_support/ src/jit/ src/kernel_classes/native/ src/thread/ src/util/ src/util/ia32/base/
Date Fri, 19 Oct 2007 11:10:32 GMT
Author: gshimansky
Date: Fri Oct 19 04:10:31 2007
New Revision: 586380

URL: http://svn.apache.org/viewvc?rev=586380&view=rev
Log:
Applied patch from HARMONY-4960
[drlvm][linux][em64t] Additional patch for HARMONY-4940


Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/object_layout.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/thread_manager.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/atomics_common.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_strings.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/object_layout.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/object_layout.h?rev=586380&r1=586379&r2=586380&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/object_layout.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/object_layout.h Fri Oct 19 04:10:31 2007
@@ -84,7 +84,7 @@
 #define REF_SIZE (sizeof(uint32))
 #define REF_MANAGED_NULL VM_Global_State::loader_env->heap_base
 #define REF_INIT_BY_ADDR(_ref_addr_, _val_)                                 \
-    *((COMPRESSED_REFERENCE*)(_ref_addr_)) = (COMPRESSED_REFERENCE)(_val_);
+    *((COMPRESSED_REFERENCE*)(_ref_addr_)) = (COMPRESSED_REFERENCE)(_val_)
 
 #elif defined(REFS_USE_UNCOMPRESSED)
 
@@ -92,7 +92,7 @@
 #define REF_SIZE (sizeof(ManagedObject*))
 #define REF_MANAGED_NULL NULL
 #define REF_INIT_BY_ADDR(_ref_addr_, _val_)                                 \
-    *((ManagedObject**)(_ref_addr_)) = (ManagedObject*)(_val_);
+    *((ManagedObject**)(_ref_addr_)) = (ManagedObject*)(_val_)
 
 #else // for REFS_USE_RUNTIME_SWITCH
 
@@ -159,24 +159,24 @@
 // in the object "_object_".
 #if defined(REFS_USE_COMPRESSED)
 #define STORE_REFERENCE(_object_, _slot_addr_, _value_)                     \
-        gc_heap_slot_write_ref_compressed((Managed_Object_Handle)_object_,  \
-                                          (uint32*)_slot_addr_,             \
-                                          (Managed_Object_Handle)_value_);
+        gc_heap_slot_write_ref_compressed((Managed_Object_Handle)(_object_),\
+                                          (uint32*)(_slot_addr_),           \
+                                          (Managed_Object_Handle)(_value_))
 #elif defined(REFS_USE_UNCOMPRESSED)
 #define STORE_REFERENCE(_object_, _slot_addr_, _value_)                     \
-        gc_heap_slot_write_ref((Managed_Object_Handle)_object_,             \
-                               (Managed_Object_Handle*)_slot_addr_,         \
-                               (Managed_Object_Handle)_value_);
+        gc_heap_slot_write_ref((Managed_Object_Handle)(_object_),           \
+                               (Managed_Object_Handle*)(_slot_addr_),       \
+                               (Managed_Object_Handle)(_value_))
 #else // for REFS_USE_RUNTIME_SWITCH
 #define STORE_REFERENCE(_object_, _slot_addr_, _value_)                     \
     if (VM_Global_State::loader_env->compress_references) {                 \
-        gc_heap_slot_write_ref_compressed((Managed_Object_Handle)_object_,  \
-                                          (uint32*)_slot_addr_,             \
-                                          (Managed_Object_Handle)_value_);  \
+        gc_heap_slot_write_ref_compressed((Managed_Object_Handle)(_object_),\
+                                          (uint32*)(_slot_addr_),           \
+                                          (Managed_Object_Handle)(_value_));\
     } else {                                                                \
-        gc_heap_slot_write_ref((Managed_Object_Handle)_object_,             \
-                               (Managed_Object_Handle*)_slot_addr_,         \
-                               (Managed_Object_Handle)_value_);             \
+        gc_heap_slot_write_ref((Managed_Object_Handle)(_object_),           \
+                               (Managed_Object_Handle*)(_slot_addr_),       \
+                               (Managed_Object_Handle)(_value_));           \
     }
 #endif // REFS_USE_RUNTIME_SWITCH
 
@@ -186,11 +186,11 @@
 #if defined(REFS_USE_COMPRESSED)
 #define STORE_GLOBAL_REFERENCE(_slot_addr_, _value_)                    \
         gc_heap_write_global_slot_compressed((uint32*)(_slot_addr_),    \
-                                   (Managed_Object_Handle)(_value_));
+                                   (Managed_Object_Handle)(_value_))
 #elif defined(REFS_USE_UNCOMPRESSED)
 #define STORE_GLOBAL_REFERENCE(_slot_addr_, _value_)                    \
         gc_heap_write_global_slot((Managed_Object_Handle*)(_slot_addr_),\
-                                  (Managed_Object_Handle)(_value_));
+                                  (Managed_Object_Handle)(_value_))
 #else // for REFS_USE_RUNTIME_SWITCH
 #define STORE_GLOBAL_REFERENCE(_slot_addr_, _value_)                    \
     if (VM_Global_State::loader_env->compress_references) {             \

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/thread_manager.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/thread_manager.h?rev=586380&r1=586379&r2=586380&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/thread_manager.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/thread_manager.h Fri Oct 19 04:10:31 2007
@@ -23,7 +23,7 @@
 
 #define GC_BYTES_IN_THREAD_LOCAL (20 * sizeof(void *))
 #define CONVERT_ERROR(stat)	(stat)
-#define TM_JVMTI_MAX_BUFFER_SIZE 50
+#define TM_JVMTI_MAX_BUFFER_SIZE 500
 #define TM_INITIAL_OWNED_MONITOR_SIZE 32
 
 #ifdef __cplusplus

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp?rev=586380&r1=586379&r2=586380&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp Fri Oct 19 04:10:31
2007
@@ -452,7 +452,11 @@
                     if (cvalue.object == NULL) { //cvalue.string == NULL
                         // We needn't deal with this case, because the object field must
be set in static initializer.
                         // initialize the field explicitly.
-                        REF_INIT_BY_ADDR(field_addr, 0); // i.e., null
+#ifdef REFS_RUNTIME_OR_COMPRESSED
+                        REFS_RUNTIME_SWITCH_IF
+                            REF_INIT_BY_ADDR(field_addr, 0); // i.e., null
+                        REFS_RUNTIME_SWITCH_ENDIF
+#endif // REFS_RUNTIME_OR_COMPRESSED
                         break;
                     }
                     static const String* jlstring_desc_string =
@@ -485,7 +489,11 @@
             } else {
                 if ((field_type == '[') || (field_type == 'L')) {
                     // initialize the field explicitly.
-                    REF_INIT_BY_ADDR(field_addr, 0); // i.e., null
+#ifdef REFS_RUNTIME_OR_COMPRESSED
+                    REFS_RUNTIME_SWITCH_IF
+                        REF_INIT_BY_ADDR(field_addr, 0); // i.e., null
+                    REFS_RUNTIME_SWITCH_ENDIF
+#endif // REFS_RUNTIME_OR_COMPRESSED
                 }
             }
         } // end if static field

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp?rev=586380&r1=586379&r2=586380&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/jit_runtime_support.cpp Fri Oct 19 04:10:31
2007
@@ -497,16 +497,7 @@
 #endif // VM_STATS
 
         ManagedObject** elem_ptr = get_vector_element_address_ref(array, idx);
-
-        REFS_RUNTIME_SWITCH_IF
-#ifdef REFS_RUNTIME_OR_COMPRESSED
-            *((COMPRESSED_REFERENCE*)elem_ptr) = (COMPRESSED_REFERENCE)NULL;
-#endif // REFS_RUNTIME_OR_COMPRESSED
-        REFS_RUNTIME_SWITCH_ELSE
-#ifdef REFS_RUNTIME_OR_UNCOMPRESSED
-            *elem_ptr= (ManagedObject*)NULL;
-#endif // REFS_RUNTIME_OR_UNCOMPRESSED
-        REFS_RUNTIME_SWITCH_ENDIF
+        REF_INIT_BY_ADDR(elem_ptr, NULL);
     }
     return NULL;
 } //rth_aastore
@@ -3279,16 +3270,7 @@
         // elem is null. We don't have to check types for a null reference.
         // We also don't have to record stores of null references.
         ManagedObject** elem_ptr = get_vector_element_address_ref(array, idx);
-
-        REFS_RUNTIME_SWITCH_IF
-#ifdef REFS_RUNTIME_OR_COMPRESSED
-            *((COMPRESSED_REFERENCE*)elem_ptr) = (COMPRESSED_REFERENCE)NULL;
-#endif // REFS_RUNTIME_OR_COMPRESSED
-        REFS_RUNTIME_SWITCH_ELSE
-#ifdef REFS_RUNTIME_OR_UNCOMPRESSED
-            *elem_ptr= (ManagedObject*)NULL;
-#endif // REFS_RUNTIME_OR_UNCOMPRESSED
-        REFS_RUNTIME_SWITCH_ENDIF
+        REF_INIT_BY_ADDR(elem_ptr, NULL);
     }
     return NULL;
 } //vm_rt_aastore

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp?rev=586380&r1=586379&r2=586380&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelper.cpp
Fri Oct 19 04:10:31 2007
@@ -41,16 +41,21 @@
 }
 
 
+/** @return vtable base offset if is in compressed-refs mode or -1*/
 JNIEXPORT jlong JNICALL Java_org_apache_harmony_drlvm_VMHelper_getCompressedModeVTableBaseOffset(JNIEnv
*, jclass) {
 #ifdef USE_COMPRESSED_VTABLE_POINTERS
     return (jlong)vm_get_vtable_base();
 #else
-    return 0;
+    return -1;
 #endif
 }
 
 
+/** @return object base offset if is in compressed-refs mode or -1*/
 JNIEXPORT jlong JNICALL Java_org_apache_harmony_drlvm_VMHelper_getCompressedModeObjectBaseOffset(JNIEnv
*, jclass) {
-
-    return (jlong)(POINTER_SIZE_INT)REF_MANAGED_NULL;
+    if (REFS_IS_COMPRESSED_MODE) {
+        return (jlong)(POINTER_SIZE_INT)REF_MANAGED_NULL;
+    } else {
+        return -1;
+    }
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/atomics_common.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/atomics_common.cpp?rev=586380&r1=586379&r2=586380&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/atomics_common.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/thread/atomics_common.cpp Fri Oct 19 04:10:31
2007
@@ -193,24 +193,21 @@
 
     bool result;
 
-#ifdef REFS_USE_RUNTIME_SWITCH
-    if (VM_Global_State::loader_env->compress_references)
-#endif // REFS_USE_RUNTIME_SWITCH
+    REFS_RUNTIME_SWITCH_IF
 #ifdef REFS_RUNTIME_OR_COMPRESSED
         result = gc_heap_slot_cas_ref_compressed((Managed_Object_Handle)(vector_handle),
                                                  (COMPRESSED_REFERENCE *)(element_address),
                                                  (Managed_Object_Handle)(exp),
                                                  (Managed_Object_Handle)(val));
 #endif // REFS_RUNTIME_OR_COMPRESSED
-#ifdef REFS_USE_RUNTIME_SWITCH
-    else
-#endif // REFS_USE_RUNTIME_SWITCH
+    REFS_RUNTIME_SWITCH_ELSE
 #ifdef REFS_RUNTIME_OR_UNCOMPRESSED
         result = gc_heap_slot_cas_ref((Managed_Object_Handle)(vector_handle),
                                       (Managed_Object_Handle *)(element_address),
                                       (Managed_Object_Handle)(exp),
                                       (Managed_Object_Handle)(val));
 #endif // REFS_RUNTIME_OR_UNCOMPRESSED
+    REFS_RUNTIME_SWITCH_ENDIF
 
     tmn_suspend_enable();
     return (jboolean)(result?JNI_TRUE:JNI_FALSE);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp?rev=586380&r1=586379&r2=586380&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/ia32/base/jit_runtime_support_ia32.cpp
Fri Oct 19 04:10:31 2007
@@ -556,18 +556,7 @@
             // by code to directly store a NULL in the element without notifying the GC.
I've retained that change here but I wonder if
             // there could be a problem later with, say, concurrent GCs.
             ManagedObject **elem_ptr = get_vector_element_address_ref(array, idx);
-            
-            REFS_RUNTIME_SWITCH_IF
-#ifdef REFS_RUNTIME_OR_COMPRESSED
-                *((COMPRESSED_REFERENCE*)elem_ptr) = (COMPRESSED_REFERENCE)NULL;
-#endif // REFS_RUNTIME_OR_COMPRESSED
-            REFS_RUNTIME_SWITCH_ELSE
-#ifdef REFS_RUNTIME_OR_UNCOMPRESSED
-                
-                *elem_ptr = (ManagedObject *)NULL;
-#endif // REFS_RUNTIME_OR_UNCOMPRESSED
-            REFS_RUNTIME_SWITCH_ENDIF
-
+            REF_INIT_BY_ADDR(elem_ptr, NULL);
             return 0;
         }
     }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_strings.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_strings.cpp?rev=586380&r1=586379&r2=586380&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_strings.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_strings.cpp Fri Oct 19 04:10:31 2007
@@ -225,7 +225,7 @@
     Byte* str_raw = (Byte*)str;
     *(uint32*)(str_raw+f_count_offset) = length;
     *(uint32*)(str_raw+f_offset_offset) = offset;
-    STORE_REFERENCE(str, (ManagedObject**)(str_raw+f_value_offset), (ManagedObject*)chars);
+    STORE_REFERENCE(str, str_raw+f_value_offset, chars);
 }
 
 // GC must be disabled but at a same point



Mime
View raw message