< prev index next >

src/hotspot/share/gc/shenandoah/c1/shenandoahBarrierSetC1.hpp

Print this page




  72         visitor->do_slow_case(_info);
  73       else
  74         visitor->do_slow_case();
  75 
  76       visitor->do_input(_addr);
  77       visitor->do_temp(_pre_val);
  78     } else {
  79       visitor->do_slow_case();
  80       visitor->do_input(_pre_val);
  81     }
  82   }
  83 #ifndef PRODUCT
  84   virtual void print_name(outputStream* out) const { out->print("ShenandoahPreBarrierStub"); }
  85 #endif // PRODUCT
  86 };
  87 
  88 class ShenandoahLoadReferenceBarrierStub: public CodeStub {
  89   friend class ShenandoahBarrierSetC1;
  90 private:
  91   LIR_Opr _obj;

  92   LIR_Opr _result;
  93   LIR_Opr _tmp1;
  94   LIR_Opr _tmp2;
  95 
  96 public:
  97   ShenandoahLoadReferenceBarrierStub(LIR_Opr obj, LIR_Opr result, LIR_Opr tmp1, LIR_Opr tmp2) :
  98     _obj(obj), _result(result), _tmp1(tmp1), _tmp2(tmp2)
  99   {
 100     assert(_obj->is_register(), "should be register");

 101     assert(_result->is_register(), "should be register");
 102     assert(_tmp1->is_register(), "should be register");
 103     assert(_tmp2->is_register(), "should be register");
 104   }
 105 
 106   LIR_Opr obj() const { return _obj; }

 107   LIR_Opr result() const { return _result; }
 108   LIR_Opr tmp1() const { return _tmp1; }
 109   LIR_Opr tmp2() const { return _tmp2; }
 110 
 111   virtual void emit_code(LIR_Assembler* e);
 112   virtual void visit(LIR_OpVisitState* visitor) {
 113     visitor->do_slow_case();
 114     visitor->do_input(_obj);



 115     visitor->do_temp(_result);
 116     visitor->do_temp(_tmp1);
 117     visitor->do_temp(_tmp2);
 118   }
 119 #ifndef PRODUCT
 120   virtual void print_name(outputStream* out) const { out->print("ShenandoahLoadReferenceBarrierStub"); }
 121 #endif // PRODUCT
 122 };
 123 
 124 class LIR_OpShenandoahCompareAndSwap : public LIR_Op {
 125  friend class LIR_OpVisitState;
 126 
 127 private:
 128   LIR_Opr _addr;
 129   LIR_Opr _cmp_value;
 130   LIR_Opr _new_value;
 131   LIR_Opr _tmp1;
 132   LIR_Opr _tmp2;
 133 
 134 public:


 169     addr()->print(out);      out->print(" ");
 170     cmp_value()->print(out); out->print(" ");
 171     new_value()->print(out); out->print(" ");
 172     tmp1()->print(out);      out->print(" ");
 173     tmp2()->print(out);      out->print(" ");
 174   }
 175 #ifndef PRODUCT
 176   virtual const char* name() const {
 177     return "shenandoah_cas_obj";
 178   }
 179 #endif // PRODUCT
 180 };
 181 
 182 class ShenandoahBarrierSetC1 : public BarrierSetC1 {
 183 private:
 184   CodeBlob* _pre_barrier_c1_runtime_code_blob;
 185   CodeBlob* _load_reference_barrier_rt_code_blob;
 186 
 187   void pre_barrier(LIRGenerator* gen, CodeEmitInfo* info, DecoratorSet decorators, LIR_Opr addr_opr, LIR_Opr pre_val);
 188 
 189   LIR_Opr load_reference_barrier(LIRGenerator* gen, LIR_Opr obj);
 190   LIR_Opr storeval_barrier(LIRGenerator* gen, LIR_Opr obj, CodeEmitInfo* info, DecoratorSet decorators);
 191 
 192   LIR_Opr load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj);
 193 
 194   LIR_Opr ensure_in_register(LIRGenerator* gen, LIR_Opr obj);
 195 
 196 public:
 197   ShenandoahBarrierSetC1();
 198 
 199   CodeBlob* pre_barrier_c1_runtime_code_blob() {
 200     assert(_pre_barrier_c1_runtime_code_blob != NULL, "");
 201     return _pre_barrier_c1_runtime_code_blob;
 202   }
 203 
 204   CodeBlob* load_reference_barrier_rt_code_blob() {
 205     assert(_load_reference_barrier_rt_code_blob != NULL, "");
 206     return _load_reference_barrier_rt_code_blob;
 207   }
 208 
 209 protected:
 210 
 211   virtual void store_at_resolved(LIRAccess& access, LIR_Opr value);

 212   virtual void load_at_resolved(LIRAccess& access, LIR_Opr result);
 213 
 214   virtual LIR_Opr atomic_cmpxchg_at_resolved(LIRAccess& access, LIRItem& cmp_value, LIRItem& new_value);
 215 
 216   virtual LIR_Opr atomic_xchg_at_resolved(LIRAccess& access, LIRItem& value);
 217 
 218 public:
 219 
 220   virtual void generate_c1_runtime_stubs(BufferBlob* buffer_blob);
 221   virtual const char* rtcall_name_for_address(address entry);
 222 };
 223 
 224 #endif // SHARE_GC_SHENANDOAH_C1_SHENANDOAHBARRIERSETC1_HPP


  72         visitor->do_slow_case(_info);
  73       else
  74         visitor->do_slow_case();
  75 
  76       visitor->do_input(_addr);
  77       visitor->do_temp(_pre_val);
  78     } else {
  79       visitor->do_slow_case();
  80       visitor->do_input(_pre_val);
  81     }
  82   }
  83 #ifndef PRODUCT
  84   virtual void print_name(outputStream* out) const { out->print("ShenandoahPreBarrierStub"); }
  85 #endif // PRODUCT
  86 };
  87 
  88 class ShenandoahLoadReferenceBarrierStub: public CodeStub {
  89   friend class ShenandoahBarrierSetC1;
  90 private:
  91   LIR_Opr _obj;
  92   LIR_Opr _addr;
  93   LIR_Opr _result;
  94   LIR_Opr _tmp1;
  95   LIR_Opr _tmp2;
  96 
  97 public:
  98   ShenandoahLoadReferenceBarrierStub(LIR_Opr obj, LIR_Opr addr, LIR_Opr result, LIR_Opr tmp1, LIR_Opr tmp2) :
  99     _obj(obj), _addr(addr), _result(result), _tmp1(tmp1), _tmp2(tmp2)
 100   {
 101     assert(_obj->is_register(), "should be register");
 102     assert(_addr->is_register(), "should be register");
 103     assert(_result->is_register(), "should be register");
 104     assert(_tmp1->is_register(), "should be register");
 105     assert(_tmp2->is_register(), "should be register");
 106   }
 107 
 108   LIR_Opr obj() const { return _obj; }
 109   LIR_Opr addr() const { return _addr; }
 110   LIR_Opr result() const { return _result; }
 111   LIR_Opr tmp1() const { return _tmp1; }
 112   LIR_Opr tmp2() const { return _tmp2; }
 113 
 114   virtual void emit_code(LIR_Assembler* e);
 115   virtual void visit(LIR_OpVisitState* visitor) {
 116     visitor->do_slow_case();
 117     visitor->do_input(_obj);
 118     visitor->do_temp(_obj);
 119     visitor->do_input(_addr);
 120     visitor->do_temp(_addr);
 121     visitor->do_temp(_result);
 122     visitor->do_temp(_tmp1);
 123     visitor->do_temp(_tmp2);
 124   }
 125 #ifndef PRODUCT
 126   virtual void print_name(outputStream* out) const { out->print("ShenandoahLoadReferenceBarrierStub"); }
 127 #endif // PRODUCT
 128 };
 129 
 130 class LIR_OpShenandoahCompareAndSwap : public LIR_Op {
 131  friend class LIR_OpVisitState;
 132 
 133 private:
 134   LIR_Opr _addr;
 135   LIR_Opr _cmp_value;
 136   LIR_Opr _new_value;
 137   LIR_Opr _tmp1;
 138   LIR_Opr _tmp2;
 139 
 140 public:


 175     addr()->print(out);      out->print(" ");
 176     cmp_value()->print(out); out->print(" ");
 177     new_value()->print(out); out->print(" ");
 178     tmp1()->print(out);      out->print(" ");
 179     tmp2()->print(out);      out->print(" ");
 180   }
 181 #ifndef PRODUCT
 182   virtual const char* name() const {
 183     return "shenandoah_cas_obj";
 184   }
 185 #endif // PRODUCT
 186 };
 187 
 188 class ShenandoahBarrierSetC1 : public BarrierSetC1 {
 189 private:
 190   CodeBlob* _pre_barrier_c1_runtime_code_blob;
 191   CodeBlob* _load_reference_barrier_rt_code_blob;
 192 
 193   void pre_barrier(LIRGenerator* gen, CodeEmitInfo* info, DecoratorSet decorators, LIR_Opr addr_opr, LIR_Opr pre_val);
 194 
 195   LIR_Opr load_reference_barrier(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr);
 196   LIR_Opr storeval_barrier(LIRGenerator* gen, LIR_Opr obj, CodeEmitInfo* info, DecoratorSet decorators);
 197 
 198   LIR_Opr load_reference_barrier_impl(LIRGenerator* gen, LIR_Opr obj, LIR_Opr addr);
 199 
 200   LIR_Opr ensure_in_register(LIRGenerator* gen, LIR_Opr obj);
 201 
 202 public:
 203   ShenandoahBarrierSetC1();
 204 
 205   CodeBlob* pre_barrier_c1_runtime_code_blob() {
 206     assert(_pre_barrier_c1_runtime_code_blob != NULL, "");
 207     return _pre_barrier_c1_runtime_code_blob;
 208   }
 209 
 210   CodeBlob* load_reference_barrier_rt_code_blob() {
 211     assert(_load_reference_barrier_rt_code_blob != NULL, "");
 212     return _load_reference_barrier_rt_code_blob;
 213   }
 214 
 215 protected:
 216 
 217   virtual void store_at_resolved(LIRAccess& access, LIR_Opr value);
 218   virtual LIR_Opr resolve_address(LIRAccess& access, bool resolve_in_register);
 219   virtual void load_at_resolved(LIRAccess& access, LIR_Opr result);
 220 
 221   virtual LIR_Opr atomic_cmpxchg_at_resolved(LIRAccess& access, LIRItem& cmp_value, LIRItem& new_value);
 222 
 223   virtual LIR_Opr atomic_xchg_at_resolved(LIRAccess& access, LIRItem& value);
 224 
 225 public:
 226 
 227   virtual void generate_c1_runtime_stubs(BufferBlob* buffer_blob);
 228   virtual const char* rtcall_name_for_address(address entry);
 229 };
 230 
 231 #endif // SHARE_GC_SHENANDOAH_C1_SHENANDOAHBARRIERSETC1_HPP
< prev index next >