comparison src/share/vm/c1/c1_CodeStubs.hpp @ 342:37f87013dfd8

6711316: Open source the Garbage-First garbage collector Summary: First mercurial integration of the code for the Garbage-First garbage collector. Reviewed-by: apetrusenko, iveresov, jmasa, sgoldman, tonyp, ysr
author ysr
date Thu, 05 Jun 2008 15:57:56 -0700
parents a61af66fc99e
children 3cf667df43ef
comparison
equal deleted inserted replaced
189:0b27f3512f9e 342:37f87013dfd8
480 } 480 }
481 #ifndef PRODUCT 481 #ifndef PRODUCT
482 virtual void print_name(outputStream* out) const { out->print("ArrayCopyStub"); } 482 virtual void print_name(outputStream* out) const { out->print("ArrayCopyStub"); }
483 #endif // PRODUCT 483 #endif // PRODUCT
484 }; 484 };
485
486 //////////////////////////////////////////////////////////////////////////////////////////
487 #ifndef SERIALGC
488
489 // Code stubs for Garbage-First barriers.
490 class G1PreBarrierStub: public CodeStub {
491 private:
492 LIR_Opr _addr;
493 LIR_Opr _pre_val;
494 LIR_PatchCode _patch_code;
495 CodeEmitInfo* _info;
496
497 public:
498 // pre_val (a temporary register) must be a register;
499 // addr (the address of the field to be read) must be a LIR_Address
500 G1PreBarrierStub(LIR_Opr addr, LIR_Opr pre_val, LIR_PatchCode patch_code, CodeEmitInfo* info) :
501 _addr(addr), _pre_val(pre_val), _patch_code(patch_code), _info(info)
502 {
503 assert(_pre_val->is_register(), "should be temporary register");
504 assert(_addr->is_address(), "should be the address of the field");
505 }
506
507 LIR_Opr addr() const { return _addr; }
508 LIR_Opr pre_val() const { return _pre_val; }
509 LIR_PatchCode patch_code() const { return _patch_code; }
510 CodeEmitInfo* info() const { return _info; }
511
512 virtual void emit_code(LIR_Assembler* e);
513 virtual void visit(LIR_OpVisitState* visitor) {
514 // don't pass in the code emit info since it's processed in the fast
515 // path
516 if (_info != NULL)
517 visitor->do_slow_case(_info);
518 else
519 visitor->do_slow_case();
520 visitor->do_input(_addr);
521 visitor->do_temp(_pre_val);
522 }
523 #ifndef PRODUCT
524 virtual void print_name(outputStream* out) const { out->print("G1PreBarrierStub"); }
525 #endif // PRODUCT
526 };
527
528 class G1PostBarrierStub: public CodeStub {
529 private:
530 LIR_Opr _addr;
531 LIR_Opr _new_val;
532
533 static jbyte* _byte_map_base;
534 static jbyte* byte_map_base_slow();
535 static jbyte* byte_map_base() {
536 if (_byte_map_base == NULL) {
537 _byte_map_base = byte_map_base_slow();
538 }
539 return _byte_map_base;
540 }
541
542 public:
543 // addr (the address of the object head) and new_val must be registers.
544 G1PostBarrierStub(LIR_Opr addr, LIR_Opr new_val): _addr(addr), _new_val(new_val) { }
545
546 LIR_Opr addr() const { return _addr; }
547 LIR_Opr new_val() const { return _new_val; }
548
549 virtual void emit_code(LIR_Assembler* e);
550 virtual void visit(LIR_OpVisitState* visitor) {
551 // don't pass in the code emit info since it's processed in the fast path
552 visitor->do_slow_case();
553 visitor->do_input(_addr);
554 visitor->do_input(_new_val);
555 }
556 #ifndef PRODUCT
557 virtual void print_name(outputStream* out) const { out->print("G1PostBarrierStub"); }
558 #endif // PRODUCT
559 };
560
561 #endif // SERIALGC
562 //////////////////////////////////////////////////////////////////////////////////////////