summaryrefslogtreecommitdiff
path: root/src/vm
diff options
context:
space:
mode:
authorRahul Kumar <rahku@microsoft.com>2017-04-04 15:33:36 -0700
committerGitHub <noreply@github.com>2017-04-04 15:33:36 -0700
commit7f296fec9799d0a2d5ace44eb468ecf264cc026f (patch)
treecce5d6c0a798681a8582676f79ff02fda8295df3 /src/vm
parent5619985da19d0f17a1a48558381a6d79bcc67f74 (diff)
parent4db5a72bc2209c6f56c7f335ae318f79d1fe2a4f (diff)
downloadcoreclr-7f296fec9799d0a2d5ace44eb468ecf264cc026f.tar.gz
coreclr-7f296fec9799d0a2d5ace44eb468ecf264cc026f.tar.bz2
coreclr-7f296fec9799d0a2d5ace44eb468ecf264cc026f.zip
Merge pull request #10190 from sdmaclea/PR-ARM64-BACKPORT-9500
[Arm64/Windows] Backport #9500 changes
Diffstat (limited to 'src/vm')
-rw-r--r--src/vm/arm64/asmhelpers.asm38
1 files changed, 27 insertions, 11 deletions
diff --git a/src/vm/arm64/asmhelpers.asm b/src/vm/arm64/asmhelpers.asm
index d760765885..e8b16ded6a 100644
--- a/src/vm/arm64/asmhelpers.asm
+++ b/src/vm/arm64/asmhelpers.asm
@@ -159,6 +159,7 @@
RestoreRegMS 26, X26
RestoreRegMS 27, X27
RestoreRegMS 28, X28
+ RestoreRegMS 29, X29
Done
; Its imperative that the return value of HelperMethodFrameRestoreState is zero
@@ -991,16 +992,6 @@ UM2MThunk_WrapperHelper_RegArgumentsSetup
; This helper enables us to call into a funclet after restoring Fp register
NESTED_ENTRY CallEHFunclet
-
- ; Using below prolog instead of PROLOG_SAVE_REG_PAIR fp,lr, #-16!
- ; is intentional. Above statement would also emit instruction to save
- ; sp in fp. If sp is saved in fp in prolog then it is not expected that fp can change in the body
- ; of method. However, this method needs to be able to change fp before calling funclet.
- ; This is required to access locals in funclet.
- PROLOG_SAVE_REG_PAIR x19,x20, #-16!
- PROLOG_SAVE_REG fp, #0
- PROLOG_SAVE_REG lr, #8
-
; On entry:
;
; X0 = throwable
@@ -1008,17 +999,42 @@ UM2MThunk_WrapperHelper_RegArgumentsSetup
; X2 = address of X19 register in CONTEXT record; used to restore the non-volatile registers of CrawlFrame
; X3 = address of the location where the SP of funclet's caller (i.e. this helper) should be saved.
;
+
+ ; Using below prolog instead of PROLOG_SAVE_REG_PAIR fp,lr, #-16!
+ ; is intentional. Above statement would also emit instruction to save
+ ; sp in fp. If sp is saved in fp in prolog then it is not expected that fp can change in the body
+ ; of method. However, this method needs to be able to change fp before calling funclet.
+ ; This is required to access locals in funclet.
+ PROLOG_SAVE_REG_PAIR_NO_FP fp,lr, #-96!
+
+ ; Spill callee saved registers
+ PROLOG_SAVE_REG_PAIR x19, x20, 16
+ PROLOG_SAVE_REG_PAIR x21, x22, 32
+ PROLOG_SAVE_REG_PAIR x23, x24, 48
+ PROLOG_SAVE_REG_PAIR x25, x26, 64
+ PROLOG_SAVE_REG_PAIR x27, x28, 80
+
; Save the SP of this function. We cannot store SP directly.
mov fp, sp
str fp, [x3]
+ ldp x19, x20, [x2, #0]
+ ldp x21, x22, [x2, #16]
+ ldp x23, x24, [x2, #32]
+ ldp x25, x26, [x2, #48]
+ ldp x27, x28, [x2, #64]
ldr fp, [x2, #80] ; offset of fp in CONTEXT relative to X19
; Invoke the funclet
blr x1
nop
- EPILOG_RESTORE_REG_PAIR fp, lr, #16!
+ EPILOG_RESTORE_REG_PAIR x19, x20, 16
+ EPILOG_RESTORE_REG_PAIR x21, x22, 32
+ EPILOG_RESTORE_REG_PAIR x23, x24, 48
+ EPILOG_RESTORE_REG_PAIR x25, x26, 64
+ EPILOG_RESTORE_REG_PAIR x27, x28, 80
+ EPILOG_RESTORE_REG_PAIR fp, lr, #96!
EPILOG_RETURN
NESTED_END CallEHFunclet