merged volatile memory barriers
[cacao.git] / src / vm / utf8.c
index 7616aa117f1823a25a1e3bd1495f3fb6bca97f90..7afcb2ce14d540538f992ffd5cea05ba62934c18 100644 (file)
@@ -30,9 +30,9 @@
 
 #include "vm/types.h"
 
-#include "mm/memory.h"
+#include "mm/memory.hpp"
 
-#include "threads/lock-common.h"
+#include "threads/mutex.hpp"
 
 #include "toolbox/hashtable.h"
 
@@ -152,13 +152,17 @@ utf *utf_EnclosingMethod;
 utf *utf_Signature;
 utf *utf_StackMapTable;
 
-#if defined(ENABLE_ANNOTATIONS)
+# if defined(ENABLE_JVMTI)
+utf *utf_LocalVariableTable;
+# endif
+
+# if defined(ENABLE_ANNOTATIONS)
 utf *utf_RuntimeVisibleAnnotations;            /* RuntimeVisibleAnnotations            */
 utf *utf_RuntimeInvisibleAnnotations;          /* RuntimeInvisibleAnnotations          */
 utf *utf_RuntimeVisibleParameterAnnotations;   /* RuntimeVisibleParameterAnnotations   */
 utf *utf_RuntimeInvisibleParameterAnnotations; /* RuntimeInvisibleParameterAnnotations */
 utf *utf_AnnotationDefault;                    /* AnnotationDefault                    */
-#endif
+# endif
 #endif
 
 utf *utf_init;                          /* <init>                             */
@@ -414,6 +418,10 @@ void utf8_init(void)
        utf_Signature                  = utf_new_char("Signature");
        utf_StackMapTable              = utf_new_char("StackMapTable");
 
+# if defined(ENABLE_JVMTI)
+       utf_LocalVariableTable         = utf_new_char("LocalVariableTable");
+# endif
+
 # if defined(ENABLE_ANNOTATIONS)
        utf_RuntimeVisibleAnnotations            = utf_new_char("RuntimeVisibleAnnotations");
        utf_RuntimeInvisibleAnnotations          = utf_new_char("RuntimeInvisibleAnnotations");
@@ -691,7 +699,7 @@ utf *utf_new(const char *text, u2 length)
        utf *u;                             /* hashtable element                  */
        u2 i;
 
-       LOCK_MONITOR_ENTER(hashtable_utf->header);
+       Mutex_lock(hashtable_utf->mutex);
 
 #if defined(ENABLE_STATISTICS)
        if (opt_stat)
@@ -719,7 +727,7 @@ utf *utf_new(const char *text, u2 length)
 
                        /* symbol found in hashtable */
 
-                       LOCK_MONITOR_EXIT(hashtable_utf->header);
+                       Mutex_unlock(hashtable_utf->mutex);
 
                        return u;
                }
@@ -792,7 +800,7 @@ utf *utf_new(const char *text, u2 length)
                hashtable_utf = newhash;
        }
 
-       LOCK_MONITOR_EXIT(hashtable_utf->header);
+       Mutex_unlock(hashtable_utf->mutex);
 
        return u;
 }
@@ -812,7 +820,7 @@ utf *utf_new_u2(u2 *unicode_pos, u4 unicode_length, bool isclassname)
        u4 left;                        /* unicode characters left                */
        u4 buflength;                   /* utf length in bytes of the u2 array    */
        utf *result;                    /* resulting utf-string                   */
-       int i;          
+       int i;
 
        /* determine utf length in bytes and allocate memory */