@@ -732,6 +732,7 @@ address StubGenerator::generate_disjoint_copy_avx3_masked(address* entry, const
732732 __ ret (0 );
733733
734734 if (MaxVectorSize == 64 ) {
735+ UnsafeCopyMemoryMark ucmm (this , !is_oop && !aligned, false , ucme_exit_pc);
735736 __ BIND (L_copy_large);
736737 arraycopy_avx3_large (to, from, temp1, temp2, temp3, temp4, count, xmm1, xmm2, xmm3, xmm4, shift);
737738 __ jmp (L_finish);
@@ -2547,6 +2548,7 @@ address StubGenerator::generate_unsafe_setmemory(const char *name,
25472548 // Fill words
25482549 {
25492550 Label L_wordsTail, L_wordsLoop, L_wordsTailLoop;
2551+ UnsafeSetMemoryMark usmm (this , true , true );
25502552 // //// Set words
25512553 __ leaq (rScratch2, Address (size, 1 ));
25522554 __ movq (rScratch1, rScratch2);
@@ -2584,14 +2586,15 @@ address StubGenerator::generate_unsafe_setmemory(const char *name,
25842586 __ incrementq (rScratch1);
25852587 __ cmpq (size, rScratch1);
25862588 __ jccb (Assembler::notEqual, L_wordsTailLoop);
2587- __ jmp (L_exit);
25882589 }
2590+ __ jmp (L_exit);
25892591
25902592 __ BIND (L_fillQuadwords);
25912593
25922594 // Fill QUADWORDs
25932595 {
25942596 Label L_qwordLoop, L_qwordsTail, L_qwordsTailLoop;
2597+ UnsafeSetMemoryMark usmm (this , true , true );
25952598
25962599 __ leaq (rScratch2, Address (size, 7 ));
25972600 __ movq (rScratch1, rScratch2);
@@ -2628,14 +2631,18 @@ address StubGenerator::generate_unsafe_setmemory(const char *name,
26282631 __ incrementq (rScratch1);
26292632 __ cmpq (size, rScratch1);
26302633 __ jccb (Assembler::notEqual, L_qwordsTailLoop);
2631- __ jmp (L_exit);
26322634 }
2635+ __ BIND (L_exit);
2636+
2637+ restore_arg_regs ();
2638+ __ ret (0 );
26332639
26342640 __ BIND (L_fillDwords);
26352641
26362642 // Fill DWORDs
26372643 {
26382644 Label L_dwordLoop, L_dwordsTail, L_dwordsTailLoop;
2645+ UnsafeSetMemoryMark usmm (this , true , true );
26392646
26402647 __ leaq (rScratch2, Address (size, 3 ));
26412648 __ movq (rScratch1, rScratch2);
@@ -2675,13 +2682,14 @@ address StubGenerator::generate_unsafe_setmemory(const char *name,
26752682 __ incrementq (rScratch1);
26762683 __ cmpq (size, rScratch1);
26772684 __ jccb (Assembler::notEqual, L_dwordsTailLoop);
2678- __ jmpb (L_exit);
26792685 }
2686+ __ jmpb (L_exit);
26802687
26812688 __ BIND (L_fillBytes);
26822689#ifdef MUSL_LIBC
26832690 {
26842691 Label L_byteLoop, L_longByteLoop, L_byteTail, L_byteTailLoop;
2692+ UnsafeSetMemoryMark usmm (this , true , true );
26852693
26862694#undef wide_value
26872695#define savedSize rax
@@ -2738,13 +2746,22 @@ address StubGenerator::generate_unsafe_setmemory(const char *name,
27382746 __ movq (c_rarg2, rax);
27392747
27402748 __ xchgq (c_rarg1, c_rarg2);
2741- __ jump (RuntimeAddress (byte_fill_entry));
2749+ // generate_unsafe_fill(T_BYTE, false, "unsafe_set_memory");
2750+ __ mov (r11, c_rarg2);
2751+
2752+ __ enter (); // required for proper stackwalking of RuntimeStub frame
2753+
2754+ {
2755+ UnsafeSetMemoryMark usmm (this , true , true );
2756+
2757+ __ generate_fill (T_BYTE, false , c_rarg0, c_rarg1, r11, rax, xmm0);
2758+ }
2759+
2760+ __ vzeroupper ();
2761+ __ leave (); // required for proper stackwalking of RuntimeStub frame
2762+ __ ret (0 );
27422763 }
27432764#endif // MUSL_LIBC
2744- __ BIND (L_exit);
2745-
2746- restore_arg_regs ();
2747- __ ret (0 );
27482765
27492766#undef dest
27502767#undef size
0 commit comments