@@ -1381,7 +1381,6 @@ void MacroAssembler::call_VM_leaf_base(address entry_point,
1381
1381
bind (*retaddr);
1382
1382
1383
1383
ldp (rscratch1, rmethod, Address (post (sp, 2 * wordSize)));
1384
- maybe_isb ();
1385
1384
}
1386
1385
1387
1386
void MacroAssembler::call_VM_leaf (address entry_point, int number_of_arguments) {
@@ -4387,10 +4386,15 @@ void MacroAssembler::get_polling_page(Register dest, relocInfo::relocType rtype)
4387
4386
// Read the polling page. The address of the polling page must
4388
4387
// already be in r.
4389
4388
address MacroAssembler::read_polling_page (Register r, relocInfo::relocType rtype) {
4390
- InstructionMark im (this );
4391
- code_section ()->relocate (inst_mark (), rtype);
4392
- ldrw (zr, Address (r, 0 ));
4393
- return inst_mark ();
4389
+ address mark;
4390
+ {
4391
+ InstructionMark im (this );
4392
+ code_section ()->relocate (inst_mark (), rtype);
4393
+ ldrw (zr, Address (r, 0 ));
4394
+ mark = inst_mark ();
4395
+ }
4396
+ verify_cross_modify_fence_not_required ();
4397
+ return mark;
4394
4398
}
4395
4399
4396
4400
void MacroAssembler::adrp (Register reg1, const Address &dest, uint64_t &byte_offset) {
@@ -4455,6 +4459,7 @@ void MacroAssembler::build_frame(int framesize) {
4455
4459
sub (sp, sp, rscratch1);
4456
4460
}
4457
4461
}
4462
+ verify_cross_modify_fence_not_required ();
4458
4463
}
4459
4464
4460
4465
void MacroAssembler::remove_frame (int framesize) {
@@ -5315,3 +5320,29 @@ void MacroAssembler::verify_ptrue() {
5315
5320
stop (" Error: the preserved predicate register (p7) elements are not all true" );
5316
5321
bind (verify_ok);
5317
5322
}
5323
+
5324
+ void MacroAssembler::safepoint_isb () {
5325
+ isb ();
5326
+ #ifndef PRODUCT
5327
+ if (VerifyCrossModifyFence) {
5328
+ // Clear the thread state.
5329
+ strb (zr, Address (rthread, in_bytes (JavaThread::requires_cross_modify_fence_offset ())));
5330
+ }
5331
+ #endif
5332
+ }
5333
+
5334
+ #ifndef PRODUCT
5335
+ void MacroAssembler::verify_cross_modify_fence_not_required () {
5336
+ if (VerifyCrossModifyFence) {
5337
+ // Check if thread needs a cross modify fence.
5338
+ ldrb (rscratch1, Address (rthread, in_bytes (JavaThread::requires_cross_modify_fence_offset ())));
5339
+ Label fence_not_required;
5340
+ cbz (rscratch1, fence_not_required);
5341
+ // If it does then fail.
5342
+ lea (rscratch1, CAST_FROM_FN_PTR (address, JavaThread::verify_cross_modify_fence_failure));
5343
+ mov (c_rarg0, rthread);
5344
+ blr (rscratch1);
5345
+ bind (fence_not_required);
5346
+ }
5347
+ }
5348
+ #endif
0 commit comments