|
| 1 | +;------------------------------------------------------------------------------------------------------- |
| 2 | +; Copyright (C) Microsoft. All rights reserved. |
| 3 | +; Copyright (c) ChakraCore Project Contributors. All rights reserved. |
| 4 | +; Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. |
| 5 | +;------------------------------------------------------------------------------------------------------- |
| 6 | + |
| 7 | +#include "unixasmmacros.inc" |
| 8 | + |
| 9 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 10 | +; LinearScanMD::SaveAllRegistersAndBailOut(BailOutRecord *const bailOutRecord) |
| 11 | + |
| 12 | +NESTED_ENTRY _ZN12LinearScanMD26SaveAllRegistersAndBailOutEP13BailOutRecord, _TEXT, NoHandler |
| 13 | + |
| 14 | + ; x0 == bailOutRecord |
| 15 | + ; lr == return address |
| 16 | + |
| 17 | + ; Save all registers except the above, which would have already been saved by jitted code if necessary |
| 18 | + ldr x17, [x0] ; bailOutRecord->globalBailOutRecordDataTable |
| 19 | + ldr x17, [x17] ; bailOutRecord->globalBailOutRecordDataTable->registerSaveSpace |
| 20 | + str x1, [x17, #1*8] |
| 21 | + stp x2, x3, [x17, #2*8] |
| 22 | + stp x4, x5, [x17, #4*8] |
| 23 | + stp x6, x7, [x17, #6*8] |
| 24 | + stp x8, x9, [x17, #8*8] |
| 25 | + stp x10, x11, [x17, #10*8] |
| 26 | + stp x12, x13, [x17, #12*8] |
| 27 | + stp x14, x15, [x17, #14*8] |
| 28 | + str x16, [x17, #16*8] |
| 29 | + ; skip x17/x18 |
| 30 | + stp x19, x20, [x17, #19*8] |
| 31 | + stp x21, x22, [x17, #21*8] |
| 32 | + stp x23, x24, [x17, #23*8] |
| 33 | + stp x25, x26, [x17, #25*8] |
| 34 | + stp x27, x28, [x17, #27*8] |
| 35 | + str fp, [x17, #29*8] |
| 36 | + ; skip lr, sp, zr |
| 37 | + add x17, x17, #33*8 |
| 38 | + stp d0, d1, [x17, #0*8] |
| 39 | + stp d2, d3, [x17, #2*8] |
| 40 | + stp d4, d5, [x17, #4*8] |
| 41 | + stp d6, d7, [x17, #6*8] |
| 42 | + stp d8, d9, [x17, #8*8] |
| 43 | + stp d10, d11, [x17, #10*8] |
| 44 | + stp d12, d13, [x17, #12*8] |
| 45 | + stp d14, d15, [x17, #14*8] |
| 46 | + stp d16, d17, [x17, #16*8] |
| 47 | + stp d18, d19, [x17, #18*8] |
| 48 | + stp d20, d21, [x17, #20*8] |
| 49 | + stp d22, d23, [x17, #22*8] |
| 50 | + stp d24, d25, [x17, #24*8] |
| 51 | + stp d26, d27, [x17, #26*8] |
| 52 | + stp d28, d29, [x17, #28*8] |
| 53 | + ;stp d30, d31, [x17, #30*8] |
| 54 | + |
| 55 | + b C_FUNC(_ZN13BailOutRecord7BailOutEPKS_) |
| 56 | + |
| 57 | +NESTED_END _ZN12LinearScanMD26SaveAllRegistersAndBailOutEP13BailOutRecord, _TEXT |
| 58 | + |
| 59 | +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 60 | +; LinearScanMD::SaveAllRegistersAndBranchBailOut(BranchBailOutRecord *const bailOutRecord, const BOOL condition) |
| 61 | + |
| 62 | +NESTED_ENTRY _ZN12LinearScanMD32SaveAllRegistersAndBranchBailOutEP19BranchBailOutRecordi, _TEXT, NoHandler |
| 63 | + |
| 64 | + ; x0 == bailOutRecord |
| 65 | + ; x1 == condition |
| 66 | + ; lr == return address |
| 67 | + |
| 68 | + ; Save all registers except the above, which would have already been saved by jitted code if necessary |
| 69 | + ldr x17, [x0] ; bailOutRecord->globalBailOutRecordDataTable |
| 70 | + ldr x17, [x17] ; bailOutRecord->globalBailOutRecordDataTable->registerSaveSpace |
| 71 | + stp x2, x3, [x17, #2*8] |
| 72 | + stp x4, x5, [x17, #4*8] |
| 73 | + stp x6, x7, [x17, #6*8] |
| 74 | + stp x8, x9, [x17, #8*8] |
| 75 | + stp x10, x11, [x17, #10*8] |
| 76 | + stp x12, x13, [x17, #12*8] |
| 77 | + stp x14, x15, [x17, #14*8] |
| 78 | + str x16, [x17, #16*8] |
| 79 | + ; skip x17/x18 |
| 80 | + stp x19, x20, [x17, #19*8] |
| 81 | + stp x21, x22, [x17, #21*8] |
| 82 | + stp x23, x24, [x17, #23*8] |
| 83 | + stp x25, x26, [x17, #25*8] |
| 84 | + stp x27, x28, [x17, #27*8] |
| 85 | + str fp, [x17, #29*8] |
| 86 | + ; skip lr, sp, zr |
| 87 | + add x17, x17, #33*8 |
| 88 | + stp d0, d1, [x17, #0*8] |
| 89 | + stp d2, d3, [x17, #2*8] |
| 90 | + stp d4, d5, [x17, #4*8] |
| 91 | + stp d6, d7, [x17, #6*8] |
| 92 | + stp d8, d9, [x17, #8*8] |
| 93 | + stp d10, d11, [x17, #10*8] |
| 94 | + stp d12, d13, [x17, #12*8] |
| 95 | + stp d14, d15, [x17, #14*8] |
| 96 | + stp d16, d17, [x17, #16*8] |
| 97 | + stp d18, d19, [x17, #18*8] |
| 98 | + stp d20, d21, [x17, #20*8] |
| 99 | + stp d22, d23, [x17, #22*8] |
| 100 | + stp d24, d25, [x17, #24*8] |
| 101 | + stp d26, d27, [x17, #26*8] |
| 102 | + stp d28, d29, [x17, #28*8] |
| 103 | + ;stp d30, d31, [x17, #30*8] |
| 104 | + |
| 105 | + b C_FUNC(_ZN19BranchBailOutRecord7BailOutEPKS_i) |
| 106 | + |
| 107 | +NESTED_END _ZN12LinearScanMD32SaveAllRegistersAndBranchBailOutEP19BranchBailOutRecordi, _TEXT |
0 commit comments