814 // load of the previous value; otherwise it has already
815 // been loaded into _pre_val.
816
817 __ bind(*stub->entry());
818 assert(stub->pre_val()->is_register(), "Precondition.");
819
820 Register pre_val_reg = stub->pre_val()->as_register();
821
822 if (stub->do_load()) {
823 ce->mem2reg(stub->addr(), stub->pre_val(), T_OBJECT, stub->patch_code(), stub->info(), false /*wide*/, false /*unaligned*/);
824 }
825
826 __ cmpptr(pre_val_reg, (int32_t)NULL_WORD);
827 __ jcc(Assembler::equal, *stub->continuation());
828 ce->store_parameter(stub->pre_val()->as_register(), 0);
829 __ call(RuntimeAddress(bs->pre_barrier_c1_runtime_code_blob()->code_begin()));
830 __ jmp(*stub->continuation());
831
832 }
833
834 #undef __
835
836 #define __ sasm->
837
838 void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler* sasm) {
839 __ prologue("shenandoah_pre_barrier", false);
840 // arg0 : previous value of memory
841
842 __ push(rax);
843 __ push(rdx);
844
845 const Register pre_val = rax;
846 const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread);
847 const Register tmp = rdx;
848
849 NOT_LP64(__ get_thread(thread);)
850
851 Address queue_index(thread, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_index_offset()));
852 Address buffer(thread, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_buffer_offset()));
853
|
814 // load of the previous value; otherwise it has already
815 // been loaded into _pre_val.
816
817 __ bind(*stub->entry());
818 assert(stub->pre_val()->is_register(), "Precondition.");
819
820 Register pre_val_reg = stub->pre_val()->as_register();
821
822 if (stub->do_load()) {
823 ce->mem2reg(stub->addr(), stub->pre_val(), T_OBJECT, stub->patch_code(), stub->info(), false /*wide*/, false /*unaligned*/);
824 }
825
826 __ cmpptr(pre_val_reg, (int32_t)NULL_WORD);
827 __ jcc(Assembler::equal, *stub->continuation());
828 ce->store_parameter(stub->pre_val()->as_register(), 0);
829 __ call(RuntimeAddress(bs->pre_barrier_c1_runtime_code_blob()->code_begin()));
830 __ jmp(*stub->continuation());
831
832 }
833
834 void ShenandoahBarrierSetAssembler::gen_write_barrier_stub(LIR_Assembler* ce, ShenandoahWriteBarrierStub* stub) {
835 __ bind(*stub->entry());
836
837 Label done;
838 Register obj = stub->obj()->as_register();
839 Register res = stub->result()->as_register();
840
841 if (res != obj) {
842 __ mov(res, obj);
843 }
844
845 // Check for null.
846 if (stub->needs_null_check()) {
847 __ testptr(res, res);
848 __ jcc(Assembler::zero, done);
849 }
850
851 __ shenandoah_write_barrier(res);
852
853 __ bind(done);
854 __ jmp(*stub->continuation());
855 }
856
857 #undef __
858
859 #define __ sasm->
860
861 void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAssembler* sasm) {
862 __ prologue("shenandoah_pre_barrier", false);
863 // arg0 : previous value of memory
864
865 __ push(rax);
866 __ push(rdx);
867
868 const Register pre_val = rax;
869 const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread);
870 const Register tmp = rdx;
871
872 NOT_LP64(__ get_thread(thread);)
873
874 Address queue_index(thread, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_index_offset()));
875 Address buffer(thread, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_buffer_offset()));
876
|