aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/builtins.c
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2007-01-24 17:11:04 +0000
committerAndrew Haley <aph@gcc.gnu.org>2007-01-24 17:11:04 +0000
commitc863b570e4f51fd56a80bec9d9aaeb51f9847543 (patch)
tree355ec9dcc27947cedd8257c4a3f8f176611a4c02 /gcc/java/builtins.c
parent9e4515539baf536a4ed48c453c955cae0e4b0f03 (diff)
downloadgcc-c863b570e4f51fd56a80bec9d9aaeb51f9847543.zip
gcc-c863b570e4f51fd56a80bec9d9aaeb51f9847543.tar.gz
gcc-c863b570e4f51fd56a80bec9d9aaeb51f9847543.tar.bz2
[multiple changes]
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
Diffstat (limited to 'gcc/java/builtins.c')
-rw-r--r--gcc/java/builtins.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c
index 9b5353b..ef8854a 100644
--- a/gcc/java/builtins.c
+++ b/gcc/java/builtins.c
@@ -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);
/* 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;
+}
+
#define BUILTIN_NOTHROW 1