tsan: update mutex table for java

llvm-svn: 170884
diff --git a/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc b/compiler-rt/lib/tsan/rtl/tsan_interface_java.cc
index c49d58b..2bebed8 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 @@
   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 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 a02d3ed..335ca22 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_mutex.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_mutex.cc
@@ -28,16 +28,18 @@
 #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 3a03cfb..a2b4891 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_mutex.h
+++ b/compiler-rt/lib/tsan/rtl/tsan_mutex.h
@@ -30,7 +30,7 @@
   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 4bfc962..645e1d0 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_stat.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_stat.cc
@@ -279,6 +279,7 @@
   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 e6bb628..397e6ee 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_stat.h
+++ b/compiler-rt/lib/tsan/rtl/tsan_stat.h
@@ -281,7 +281,7 @@
   StatMtxAnnotations,
   StatMtxAtExit,
   StatMtxMBlock,
-  StatMtxJava,
+  StatMtxJavaMBlock,
 
   // This must be the last.
   StatCnt