mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8273380: ARM32: Default to {ldrexd,strexd} in StubRoutines::atomic_{load|store}_long
Backport-of: 718eff2bb6
This commit is contained in:
@@ -635,17 +635,17 @@ class StubGenerator: public StubCodeGenerator {
|
||||
Register result_hi = R1;
|
||||
Register src = R0;
|
||||
|
||||
if (!os::is_MP()) {
|
||||
__ ldmia(src, RegisterSet(result_lo, result_hi));
|
||||
__ bx(LR);
|
||||
} else if (VM_Version::supports_ldrexd()) {
|
||||
if (VM_Version::supports_ldrexd()) {
|
||||
__ ldrexd(result_lo, Address(src));
|
||||
__ clrex(); // FIXME: safe to remove?
|
||||
__ bx(LR);
|
||||
} else if (!os::is_MP()) {
|
||||
// Last-ditch attempt: we are allegedly running on uni-processor.
|
||||
// Load the thing non-atomically and hope for the best.
|
||||
__ ldmia(src, RegisterSet(result_lo, result_hi));
|
||||
} else {
|
||||
__ stop("Atomic load(jlong) unsupported on this platform");
|
||||
__ bx(LR);
|
||||
}
|
||||
__ bx(LR);
|
||||
|
||||
return start;
|
||||
}
|
||||
@@ -662,10 +662,7 @@ class StubGenerator: public StubCodeGenerator {
|
||||
Register scratch_hi = R3; /* After load from stack */
|
||||
Register result = R3;
|
||||
|
||||
if (!os::is_MP()) {
|
||||
__ stmia(dest, RegisterSet(newval_lo, newval_hi));
|
||||
__ bx(LR);
|
||||
} else if (VM_Version::supports_ldrexd()) {
|
||||
if (VM_Version::supports_ldrexd()) {
|
||||
__ mov(Rtemp, dest); // get dest to Rtemp
|
||||
Label retry;
|
||||
__ bind(retry);
|
||||
@@ -673,11 +670,14 @@ class StubGenerator: public StubCodeGenerator {
|
||||
__ strexd(result, R0, Address(Rtemp));
|
||||
__ rsbs(result, result, 1);
|
||||
__ b(retry, eq);
|
||||
__ bx(LR);
|
||||
} else if (!os::is_MP()) {
|
||||
// Last-ditch attempt: we are allegedly running on uni-processor.
|
||||
// Store the thing non-atomically and hope for the best.
|
||||
__ stmia(dest, RegisterSet(newval_lo, newval_hi));
|
||||
} else {
|
||||
__ stop("Atomic store(jlong) unsupported on this platform");
|
||||
__ bx(LR);
|
||||
}
|
||||
__ bx(LR);
|
||||
|
||||
return start;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user