Index: vmcore/src/object/object_handles.cpp =================================================================== --- vmcore/src/object/object_handles.cpp (revision 526137) +++ vmcore/src/object/object_handles.cpp (working copy) @@ -38,6 +38,7 @@ #include "open/types.h" #include "open/vm_util.h" #include "vtable.h" +#include "port_nonatomic.h" #ifndef NDEBUG // this is for managed object sanity checks @@ -460,24 +461,31 @@ ObjectHandlesNew* h = (ObjectHandlesNew*)head; assert(h); #ifdef VM_STATS + UNSAFE_REGION_START VM_Statistics::get_vm_stats().num_free_local_called++; if(h->next != NULL) VM_Statistics::get_vm_stats().num_free_local_called_free++; + UNSAFE_REGION_END #endif //VM_STATS while(h->next) { #ifdef VM_STATS + UNSAFE_REGION_START unsigned size = h->size; VM_Statistics::get_vm_stats().num_local_jni_handles += size; VM_Statistics::get_vm_stats().num_jni_handles_freed++; VM_Statistics::get_vm_stats().num_jni_handles_wasted_refs += (h->capacity - size); + UNSAFE_REGION_END #endif //VM_STATS ObjectHandlesNew* next = h->next; STD_FREE(h); h = next; } #ifdef VM_STATS + UNSAFE_REGION_START VM_Statistics::get_vm_stats().num_jni_handles_wasted_refs += (h->capacity - h->size); + UNSAFE_REGION_END #endif //VM_STATS + } // Fill bjectHandles sructure as empty. Index: thread/src/thread_native_thin_monitor.c =================================================================== --- thread/src/thread_native_thin_monitor.c (revision 526137) +++ thread/src/thread_native_thin_monitor.c (working copy) @@ -28,6 +28,7 @@ #include "thread_private.h" #include #include +#include "port_nonatomic.h" /** @name Thin monitors support. Implement thin-fat scheme. */ @@ -75,7 +76,9 @@ #endif lockword&=0x7FF; lockword|=(monitor_id << 11) | 0x80000000; + UNSAFE_REGION_START *lockword_ptr=lockword; + UNSAFE_REGION_END apr_memory_rw_barrier(); } @@ -249,8 +252,9 @@ // is only modified without compare-and-exchange by owner thread. If tools // like Intel Thread Checker find a bug about this line, it may actually be a // false-positive. - - lockword = *lockword_ptr; + UNSAFE_REGION_START + lockword = *lockword_ptr; + UNSAFE_REGION_END lock_id = THREAD_ID(lockword); //TRACE(("try lock %x %d", this_id, RECURSION(lockword)));