469 ArrayCopyStub(LIR_OpArrayCopy* op): _op(op) { }
470
471 LIR_Opr src() const { return _op->src(); }
472 LIR_Opr src_pos() const { return _op->src_pos(); }
473 LIR_Opr dst() const { return _op->dst(); }
474 LIR_Opr dst_pos() const { return _op->dst_pos(); }
475 LIR_Opr length() const { return _op->length(); }
476 LIR_Opr tmp() const { return _op->tmp(); }
477
478 virtual void emit_code(LIR_Assembler* e);
479 virtual CodeEmitInfo* info() const { return _op->info(); }
480 virtual void visit(LIR_OpVisitState* visitor) {
481 // don't pass in the code emit info since it's processed in the fast path
482 visitor->do_slow_case();
483 }
484 #ifndef PRODUCT
485 virtual void print_name(outputStream* out) const { out->print("ArrayCopyStub"); }
486 #endif // PRODUCT
487 };
488
|
469 ArrayCopyStub(LIR_OpArrayCopy* op): _op(op) { }
470
471 LIR_Opr src() const { return _op->src(); }
472 LIR_Opr src_pos() const { return _op->src_pos(); }
473 LIR_Opr dst() const { return _op->dst(); }
474 LIR_Opr dst_pos() const { return _op->dst_pos(); }
475 LIR_Opr length() const { return _op->length(); }
476 LIR_Opr tmp() const { return _op->tmp(); }
477
478 virtual void emit_code(LIR_Assembler* e);
479 virtual CodeEmitInfo* info() const { return _op->info(); }
480 virtual void visit(LIR_OpVisitState* visitor) {
481 // don't pass in the code emit info since it's processed in the fast path
482 visitor->do_slow_case();
483 }
484 #ifndef PRODUCT
485 virtual void print_name(outputStream* out) const { out->print("ArrayCopyStub"); }
486 #endif // PRODUCT
487 };
488
489 //////////////////////////////////////////////////////////////////////////////////////////
490 #ifndef SERIALGC
491
492 // Code stubs for Garbage-First barriers.
493 class G1PreBarrierStub: public CodeStub {
494 private:
495 LIR_Opr _addr;
496 LIR_Opr _pre_val;
497 LIR_PatchCode _patch_code;
498 CodeEmitInfo* _info;
499
500 public:
501 // pre_val (a temporary register) must be a register;
502 // addr (the address of the field to be read) must be a LIR_Address
503 G1PreBarrierStub(LIR_Opr addr, LIR_Opr pre_val, LIR_PatchCode patch_code, CodeEmitInfo* info) :
504 _addr(addr), _pre_val(pre_val), _patch_code(patch_code), _info(info)
505 {
506 assert(_pre_val->is_register(), "should be temporary register");
507 assert(_addr->is_address(), "should be the address of the field");
508 }
509
510 LIR_Opr addr() const { return _addr; }
511 LIR_Opr pre_val() const { return _pre_val; }
512 LIR_PatchCode patch_code() const { return _patch_code; }
513 CodeEmitInfo* info() const { return _info; }
514
515 virtual void emit_code(LIR_Assembler* e);
516 virtual void visit(LIR_OpVisitState* visitor) {
517 // don't pass in the code emit info since it's processed in the fast
518 // path
519 if (_info != NULL)
520 visitor->do_slow_case(_info);
521 else
522 visitor->do_slow_case();
523 visitor->do_input(_addr);
524 visitor->do_temp(_pre_val);
525 }
526 #ifndef PRODUCT
527 virtual void print_name(outputStream* out) const { out->print("G1PreBarrierStub"); }
528 #endif // PRODUCT
529 };
530
531 class G1PostBarrierStub: public CodeStub {
532 private:
533 LIR_Opr _addr;
534 LIR_Opr _new_val;
535
536 static jbyte* _byte_map_base;
537 static jbyte* byte_map_base_slow();
538 static jbyte* byte_map_base() {
539 if (_byte_map_base == NULL) {
540 _byte_map_base = byte_map_base_slow();
541 }
542 return _byte_map_base;
543 }
544
545 public:
546 // addr (the address of the object head) and new_val must be registers.
547 G1PostBarrierStub(LIR_Opr addr, LIR_Opr new_val): _addr(addr), _new_val(new_val) { }
548
549 LIR_Opr addr() const { return _addr; }
550 LIR_Opr new_val() const { return _new_val; }
551
552 virtual void emit_code(LIR_Assembler* e);
553 virtual void visit(LIR_OpVisitState* visitor) {
554 // don't pass in the code emit info since it's processed in the fast path
555 visitor->do_slow_case();
556 visitor->do_input(_addr);
557 visitor->do_input(_new_val);
558 }
559 #ifndef PRODUCT
560 virtual void print_name(outputStream* out) const { out->print("G1PostBarrierStub"); }
561 #endif // PRODUCT
562 };
563
564 #endif // SERIALGC
565 //////////////////////////////////////////////////////////////////////////////////////////
|