< prev index next >

src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp

Print this page
rev 50081 : [mq]: primitives2.patch


 474     __ pop(rcx);
 475     __ pop(rbx);
 476   }
 477   if (ShenandoahStoreValReadBarrier) {
 478     read_barrier_impl(masm, dst);
 479   }
 480 #else
 481   Unimplemented();
 482 #endif
 483 }
 484 
 485 void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
 486              Register dst, Address src, Register tmp1, Register tmp_thread) {
 487   bool on_oop = type == T_OBJECT || type == T_ARRAY;
 488   bool in_heap = (decorators & IN_HEAP) != 0;
 489   bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
 490   bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
 491   bool on_reference = on_weak || on_phantom;
 492   // tty->print_cr("RB src.base: %s", src.base()->name());
 493   // __ verify_oop(src.base(), "broken oop before RB");
 494   /*
 495   if (in_heap) {
 496     read_barrier_not_null(masm, src.base());
 497   }
 498   */
 499   // __ verify_oop(src.base(), "broken oop before RB");
 500   BarrierSetAssembler::load_at(masm, decorators, type, dst, src, tmp1, tmp_thread);
 501   if (ShenandoahKeepAliveBarrier && on_oop && on_reference) {
 502     const Register thread = NOT_LP64(tmp_thread) LP64_ONLY(r15_thread);
 503     NOT_LP64(__ get_thread(thread));
 504 
 505     // Generate the SATB pre-barrier code to log the value of
 506     // the referent field in an SATB buffer.
 507     shenandoah_write_barrier_pre(masm /* masm */,
 508                                  noreg /* obj */,
 509                                  dst /* pre_val */,
 510                                  thread /* thread */,
 511                                  tmp1 /* tmp */,
 512                                  true /* tosca_live */,
 513                                  true /* expand_call */);
 514   }
 515 }
 516 
 517 void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
 518               Address dst, Register val, Register tmp1, Register tmp2) {
 519 
 520   bool in_heap = (decorators & IN_HEAP) != 0;
 521   bool in_concurrent_root = (decorators & IN_CONCURRENT_ROOT) != 0;
 522   /*
 523   if (in_heap) {
 524     write_barrier(masm, dst.base());
 525   }
 526   */
 527   if (type == T_OBJECT || type == T_ARRAY) {
 528     bool needs_pre_barrier = in_heap || in_concurrent_root;
 529     bool needs_post_barrier = val != noreg && in_heap && UseShenandoahMatrix;
 530 
 531     Register tmp3 = LP64_ONLY(r8) NOT_LP64(rsi);
 532     Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
 533     // flatten object address if needed
 534     // We do it regardless of precise because we need the registers
 535     if (dst.index() == noreg && dst.disp() == 0) {
 536       if (dst.base() != tmp1) {
 537         __ movptr(tmp1, dst.base());
 538       }
 539     } else {
 540       __ lea(tmp1, dst);
 541     }
 542 
 543 #ifndef _LP64
 544     InterpreterMacroAssembler *imasm = static_cast<InterpreterMacroAssembler*>(masm);
 545 #endif
 546 




 474     __ pop(rcx);
 475     __ pop(rbx);
 476   }
 477   if (ShenandoahStoreValReadBarrier) {
 478     read_barrier_impl(masm, dst);
 479   }
 480 #else
 481   Unimplemented();
 482 #endif
 483 }
 484 
 485 void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
 486              Register dst, Address src, Register tmp1, Register tmp_thread) {
 487   bool on_oop = type == T_OBJECT || type == T_ARRAY;
 488   bool in_heap = (decorators & IN_HEAP) != 0;
 489   bool on_weak = (decorators & ON_WEAK_OOP_REF) != 0;
 490   bool on_phantom = (decorators & ON_PHANTOM_OOP_REF) != 0;
 491   bool on_reference = on_weak || on_phantom;
 492   // tty->print_cr("RB src.base: %s", src.base()->name());
 493   // __ verify_oop(src.base(), "broken oop before RB");

 494   if (in_heap) {
 495     read_barrier_not_null(masm, src.base());
 496   }

 497   // __ verify_oop(src.base(), "broken oop before RB");
 498   BarrierSetAssembler::load_at(masm, decorators, type, dst, src, tmp1, tmp_thread);
 499   if (ShenandoahKeepAliveBarrier && on_oop && on_reference) {
 500     const Register thread = NOT_LP64(tmp_thread) LP64_ONLY(r15_thread);
 501     NOT_LP64(__ get_thread(thread));
 502 
 503     // Generate the SATB pre-barrier code to log the value of
 504     // the referent field in an SATB buffer.
 505     shenandoah_write_barrier_pre(masm /* masm */,
 506                                  noreg /* obj */,
 507                                  dst /* pre_val */,
 508                                  thread /* thread */,
 509                                  tmp1 /* tmp */,
 510                                  true /* tosca_live */,
 511                                  true /* expand_call */);
 512   }
 513 }
 514 
 515 void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
 516               Address dst, Register val, Register tmp1, Register tmp2) {
 517 
 518   bool in_heap = (decorators & IN_HEAP) != 0;
 519   bool in_concurrent_root = (decorators & IN_CONCURRENT_ROOT) != 0;

 520   if (in_heap) {
 521     write_barrier(masm, dst.base());
 522   }

 523   if (type == T_OBJECT || type == T_ARRAY) {
 524     bool needs_pre_barrier = in_heap || in_concurrent_root;
 525     bool needs_post_barrier = val != noreg && in_heap && UseShenandoahMatrix;
 526 
 527     Register tmp3 = LP64_ONLY(r8) NOT_LP64(rsi);
 528     Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx);
 529     // flatten object address if needed
 530     // We do it regardless of precise because we need the registers
 531     if (dst.index() == noreg && dst.disp() == 0) {
 532       if (dst.base() != tmp1) {
 533         __ movptr(tmp1, dst.base());
 534       }
 535     } else {
 536       __ lea(tmp1, dst);
 537     }
 538 
 539 #ifndef _LP64
 540     InterpreterMacroAssembler *imasm = static_cast<InterpreterMacroAssembler*>(masm);
 541 #endif
 542 


< prev index next >