diff options
author | Dmitry Vyukov <dvyukov@google.com> | 2012-12-21 11:30:14 +0000 |
---|---|---|
committer | Dmitry Vyukov <dvyukov@google.com> | 2012-12-21 11:30:14 +0000 |
commit | 22be55e47e79ee5cb90aadbd2fb8e20594534a2d (patch) | |
tree | a24075201f343e09454eaa3a559425f73d33af9e /compiler-rt/lib/tsan | |
parent | 4fbc0d08bfe929f2d968e2120908c98eeb974072 (diff) | |
download | bcm5719-llvm-22be55e47e79ee5cb90aadbd2fb8e20594534a2d.tar.gz bcm5719-llvm-22be55e47e79ee5cb90aadbd2fb8e20594534a2d.zip |
tsan: update mutex table for java
llvm-svn: 170884
Diffstat (limited to 'compiler-rt/lib/tsan')
-rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_interface_java.cc | 8 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_mutex.cc | 22 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_mutex.h | 2 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_stat.cc | 1 | ||||
-rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_stat.h | 2 |
5 files changed, 18 insertions, 17 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc b/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc index c49d58b3ad3..2bebed8eb21 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc @@ -31,14 +31,14 @@ struct BlockDesc { SyncVar *head; BlockDesc() - : mtx(MutexTypeJava, StatMtxJava) + : mtx(MutexTypeJavaMBlock, StatMtxJavaMBlock) , head() { CHECK_EQ(begin, false); begin = true; } explicit BlockDesc(BlockDesc *b) - : mtx(MutexTypeJava, StatMtxJava) + : mtx(MutexTypeJavaMBlock, StatMtxJavaMBlock) , head(b->head) { CHECK_EQ(begin, false); begin = true; @@ -63,14 +63,12 @@ struct BlockDesc { }; struct JavaContext { - Mutex mtx; const uptr heap_begin; const uptr heap_size; BlockDesc *heap_shadow; JavaContext(jptr heap_begin, jptr heap_size) - : mtx(MutexTypeJava, StatMtxJava) - , heap_begin(heap_begin) + : heap_begin(heap_begin) , heap_size(heap_size) { uptr size = heap_size / kHeapAlignment * sizeof(BlockDesc); heap_shadow = (BlockDesc*)MmapFixedNoReserve(kHeapShadow, size); diff --git a/compiler-rt/lib/tsan/rtl/tsan_mutex.cc b/compiler-rt/lib/tsan/rtl/tsan_mutex.cc index a02d3ed640a..335ca2211d1 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_mutex.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_mutex.cc @@ -28,16 +28,18 @@ namespace __tsan { #if TSAN_DEBUG && !TSAN_GO const MutexType MutexTypeLeaf = (MutexType)-1; static MutexType CanLockTab[MutexTypeCount][MutexTypeCount] = { - /*0 MutexTypeInvalid*/ {}, - /*1 MutexTypeTrace*/ {MutexTypeLeaf}, - /*2 MutexTypeThreads*/ {MutexTypeReport}, - /*3 MutexTypeReport*/ {MutexTypeSyncTab, MutexTypeMBlock}, - /*4 MutexTypeSyncVar*/ {}, - /*5 MutexTypeSyncTab*/ {MutexTypeSyncVar}, - /*6 MutexTypeSlab*/ {MutexTypeLeaf}, - /*7 MutexTypeAnnotations*/ {}, - /*8 MutexTypeAtExit*/ {MutexTypeSyncTab}, - /*9 MutexTypeMBlock*/ {MutexTypeSyncVar}, + /*0 MutexTypeInvalid*/ {}, + /*1 MutexTypeTrace*/ {MutexTypeLeaf}, + /*2 MutexTypeThreads*/ {MutexTypeReport}, + /*3 MutexTypeReport*/ {MutexTypeSyncTab, MutexTypeMBlock, + MutexTypeJavaMBlock}, + /*4 MutexTypeSyncVar*/ {}, + /*5 MutexTypeSyncTab*/ {MutexTypeSyncVar}, + /*6 MutexTypeSlab*/ {MutexTypeLeaf}, + /*7 MutexTypeAnnotations*/ {}, + /*8 MutexTypeAtExit*/ {MutexTypeSyncTab}, + /*9 MutexTypeMBlock*/ {MutexTypeSyncVar}, + /*10 MutexTypeJavaMBlock*/ {MutexTypeSyncVar}, }; static bool CanLockAdj[MutexTypeCount][MutexTypeCount]; diff --git a/compiler-rt/lib/tsan/rtl/tsan_mutex.h b/compiler-rt/lib/tsan/rtl/tsan_mutex.h index 3a03cfbb3b1..a2b489107a9 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_mutex.h +++ b/compiler-rt/lib/tsan/rtl/tsan_mutex.h @@ -30,7 +30,7 @@ enum MutexType { MutexTypeAnnotations, MutexTypeAtExit, MutexTypeMBlock, - MutexTypeJava, + MutexTypeJavaMBlock, // This must be the last. MutexTypeCount diff --git a/compiler-rt/lib/tsan/rtl/tsan_stat.cc b/compiler-rt/lib/tsan/rtl/tsan_stat.cc index 4bfc9625a0f..645e1d0f5fc 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_stat.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_stat.cc @@ -279,6 +279,7 @@ void StatOutput(u64 *stat) { name[StatMtxAtExit] = " Atexit "; name[StatMtxAnnotations] = " Annotations "; name[StatMtxMBlock] = " MBlock "; + name[StatMtxJavaMBlock] = " JavaMBlock "; Printf("Statistics:\n"); for (int i = 0; i < StatCnt; i++) diff --git a/compiler-rt/lib/tsan/rtl/tsan_stat.h b/compiler-rt/lib/tsan/rtl/tsan_stat.h index e6bb6288027..397e6ee4675 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_stat.h +++ b/compiler-rt/lib/tsan/rtl/tsan_stat.h @@ -281,7 +281,7 @@ enum StatType { StatMtxAnnotations, StatMtxAtExit, StatMtxMBlock, - StatMtxJava, + StatMtxJavaMBlock, // This must be the last. StatCnt |