< prev index next >

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Print this page
rev 50076 : Fold Partial GC into Traversal GC


4069 
4070 void MacroAssembler::store_heap_oop(Address dst, Register src) {
4071   if (UseCompressedOops) {
4072     assert(!dst.uses(src), "not enough registers");
4073     encode_heap_oop(src);
4074     strw(src, dst);
4075   } else
4076     str(src, dst);
4077 }
4078 
4079 // Used for storing NULLs.
4080 void MacroAssembler::store_heap_oop_null(Address dst) {
4081   if (UseCompressedOops) {
4082     strw(zr, dst);
4083   } else
4084     str(zr, dst);
4085 }
4086 
4087 #ifdef INCLUDE_ALL_GCS
4088 void MacroAssembler::shenandoah_write_barrier(Register dst) {
4089   assert(UseShenandoahGC && (ShenandoahWriteBarrier || ShenandoahStoreValWriteBarrier || ShenandoahStoreValEnqueueBarrier), "Should be enabled");
4090   assert(dst != rscratch1, "need rscratch1");
4091   assert(dst != rscratch2, "need rscratch2");
4092 
4093   Label done;
4094 
4095   // Check for evacuation-in-progress
4096   Address gc_state(rthread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
4097   ldrb(rscratch1, gc_state);
4098 
4099   // The read-barrier.
4100   if (ShenandoahWriteBarrierRB) {
4101     ldr(dst, Address(dst, BrooksPointer::byte_offset()));
4102   }
4103 
4104   // Evac-check ...
4105   mov(rscratch2, ShenandoahHeap::EVACUATION | ShenandoahHeap::PARTIAL | ShenandoahHeap::TRAVERSAL);
4106   tst(rscratch1, rscratch2);
4107   br(Assembler::EQ, done);
4108 
4109   RegSet to_save = RegSet::of(r0);
4110   if (dst != r0) {
4111     push(to_save, sp);
4112     mov(r0, dst);
4113   }
4114 
4115   assert(StubRoutines::aarch64::shenandoah_wb() != NULL, "need write barrier stub");
4116   far_call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::aarch64::shenandoah_wb())));
4117 
4118   if (dst != r0) {
4119     mov(dst, r0);
4120     pop(to_save, sp);
4121   }
4122   block_comment("} Shenandoah write barrier");
4123 
4124   bind(done);
4125 }




4069 
4070 void MacroAssembler::store_heap_oop(Address dst, Register src) {
4071   if (UseCompressedOops) {
4072     assert(!dst.uses(src), "not enough registers");
4073     encode_heap_oop(src);
4074     strw(src, dst);
4075   } else
4076     str(src, dst);
4077 }
4078 
4079 // Used for storing NULLs.
4080 void MacroAssembler::store_heap_oop_null(Address dst) {
4081   if (UseCompressedOops) {
4082     strw(zr, dst);
4083   } else
4084     str(zr, dst);
4085 }
4086 
4087 #ifdef INCLUDE_ALL_GCS
4088 void MacroAssembler::shenandoah_write_barrier(Register dst) {
4089   assert(UseShenandoahGC && (ShenandoahWriteBarrier || ShenandoahStoreValEnqueueBarrier), "Should be enabled");
4090   assert(dst != rscratch1, "need rscratch1");
4091   assert(dst != rscratch2, "need rscratch2");
4092 
4093   Label done;
4094 
4095   // Check for evacuation-in-progress
4096   Address gc_state(rthread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
4097   ldrb(rscratch1, gc_state);
4098 
4099   // The read-barrier.
4100   if (ShenandoahWriteBarrierRB) {
4101     ldr(dst, Address(dst, BrooksPointer::byte_offset()));
4102   }
4103 
4104   // Evac-check ...
4105   mov(rscratch2, ShenandoahHeap::EVACUATION | ShenandoahHeap::TRAVERSAL);
4106   tst(rscratch1, rscratch2);
4107   br(Assembler::EQ, done);
4108 
4109   RegSet to_save = RegSet::of(r0);
4110   if (dst != r0) {
4111     push(to_save, sp);
4112     mov(r0, dst);
4113   }
4114 
4115   assert(StubRoutines::aarch64::shenandoah_wb() != NULL, "need write barrier stub");
4116   far_call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::aarch64::shenandoah_wb())));
4117 
4118   if (dst != r0) {
4119     mov(dst, r0);
4120     pop(to_save, sp);
4121   }
4122   block_comment("} Shenandoah write barrier");
4123 
4124   bind(done);
4125 }


< prev index next >