[multiple changes]
authorAndrew Haley <aph@redhat.com>
Wed, 24 Jan 2007 17:11:04 +0000 (17:11 +0000)
committerAndrew Haley <aph@gcc.gnu.org>
Wed, 24 Jan 2007 17:11:04 +0000 (17:11 +0000)
2007-01-24  Andrew Haley  <aph@redhat.com>

        * jcf-parse.c (HANDLE_SYNTHETIC_ATTRIBUTE): current_class is a
        type node, not a decl, so use TYPE_SYNTHETIC not CLASS_SYNTHETIC.

2007-01-22  Andrew Haley  <aph@redhat.com>

        * builtins.c (VMSupportsCS8_builtin): New function.

From-SVN: r121118

gcc/java/ChangeLog
gcc/java/builtins.c
gcc/java/jcf-parse.c

index 37029845d9e7d244c9dde5588956170478718ab1..4d24a208e1cb3de9ac57580110521fefe1fb2a9c 100644 (file)
@@ -1,3 +1,12 @@
+2007-01-24  Andrew Haley  <aph@redhat.com>
+
+       * jcf-parse.c (HANDLE_SYNTHETIC_ATTRIBUTE): current_class is a
+       type node, not a decl, so use TYPE_SYNTHETIC not CLASS_SYNTHETIC.
+
+2007-01-22  Andrew Haley  <aph@redhat.com>
+
+       * builtins.c (VMSupportsCS8_builtin): New function.
+
 2007-01-23  Andrew Pinski  <pinskia@gmail.com>
 
        PR java/30454
index 9b5353b2644d3986beda8d0060365c3d08f68cdb..ef8854ae2e6eca4f366fdb4fa2e6770bdf90549c 100644 (file)
@@ -54,7 +54,7 @@ static tree compareAndSwapLong_builtin (tree, tree);
 static tree compareAndSwapObject_builtin (tree, tree);
 static tree putVolatile_builtin (tree, tree);
 static tree getVolatile_builtin (tree, tree);
-
+static tree VMSupportsCS8_builtin (tree, tree);
 \f
 
 /* Functions of this type are used to inline a given call.  Such a
@@ -121,6 +121,8 @@ static GTY(()) struct builtin_record java_builtins[] =
   { { "sun.misc.Unsafe" }, { "getIntVolatile" }, getVolatile_builtin, 0},
   { { "sun.misc.Unsafe" }, { "getLongVolatile" }, getVolatile_builtin, 0},
   { { "sun.misc.Unsafe" }, { "getLong" }, getVolatile_builtin, 0},
+  { { "java.util.concurrent.atomic.AtomicLong" }, { "VMSupportsCS8" }, 
+    VMSupportsCS8_builtin, 0},
   { { NULL }, { NULL }, NULL, END_BUILTINS }
 };
 
@@ -432,7 +434,20 @@ getVolatile_builtin (tree method_return_type ATTRIBUTE_UNUSED,
   
   return stmt;
 }
-  
+
+static tree
+VMSupportsCS8_builtin (tree method_return_type, 
+                      tree method_arguments ATTRIBUTE_UNUSED)
+{
+  enum machine_mode mode = TYPE_MODE (long_type_node);
+  gcc_assert (method_return_type == boolean_type_node);
+  if (sync_compare_and_swap_cc[mode] != CODE_FOR_nothing 
+      || sync_compare_and_swap[mode] != CODE_FOR_nothing)
+    return boolean_true_node;
+  else
+    return boolean_false_node;
+}  
+
 \f
 
 #define BUILTIN_NOTHROW 1
index 10e13aea792cd54ddf1835cdbc4b65d4d32f7c14..8a6d6fc2499bf5d4d5fe9afc2bde6414ab8e2492 100644 (file)
@@ -975,7 +975,7 @@ handle_signature_attribute (int member_index, JCF *jcf,
   else if (current_field)                                              \
     FIELD_SYNTHETIC (current_field) = 1;                               \
   else                                                                 \
-    CLASS_SYNTHETIC (current_class) = 1;                               \
+    TYPE_SYNTHETIC (current_class) = 1;                                        \
 }
 
 #define HANDLE_GCJCOMPILED_ATTRIBUTE()         \