diff options
author | Aditya Mandaleeka <adityam@microsoft.com> | 2019-01-07 18:52:10 -0800 |
---|---|---|
committer | Aditya Mandaleeka <adityam@microsoft.com> | 2019-01-08 12:42:58 -0800 |
commit | f9f2458a6130085e90130b7497aff25f4cf0f922 (patch) | |
tree | bc7e265d8282940f9c22ed70c42ba59c3122cc3d /src | |
parent | 0a2ceb3fd146d9171b8c362aa8679d996d3e5bde (diff) | |
download | coreclr-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.S | 18 |
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): |