src/share/vm/c1/c1_CodeStubs.hpp

Print this page
rev 2161 : [mq]: initial-intrinsification-changes
rev 2162 : [mq]: code-review-comments-vladimir
rev 2163 : [mq]: client_assertion_fauilure
rev 2164 : [mq]: code-review-comments-tom


 502   LIR_Opr length() const                      { return _op->length(); }
 503   LIR_Opr tmp() const                         { return _op->tmp(); }
 504 
 505   virtual void emit_code(LIR_Assembler* e);
 506   virtual CodeEmitInfo* info() const          { return _op->info(); }
 507   virtual void visit(LIR_OpVisitState* visitor) {
 508     // don't pass in the code emit info since it's processed in the fast path
 509     visitor->do_slow_case();
 510   }
 511 #ifndef PRODUCT
 512   virtual void print_name(outputStream* out) const { out->print("ArrayCopyStub"); }
 513 #endif // PRODUCT
 514 };
 515 
 516 //////////////////////////////////////////////////////////////////////////////////////////
 517 #ifndef SERIALGC
 518 
 519 // Code stubs for Garbage-First barriers.
 520 class G1PreBarrierStub: public CodeStub {
 521  private:

 522   LIR_Opr _addr;
 523   LIR_Opr _pre_val;
 524   LIR_PatchCode _patch_code;
 525   CodeEmitInfo* _info;
 526 
 527  public:
 528   // pre_val (a temporary register) must be a register;

 529   // addr (the address of the field to be read) must be a LIR_Address

 530   G1PreBarrierStub(LIR_Opr addr, LIR_Opr pre_val, LIR_PatchCode patch_code, CodeEmitInfo* info) :
 531     _addr(addr), _pre_val(pre_val), _patch_code(patch_code), _info(info)

 532   {
 533     assert(_pre_val->is_register(), "should be temporary register");
 534     assert(_addr->is_address(), "should be the address of the field");
 535   }
 536 









 537   LIR_Opr addr() const { return _addr; }
 538   LIR_Opr pre_val() const { return _pre_val; }
 539   LIR_PatchCode patch_code() const { return _patch_code; }
 540   CodeEmitInfo* info() const { return _info; }

 541 
 542   virtual void emit_code(LIR_Assembler* e);
 543   virtual void visit(LIR_OpVisitState* visitor) {

 544     // don't pass in the code emit info since it's processed in the fast
 545     // path
 546     if (_info != NULL)
 547       visitor->do_slow_case(_info);
 548     else
 549       visitor->do_slow_case();

 550     visitor->do_input(_addr);
 551     visitor->do_temp(_pre_val);




 552   }
 553 #ifndef PRODUCT
 554   virtual void print_name(outputStream* out) const { out->print("G1PreBarrierStub"); }
 555 #endif // PRODUCT
 556 };
 557 
 558 class G1PostBarrierStub: public CodeStub {
 559  private:
 560   LIR_Opr _addr;
 561   LIR_Opr _new_val;
 562 
 563   static jbyte* _byte_map_base;
 564   static jbyte* byte_map_base_slow();
 565   static jbyte* byte_map_base() {
 566     if (_byte_map_base == NULL) {
 567       _byte_map_base = byte_map_base_slow();
 568     }
 569     return _byte_map_base;
 570   }
 571 




 502   LIR_Opr length() const                      { return _op->length(); }
 503   LIR_Opr tmp() const                         { return _op->tmp(); }
 504 
 505   virtual void emit_code(LIR_Assembler* e);
 506   virtual CodeEmitInfo* info() const          { return _op->info(); }
 507   virtual void visit(LIR_OpVisitState* visitor) {
 508     // don't pass in the code emit info since it's processed in the fast path
 509     visitor->do_slow_case();
 510   }
 511 #ifndef PRODUCT
 512   virtual void print_name(outputStream* out) const { out->print("ArrayCopyStub"); }
 513 #endif // PRODUCT
 514 };
 515 
 516 //////////////////////////////////////////////////////////////////////////////////////////
 517 #ifndef SERIALGC
 518 
 519 // Code stubs for Garbage-First barriers.
 520 class G1PreBarrierStub: public CodeStub {
 521  private:
 522   bool _do_load;
 523   LIR_Opr _addr;
 524   LIR_Opr _pre_val;
 525   LIR_PatchCode _patch_code;
 526   CodeEmitInfo* _info;
 527 
 528  public:
 529  
 530   // Version that _does_ generate a load of the previous value from addr.
 531   // addr (the address of the field to be read) must be a LIR_Address
 532   // pre_val (a temporary register) must be a register;
 533   G1PreBarrierStub(LIR_Opr addr, LIR_Opr pre_val, LIR_PatchCode patch_code, CodeEmitInfo* info) :
 534     _addr(addr), _pre_val(pre_val), _do_load(true),
 535     _patch_code(patch_code), _info(info)
 536   {
 537     assert(_pre_val->is_register(), "should be temporary register");
 538     assert(_addr->is_address(), "should be the address of the field");
 539   }
 540 
 541   // Version that _does not_ generate load of the previous value; the
 542   // previous value is assumed to have already been loaded into pre_val.
 543   G1PreBarrierStub(LIR_Opr pre_val) :
 544     _addr(LIR_OprFact::illegalOpr), _pre_val(pre_val), _do_load(false),
 545     _patch_code(lir_patch_none), _info(NULL)
 546   {
 547     assert(_pre_val->is_register(), "should be a register");
 548   }
 549 
 550   LIR_Opr addr() const { return _addr; }
 551   LIR_Opr pre_val() const { return _pre_val; }
 552   LIR_PatchCode patch_code() const { return _patch_code; }
 553   CodeEmitInfo* info() const { return _info; }
 554   bool do_load() const { return _do_load; }
 555 
 556   virtual void emit_code(LIR_Assembler* e);
 557   virtual void visit(LIR_OpVisitState* visitor) {
 558     if (_do_load) {
 559       // don't pass in the code emit info since it's processed in the fast
 560       // path
 561       if (_info != NULL)
 562         visitor->do_slow_case(_info);
 563       else
 564         visitor->do_slow_case();
 565 
 566       visitor->do_input(_addr);
 567       visitor->do_temp(_pre_val);
 568     } else {
 569       visitor->do_slow_case();
 570       visitor->do_input(_pre_val);
 571     }
 572   }
 573 #ifndef PRODUCT
 574   virtual void print_name(outputStream* out) const { out->print("G1PreBarrierStub"); }
 575 #endif // PRODUCT
 576 };
 577 
 578 class G1PostBarrierStub: public CodeStub {
 579  private:
 580   LIR_Opr _addr;
 581   LIR_Opr _new_val;
 582 
 583   static jbyte* _byte_map_base;
 584   static jbyte* byte_map_base_slow();
 585   static jbyte* byte_map_base() {
 586     if (_byte_map_base == NULL) {
 587       _byte_map_base = byte_map_base_slow();
 588     }
 589     return _byte_map_base;
 590   }
 591