< prev index next >

src/hotspot/cpu/x86/gc/shenandoah/shenandoah_x86_64.ad

Print this page
rev 54386 : 8221766: Load-reference barriers for Shenandoah


   6 // published by the Free Software Foundation.
   7 //
   8 // This code is distributed in the hope that it will be useful, but WITHOUT
   9 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  11 // version 2 for more details (a copy is included in the LICENSE file that
  12 // accompanied this code).
  13 //
  14 // You should have received a copy of the GNU General Public License version
  15 // 2 along with this work; if not, write to the Free Software Foundation,
  16 // Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17 //
  18 // Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19 // or visit www.oracle.com if you need additional information or have any
  20 // questions.
  21 //
  22 //
  23 
  24 source_hpp %{
  25 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
  26 %}
  27 
  28 instruct shenandoahRB(rRegP dst, rRegP src, rFlagsReg cr) %{
  29   match(Set dst (ShenandoahReadBarrier src));
  30   effect(DEF dst, USE src);
  31   ins_cost(125); // XXX
  32   format %{ "shenandoah_rb $dst, $src" %}
  33   ins_encode %{
  34     Register d = $dst$$Register;
  35     Register s = $src$$Register;
  36     __ movptr(d, Address(s, ShenandoahBrooksPointer::byte_offset()));
  37   %}
  38   ins_pipe(ialu_reg_mem);
  39 %}
  40 
  41 instruct shenandoahRBNarrow(rRegP dst, rRegN src) %{
  42   predicate(UseCompressedOops && (Universe::narrow_oop_shift() == 0));
  43   match(Set dst (ShenandoahReadBarrier (DecodeN src)));
  44   effect(DEF dst, USE src);
  45   ins_cost(125); // XXX
  46   format %{ "shenandoah_rb $dst, $src" %}
  47   ins_encode %{
  48     Register d = $dst$$Register;
  49     Register s = $src$$Register;
  50     __ movptr(d, Address(r12, s, Address::times_1, ShenandoahBrooksPointer::byte_offset()));
  51   %}
  52   ins_pipe(ialu_reg_mem);
  53 %}
  54 
  55 instruct shenandoahRBNarrowShift(rRegP dst, rRegN src) %{
  56   predicate(UseCompressedOops && (Universe::narrow_oop_shift() == Address::times_8));
  57   match(Set dst (ShenandoahReadBarrier (DecodeN src)));
  58   effect(DEF dst, USE src);
  59   ins_cost(125); // XXX
  60   format %{ "shenandoah_rb $dst, $src" %}
  61   ins_encode %{
  62     Register d = $dst$$Register;
  63     Register s = $src$$Register;
  64     __ movptr(d, Address(r12, s, Address::times_8, ShenandoahBrooksPointer::byte_offset()));
  65   %}
  66   ins_pipe(ialu_reg_mem);
  67 %}
  68 
  69 instruct compareAndSwapP_shenandoah(rRegI res,
  70                                     memory mem_ptr,
  71                                     rRegP tmp1, rRegP tmp2,
  72                                     rax_RegP oldval, rRegP newval,
  73                                     rFlagsReg cr)
  74 %{
  75   predicate(VM_Version::supports_cx8());
  76   match(Set res (ShenandoahCompareAndSwapP mem_ptr (Binary oldval newval)));
  77   match(Set res (ShenandoahWeakCompareAndSwapP mem_ptr (Binary oldval newval)));
  78   effect(TEMP tmp1, TEMP tmp2, KILL cr, KILL oldval);
  79 
  80   format %{ "shenandoah_cas_oop $mem_ptr,$newval" %}
  81 
  82   ins_encode %{
  83     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm,
  84                                                    $res$$Register, $mem_ptr$$Address, $oldval$$Register, $newval$$Register,
  85                                                    false, // swap
  86                                                    $tmp1$$Register, $tmp2$$Register




   6 // published by the Free Software Foundation.
   7 //
   8 // This code is distributed in the hope that it will be useful, but WITHOUT
   9 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  11 // version 2 for more details (a copy is included in the LICENSE file that
  12 // accompanied this code).
  13 //
  14 // You should have received a copy of the GNU General Public License version
  15 // 2 along with this work; if not, write to the Free Software Foundation,
  16 // Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17 //
  18 // Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19 // or visit www.oracle.com if you need additional information or have any
  20 // questions.
  21 //
  22 //
  23 
  24 source_hpp %{
  25 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
  26 #include "gc/shenandoah/c2/shenandoahSupport.hpp"








































  27 %}
  28 
  29 instruct compareAndSwapP_shenandoah(rRegI res,
  30                                     memory mem_ptr,
  31                                     rRegP tmp1, rRegP tmp2,
  32                                     rax_RegP oldval, rRegP newval,
  33                                     rFlagsReg cr)
  34 %{
  35   predicate(VM_Version::supports_cx8());
  36   match(Set res (ShenandoahCompareAndSwapP mem_ptr (Binary oldval newval)));
  37   match(Set res (ShenandoahWeakCompareAndSwapP mem_ptr (Binary oldval newval)));
  38   effect(TEMP tmp1, TEMP tmp2, KILL cr, KILL oldval);
  39 
  40   format %{ "shenandoah_cas_oop $mem_ptr,$newval" %}
  41 
  42   ins_encode %{
  43     ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm,
  44                                                    $res$$Register, $mem_ptr$$Address, $oldval$$Register, $newval$$Register,
  45                                                    false, // swap
  46                                                    $tmp1$$Register, $tmp2$$Register


< prev index next >