JITStubsMSVC64.asm 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. ;/*
  2. ; Copyright (C) 2013 Digia Plc. and/or its subsidiary(-ies)
  3. ;
  4. ; Redistribution and use in source and binary forms, with or without
  5. ; modification, are permitted provided that the following conditions
  6. ; are met:
  7. ; 1. Redistributions of source code must retain the above copyright
  8. ; notice, this list of conditions and the following disclaimer.
  9. ; 2. Redistributions in binary form must reproduce the above copyright
  10. ; notice, this list of conditions and the following disclaimer in the
  11. ; documentation and/or other materials provided with the distribution.
  12. ;
  13. ; THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
  14. ; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15. ; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  16. ; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
  17. ; CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  18. ; EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. ; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  20. ; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  21. ; OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  23. ; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. ;*/
  25. EXTERN cti_vm_throw : near
  26. PUBLIC ctiTrampoline
  27. PUBLIC ctiVMThrowTrampoline
  28. PUBLIC ctiOpThrowNotCaught
  29. _TEXT SEGMENT
  30. ctiTrampoline PROC
  31. ; Dump register parameters to their home address
  32. mov qword ptr[rsp+20h], r9
  33. mov qword ptr[rsp+18h], r8
  34. mov qword ptr[rsp+10h], rdx
  35. mov qword ptr[rsp+8h], rcx
  36. push rbp
  37. mov rbp, rsp
  38. push r12
  39. push r13
  40. push r14
  41. push r15
  42. push rbx
  43. ; Decrease rsp to point to the start of our JITStackFrame
  44. sub rsp, 58h
  45. mov r12, 512
  46. mov r14, 0FFFF000000000000h
  47. mov r15, 0FFFF000000000002h
  48. mov r13, r8
  49. call rcx
  50. add rsp, 58h
  51. pop rbx
  52. pop r15
  53. pop r14
  54. pop r13
  55. pop r12
  56. pop rbp
  57. ret
  58. ctiTrampoline ENDP
  59. ctiVMThrowTrampoline PROC
  60. mov rcx, rsp
  61. call cti_vm_throw
  62. int 3
  63. ctiVMThrowTrampoline ENDP
  64. ctiOpThrowNotCaught PROC
  65. add rsp, 58h
  66. pop rbx
  67. pop r15
  68. pop r14
  69. pop r13
  70. pop r12
  71. pop rbp
  72. ret
  73. ctiOpThrowNotCaught ENDP
  74. _TEXT ENDS
  75. END