46
46
47
47
address ShenandoahBarrierSetAssembler::_shenandoah_lrb = NULL ;
48
48
49
+ static void save_xmm_registers (MacroAssembler* masm) {
50
+ __ subptr (rsp, 64 );
51
+ __ movdbl (Address (rsp, 0 ), xmm0);
52
+ __ movdbl (Address (rsp, 8 ), xmm1);
53
+ __ movdbl (Address (rsp, 16 ), xmm2);
54
+ __ movdbl (Address (rsp, 24 ), xmm3);
55
+ __ movdbl (Address (rsp, 32 ), xmm4);
56
+ __ movdbl (Address (rsp, 40 ), xmm5);
57
+ __ movdbl (Address (rsp, 48 ), xmm6);
58
+ __ movdbl (Address (rsp, 56 ), xmm7);
59
+ }
60
+
61
+ static void restore_xmm_registers (MacroAssembler* masm) {
62
+ __ movdbl (xmm0, Address (rsp, 0 ));
63
+ __ movdbl (xmm1, Address (rsp, 8 ));
64
+ __ movdbl (xmm2, Address (rsp, 16 ));
65
+ __ movdbl (xmm3, Address (rsp, 24 ));
66
+ __ movdbl (xmm4, Address (rsp, 32 ));
67
+ __ movdbl (xmm5, Address (rsp, 40 ));
68
+ __ movdbl (xmm6, Address (rsp, 48 ));
69
+ __ movdbl (xmm7, Address (rsp, 56 ));
70
+ __ addptr (rsp, 64 );
71
+ }
72
+
49
73
void ShenandoahBarrierSetAssembler::arraycopy_prologue (MacroAssembler* masm, DecoratorSet decorators, BasicType type,
50
74
Register src, Register dst, Register count) {
51
75
@@ -290,7 +314,9 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier_not_null(MacroAssembl
290
314
__ lea (src_addr, src);
291
315
}
292
316
317
+ save_xmm_registers (masm);
293
318
__ call (RuntimeAddress (CAST_FROM_FN_PTR (address, ShenandoahBarrierSetAssembler::shenandoah_lrb ())));
319
+ restore_xmm_registers (masm);
294
320
295
321
if (need_addr_setup) {
296
322
if (dst != rax) {
@@ -368,7 +394,10 @@ void ShenandoahBarrierSetAssembler::load_reference_barrier_native(MacroAssembler
368
394
369
395
assert_different_registers (dst, rsi);
370
396
__ lea (rsi, src);
397
+
398
+ save_xmm_registers (masm);
371
399
__ call_VM_leaf (CAST_FROM_FN_PTR (address, ShenandoahRuntime::load_reference_barrier_native), dst, rsi);
400
+ restore_xmm_registers (masm);
372
401
373
402
#ifdef _LP64
374
403
__ pop (r15);
@@ -514,15 +543,7 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet d
514
543
// That path can be reached from the c2i adapter with live fp
515
544
// arguments in registers.
516
545
LP64_ONLY (assert (Argument::n_float_register_parameters_j == 8 , " 8 fp registers to save at java call" ));
517
- __ subptr (rsp, 64 );
518
- __ movdbl (Address (rsp, 0 ), xmm0);
519
- __ movdbl (Address (rsp, 8 ), xmm1);
520
- __ movdbl (Address (rsp, 16 ), xmm2);
521
- __ movdbl (Address (rsp, 24 ), xmm3);
522
- __ movdbl (Address (rsp, 32 ), xmm4);
523
- __ movdbl (Address (rsp, 40 ), xmm5);
524
- __ movdbl (Address (rsp, 48 ), xmm6);
525
- __ movdbl (Address (rsp, 56 ), xmm7);
546
+ save_xmm_registers (masm);
526
547
527
548
Register thread = NOT_LP64 (tmp_thread) LP64_ONLY (r15_thread);
528
549
assert_different_registers (dst, tmp1, tmp_thread);
@@ -539,15 +560,7 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet d
539
560
tmp1 /* tmp */ ,
540
561
true /* tosca_live */ ,
541
562
true /* expand_call */ );
542
- __ movdbl (xmm0, Address (rsp, 0 ));
543
- __ movdbl (xmm1, Address (rsp, 8 ));
544
- __ movdbl (xmm2, Address (rsp, 16 ));
545
- __ movdbl (xmm3, Address (rsp, 24 ));
546
- __ movdbl (xmm4, Address (rsp, 32 ));
547
- __ movdbl (xmm5, Address (rsp, 40 ));
548
- __ movdbl (xmm6, Address (rsp, 48 ));
549
- __ movdbl (xmm7, Address (rsp, 56 ));
550
- __ addptr (rsp, 64 );
563
+ restore_xmm_registers (masm);
551
564
__ pop_IU_state ();
552
565
}
553
566
}
0 commit comments