Skip to content

Commit

Permalink
Bug 1661016: aarch64: slightly refactor the check that membarrier is …
Browse files Browse the repository at this point in the history
…available; r=lth

Depends on D89366

Differential Revision: https://phabricator.services.mozilla.com/D89367
  • Loading branch information
bnjbvr committed Sep 7, 2020
1 parent e22c4e0 commit 560be42
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions js/src/jit/arm64/vixl/MozCpu-vixl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,18 @@ bool CPU::CanFlushICacheFromBackgroundThreads() {
strcmp(uts.sysname, "Linux") == 0 &&
sscanf(uts.release, "%d.%d", &major, &minor) == 2 &&
major >= kRequiredMajor && (major != kRequiredMajor || minor >= kRequiredMinor);
computed = true;
}

if (!kernelHasMembarrier) {
return false;
}
// As a test bed, try to run the syscall with the command registering the
// intent to use the actual membarrier we'll want to carry out later.
if (kernelHasMembarrier &&
membarrier(MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE, 0) != 0) {
kernelHasMembarrier = false;
}

// As a test bed, try to run the syscall with the command registering the
// intent to use the actual membarrier we'll want to carry out later.
if (membarrier(MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE, 0) != 0) {
return false;
computed = true;
}

return true;
return kernelHasMembarrier;
#else
// On other platforms, we assume that the provided syscall does the right thing.
return true;
Expand Down

0 comments on commit 560be42

Please sign in to comment.