summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAditya Mandaleeka <adityam@microsoft.com>2019-01-07 18:52:10 -0800
committerAditya Mandaleeka <adityam@microsoft.com>2019-01-08 12:42:58 -0800
commitf9f2458a6130085e90130b7497aff25f4cf0f922 (patch)
treebc7e265d8282940f9c22ed70c42ba59c3122cc3d /src
parent0a2ceb3fd146d9171b8c362aa8679d996d3e5bde (diff)
downloadcoreclr-f9f2458a6130085e90130b7497aff25f4cf0f922.tar.gz
coreclr-f9f2458a6130085e90130b7497aff25f4cf0f922.tar.bz2
coreclr-f9f2458a6130085e90130b7497aff25f4cf0f922.zip
Fix write barrier bounds checks for ARM64 Unix
Diffstat (limited to 'src')
-rw-r--r--src/vm/arm64/asmhelpers.S18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/vm/arm64/asmhelpers.S b/src/vm/arm64/asmhelpers.S
index aa79b4d477..c0baa92456 100644
--- a/src/vm/arm64/asmhelpers.S
+++ b/src/vm/arm64/asmhelpers.S
@@ -344,8 +344,14 @@ WRITE_BARRIER_ENTRY JIT_CheckedWriteBarrier
cmp x14, x12
ldr x12, LOCAL_LABEL(wbs_highest_address)
- ccmp x14, x12, #0x0, ge
- blt C_FUNC(JIT_WriteBarrier)
+
+ // Compare against the upper bound if the previous comparison indicated
+ // that the destination address is greater than or equal to the lower
+ // bound. Otherwise, set the C flag (specified by the 0x2) so that the
+ // branch below is not taken.
+ ccmp x14, x12, #0x2, hs
+
+ blo C_FUNC(JIT_WriteBarrier)
LOCAL_LABEL(NotInHeap):
str x15, [x14], 8
@@ -429,7 +435,13 @@ LOCAL_LABEL(CheckCardTable):
cmp x15, x12
ldr x12, LOCAL_LABEL(wbs_ephemeral_high)
- ccmp x15, x12, 0x0, hs
+
+ // Compare against the upper bound if the previous comparison indicated
+ // that the destination address is greater than or equal to the lower
+ // bound. Otherwise, set the C flag (specified by the 0x2) so that the
+ // branch to exit is taken.
+ ccmp x15, x12, #0x2, hs
+
bhi LOCAL_LABEL(Exit)
LOCAL_LABEL(SkipEphemeralCheck):