< prev index next >

src/hotspot/cpu/x86/gc/shenandoah/c1/shenandoahBarrierSetC1_x86.cpp

Print this page




  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 #include "precompiled.hpp"
  25 #include "c1/c1_LIRAssembler.hpp"
  26 #include "c1/c1_MacroAssembler.hpp"
  27 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
  28 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
  29 #include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
  30 
  31 #define __ masm->masm()->
  32 
  33 void LIR_OpShenandoahCompareAndSwap::emit_code(LIR_Assembler* masm) {
  34   NOT_LP64(assert(_addr->is_single_cpu(), "must be single");)
  35   Register addr = _addr->is_single_cpu() ? _addr->as_register() : _addr->as_register_lo();
  36   Register newval = _new_value->as_register();
  37   Register cmpval = _cmp_value->as_register();
  38   Register tmp1 = _tmp1->as_register();
  39   Register tmp2 = _tmp2->as_register();
  40   Register result = result_opr()->as_register();
  41   assert(cmpval == rax, "wrong register");
  42   assert(newval != NULL, "new val must be register");
  43   assert(cmpval != newval, "cmp and new values must be in different registers");
  44   assert(cmpval != addr, "cmp and addr must be in different registers");
  45   assert(newval != addr, "new value and addr must be in different registers");
  46 
  47   // Apply storeval barrier to newval.
  48   ShenandoahBarrierSet::assembler()->storeval_barrier(masm->masm(), newval, tmp1);
  49 
  50 #ifdef _LP64
  51   if (UseCompressedOops) {
  52     __ encode_heap_oop(cmpval);
  53     __ mov(rscratch1, newval);
  54     __ encode_heap_oop(rscratch1);
  55     newval = rscratch1;




  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 #include "precompiled.hpp"
  25 #include "c1/c1_LIRAssembler.hpp"
  26 #include "c1/c1_MacroAssembler.hpp"
  27 #include "gc/shenandoah/shenandoahBarrierSet.hpp"
  28 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
  29 #include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
  30 
  31 #define __ masm->masm()->
  32 
  33 void LIR_OpShenandoahCompareAndSwap::emit_code(LIR_Assembler* masm) {
  34   Register addr = _addr->as_register_lo();

  35   Register newval = _new_value->as_register();
  36   Register cmpval = _cmp_value->as_register();
  37   Register tmp1 = _tmp1->as_register();
  38   Register tmp2 = _tmp2->as_register();
  39   Register result = result_opr()->as_register();
  40   assert(cmpval == rax, "wrong register");
  41   assert(newval != NULL, "new val must be register");
  42   assert(cmpval != newval, "cmp and new values must be in different registers");
  43   assert(cmpval != addr, "cmp and addr must be in different registers");
  44   assert(newval != addr, "new value and addr must be in different registers");
  45 
  46   // Apply storeval barrier to newval.
  47   ShenandoahBarrierSet::assembler()->storeval_barrier(masm->masm(), newval, tmp1);
  48 
  49 #ifdef _LP64
  50   if (UseCompressedOops) {
  51     __ encode_heap_oop(cmpval);
  52     __ mov(rscratch1, newval);
  53     __ encode_heap_oop(rscratch1);
  54     newval = rscratch1;


< prev index next >