< prev index next >
src/cpu/x86/vm/x86_32.ad
Print this page
@@ -227,10 +227,15 @@
reg_class fp_dbl_notreg0( FPR2L,FPR2H, FPR3L,FPR3H, FPR4L,FPR4H,
FPR5L,FPR5H, FPR6L,FPR6H, FPR7L,FPR7H );
%}
+source_hpp %{
+#if INCLUDE_ALL_GCS
+#include "shenandoahBarrierSetAssembler_x86.hpp"
+#endif
+%}
//----------SOURCE BLOCK-------------------------------------------------------
// This is a block of C++ code which provides values, functions, and
// definitions necessary in the rest of the architecture description
source_hpp %{
@@ -7298,10 +7303,11 @@
enc_flags_ne_to_boolean(res) );
ins_pipe( pipe_cmpxchg );
%}
instruct compareAndSwapP( rRegI res, pRegP mem_ptr, eAXRegP oldval, eCXRegP newval, eFlagsReg cr) %{
+ predicate(!UseShenandoahGC || !ShenandoahCASBarrier || n->in(3)->in(1)->bottom_type() == TypePtr::NULL_PTR);
match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval)));
effect(KILL cr, KILL oldval);
format %{ "CMPXCHG [$mem_ptr],$newval\t# If EAX==[$mem_ptr] Then store $newval into [$mem_ptr]\n\t"
"MOV $res,0\n\t"
"JNE,s fail\n\t"
@@ -7309,10 +7315,32 @@
"fail:" %}
ins_encode( enc_cmpxchg(mem_ptr), enc_flags_ne_to_boolean(res) );
ins_pipe( pipe_cmpxchg );
%}
+instruct compareAndSwapP_shenandoah(rRegI res,
+ memory mem_ptr,
+ eRegP tmp1, eRegP tmp2,
+ eAXRegP oldval, eCXRegP newval,
+ eFlagsReg cr)
+%{
+ predicate(UseShenandoahGC && ShenandoahCASBarrier && n->in(3)->in(1)->bottom_type() != TypePtr::NULL_PTR);
+ match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval)));
+ effect(TEMP tmp1, TEMP tmp2, KILL cr, KILL oldval);
+
+ format %{ "shenandoah_cas_oop $mem_ptr,$newval" %}
+
+ ins_encode %{
+ ShenandoahBarrierSetAssembler::bsasm()->cmpxchg_oop(&_masm,
+ $res$$Register, $mem_ptr$$Address, $oldval$$Register, $newval$$Register,
+ false, // swap
+ $tmp1$$Register, $tmp2$$Register
+ );
+ %}
+ ins_pipe( pipe_cmpxchg );
+%}
+
instruct compareAndSwapI( rRegI res, pRegP mem_ptr, eAXRegI oldval, eCXRegI newval, eFlagsReg cr) %{
match(Set res (CompareAndSwapI mem_ptr (Binary oldval newval)));
effect(KILL cr, KILL oldval);
format %{ "CMPXCHG [$mem_ptr],$newval\t# If EAX==[$mem_ptr] Then store $newval into [$mem_ptr]\n\t"
"MOV $res,0\n\t"
< prev index next >