1004 void atomic_xchgw(Register prev, Register newv, Register addr);
1005 void atomic_xchgal(Register prev, Register newv, Register addr);
1006 void atomic_xchgalw(Register prev, Register newv, Register addr);
1007
1008 void orptr(Address adr, RegisterOrConstant src) {
1009 ldr(rscratch2, adr);
1010 if (src.is_register())
1011 orr(rscratch2, rscratch2, src.as_register());
1012 else
1013 orr(rscratch2, rscratch2, src.as_constant());
1014 str(rscratch2, adr);
1015 }
1016
1017 // A generic CAS; success or failure is in the EQ flag.
1018 // Clobbers rscratch1
1019 void cmpxchg(Register addr, Register expected, Register new_val,
1020 enum operand_size size,
1021 bool acquire, bool release, bool weak,
1022 Register result);
1023
1024 void cmpxchg_oop_shenandoah(Register res, Register addr, Register expected, Register new_val,
1025 bool narrow,
1026 bool acquire, bool release,
1027 Register tmp1 = rscratch1, Register tmp2 = rscratch2);
1028 // Calls
1029
1030 address trampoline_call(Address entry, CodeBuffer *cbuf = NULL);
1031
1032 static bool far_branches() {
1033 return ReservedCodeCacheSize > branch_range;
1034 }
1035
1036 // Jumps that can reach anywhere in the code cache.
1037 // Trashes tmp.
1038 void far_call(Address entry, CodeBuffer *cbuf = NULL, Register tmp = rscratch1);
1039 void far_jump(Address entry, CodeBuffer *cbuf = NULL, Register tmp = rscratch1);
1040
1041 static int far_branch_size() {
1042 if (far_branches()) {
1043 return 3 * 4; // adrp, add, br
1044 } else {
1045 return 4;
1046 }
1047 }
|
1004 void atomic_xchgw(Register prev, Register newv, Register addr);
1005 void atomic_xchgal(Register prev, Register newv, Register addr);
1006 void atomic_xchgalw(Register prev, Register newv, Register addr);
1007
1008 void orptr(Address adr, RegisterOrConstant src) {
1009 ldr(rscratch2, adr);
1010 if (src.is_register())
1011 orr(rscratch2, rscratch2, src.as_register());
1012 else
1013 orr(rscratch2, rscratch2, src.as_constant());
1014 str(rscratch2, adr);
1015 }
1016
1017 // A generic CAS; success or failure is in the EQ flag.
1018 // Clobbers rscratch1
1019 void cmpxchg(Register addr, Register expected, Register new_val,
1020 enum operand_size size,
1021 bool acquire, bool release, bool weak,
1022 Register result);
1023
1024 void cmpxchg_oop_shenandoah(Register addr, Register expected, Register new_val,
1025 enum operand_size size,
1026 bool acquire, bool release, bool weak,
1027 Register result = rscratch1, Register tmp2 = rscratch2);
1028 // Calls
1029
1030 address trampoline_call(Address entry, CodeBuffer *cbuf = NULL);
1031
1032 static bool far_branches() {
1033 return ReservedCodeCacheSize > branch_range;
1034 }
1035
1036 // Jumps that can reach anywhere in the code cache.
1037 // Trashes tmp.
1038 void far_call(Address entry, CodeBuffer *cbuf = NULL, Register tmp = rscratch1);
1039 void far_jump(Address entry, CodeBuffer *cbuf = NULL, Register tmp = rscratch1);
1040
1041 static int far_branch_size() {
1042 if (far_branches()) {
1043 return 3 * 4; // adrp, add, br
1044 } else {
1045 return 4;
1046 }
1047 }
|