< prev index next >

src/share/vm/c1/c1_CodeStubs.hpp

Print this page
rev 12906 : [mq]: gc_interface


 514   ArrayCopyStub(LIR_OpArrayCopy* op): _op(op) { }
 515 
 516   LIR_Opr src() const                         { return _op->src(); }
 517   LIR_Opr src_pos() const                     { return _op->src_pos(); }
 518   LIR_Opr dst() const                         { return _op->dst(); }
 519   LIR_Opr dst_pos() const                     { return _op->dst_pos(); }
 520   LIR_Opr length() const                      { return _op->length(); }
 521   LIR_Opr tmp() const                         { return _op->tmp(); }
 522 
 523   virtual void emit_code(LIR_Assembler* e);
 524   virtual CodeEmitInfo* info() const          { return _op->info(); }
 525   virtual void visit(LIR_OpVisitState* visitor) {
 526     // don't pass in the code emit info since it's processed in the fast path
 527     visitor->do_slow_case();
 528   }
 529 #ifndef PRODUCT
 530   virtual void print_name(outputStream* out) const { out->print("ArrayCopyStub"); }
 531 #endif // PRODUCT
 532 };
 533 
 534 //////////////////////////////////////////////////////////////////////////////////////////
 535 #if INCLUDE_ALL_GCS
 536 
 537 // Code stubs for Garbage-First barriers.
 538 class G1PreBarrierStub: public CodeStub {
 539  private:
 540   bool _do_load;
 541   LIR_Opr _addr;
 542   LIR_Opr _pre_val;
 543   LIR_PatchCode _patch_code;
 544   CodeEmitInfo* _info;
 545 
 546  public:
 547   // Version that _does_ generate a load of the previous value from addr.
 548   // addr (the address of the field to be read) must be a LIR_Address
 549   // pre_val (a temporary register) must be a register;
 550   G1PreBarrierStub(LIR_Opr addr, LIR_Opr pre_val, LIR_PatchCode patch_code, CodeEmitInfo* info) :
 551     _addr(addr), _pre_val(pre_val), _do_load(true),
 552     _patch_code(patch_code), _info(info)
 553   {
 554     assert(_pre_val->is_register(), "should be temporary register");
 555     assert(_addr->is_address(), "should be the address of the field");
 556   }
 557 
 558   // Version that _does not_ generate load of the previous value; the
 559   // previous value is assumed to have already been loaded into pre_val.
 560   G1PreBarrierStub(LIR_Opr pre_val) :
 561     _addr(LIR_OprFact::illegalOpr), _pre_val(pre_val), _do_load(false),
 562     _patch_code(lir_patch_none), _info(NULL)
 563   {
 564     assert(_pre_val->is_register(), "should be a register");
 565   }
 566 
 567   LIR_Opr addr() const { return _addr; }
 568   LIR_Opr pre_val() const { return _pre_val; }
 569   LIR_PatchCode patch_code() const { return _patch_code; }
 570   CodeEmitInfo* info() const { return _info; }
 571   bool do_load() const { return _do_load; }
 572 
 573   virtual void emit_code(LIR_Assembler* e);
 574   virtual void visit(LIR_OpVisitState* visitor) {
 575     if (_do_load) {
 576       // don't pass in the code emit info since it's processed in the fast
 577       // path
 578       if (_info != NULL)
 579         visitor->do_slow_case(_info);
 580       else
 581         visitor->do_slow_case();
 582 
 583       visitor->do_input(_addr);
 584       visitor->do_temp(_pre_val);
 585     } else {
 586       visitor->do_slow_case();
 587       visitor->do_input(_pre_val);
 588     }
 589   }
 590 #ifndef PRODUCT
 591   virtual void print_name(outputStream* out) const { out->print("G1PreBarrierStub"); }
 592 #endif // PRODUCT
 593 };
 594 
 595 class G1PostBarrierStub: public CodeStub {
 596  private:
 597   LIR_Opr _addr;
 598   LIR_Opr _new_val;
 599 
 600  public:
 601   // addr (the address of the object head) and new_val must be registers.
 602   G1PostBarrierStub(LIR_Opr addr, LIR_Opr new_val): _addr(addr), _new_val(new_val) { }
 603 
 604   LIR_Opr addr() const { return _addr; }
 605   LIR_Opr new_val() const { return _new_val; }
 606 
 607   virtual void emit_code(LIR_Assembler* e);
 608   virtual void visit(LIR_OpVisitState* visitor) {
 609     // don't pass in the code emit info since it's processed in the fast path
 610     visitor->do_slow_case();
 611     visitor->do_input(_addr);
 612     visitor->do_input(_new_val);
 613   }
 614 #ifndef PRODUCT
 615   virtual void print_name(outputStream* out) const { out->print("G1PostBarrierStub"); }
 616 #endif // PRODUCT
 617 };
 618 
 619 #endif // INCLUDE_ALL_GCS
 620 //////////////////////////////////////////////////////////////////////////////////////////
 621 
 622 #endif // SHARE_VM_C1_C1_CODESTUBS_HPP


 514   ArrayCopyStub(LIR_OpArrayCopy* op): _op(op) { }
 515 
 516   LIR_Opr src() const                         { return _op->src(); }
 517   LIR_Opr src_pos() const                     { return _op->src_pos(); }
 518   LIR_Opr dst() const                         { return _op->dst(); }
 519   LIR_Opr dst_pos() const                     { return _op->dst_pos(); }
 520   LIR_Opr length() const                      { return _op->length(); }
 521   LIR_Opr tmp() const                         { return _op->tmp(); }
 522 
 523   virtual void emit_code(LIR_Assembler* e);
 524   virtual CodeEmitInfo* info() const          { return _op->info(); }
 525   virtual void visit(LIR_OpVisitState* visitor) {
 526     // don't pass in the code emit info since it's processed in the fast path
 527     visitor->do_slow_case();
 528   }
 529 #ifndef PRODUCT
 530   virtual void print_name(outputStream* out) const { out->print("ArrayCopyStub"); }
 531 #endif // PRODUCT
 532 };
 533 
























































































 534 #endif // SHARE_VM_C1_C1_CODESTUBS_HPP
< prev index next >