LinearScanMdA.asm 4.3 KB

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