Thunks.asm 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 "ksarm.h"
  7. OPT 1 ; re-enable listing
  8. TTL Lib\Backend\arm\Thunks.asm
  9. ;Js::Var NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject* function, Js::CallInfo callInfo, ...)
  10. EXPORT |?CheckCodeGenThunk@NativeCodeGenerator@@SAPAXPAVRecyclableObject@Js@@UCallInfo@3@ZZ|
  11. ;Js::JavascriptMethod NativeCodeGenerator::CheckCodeGen(Js::JavascriptFunction * function)
  12. IMPORT |?CheckCodeGen@NativeCodeGenerator@@SAP6APAXPAVRecyclableObject@Js@@UCallInfo@3@ZZPAVScriptFunction@3@@Z|
  13. #if defined(_CONTROL_FLOW_GUARD)
  14. IMPORT __guard_check_icall_fptr
  15. #endif
  16. TEXTAREA
  17. ;;============================================================================================================
  18. ; NativeCodeGenerator::CheckCodeGenThunk
  19. ;;============================================================================================================
  20. ;Js::Var NativeCodeGenerator::CheckCodeGenThunk(Js::RecyclableObject* function, Js::CallInfo callInfo, ...)
  21. NESTED_ENTRY ?CheckCodeGenThunk@NativeCodeGenerator@@SAPAXPAVRecyclableObject@Js@@UCallInfo@3@ZZ
  22. PROLOG_PUSH r0-r5,r11,lr ; save volatile registers and non-volatile registers; r5 is pushed for aligned purposes
  23. bl |?CheckCodeGen@NativeCodeGenerator@@SAP6APAXPAVRecyclableObject@Js@@UCallInfo@3@ZZPAVScriptFunction@3@@Z| ; call NativeCodeGenerator::CheckCodeGen
  24. #if defined(_CONTROL_FLOW_GUARD)
  25. mov r4, r0 ; save entryPoint in r4
  26. mov32 r12, __guard_check_icall_fptr
  27. ldr r12, [r12]
  28. blx r12
  29. mov r12, r4 ; restore entryPoint in R12
  30. #else
  31. mov r12, r0 ; back up entryPoint in R12
  32. #endif
  33. EPILOG_POP r0-r5,r11,lr ; restore arguments and return address
  34. EPILOG_NOP bx r12 ; jump (tail call) to new entryPoint
  35. NESTED_END
  36. ;;============================================================================================================
  37. END