JnHelperMethod.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. #pragma once
  6. extern "C"
  7. {
  8. #ifdef _M_IX86
  9. DECLSPEC_CHPE_GUEST void __cdecl _chkstk(int);
  10. #else
  11. void __cdecl __chkstk(int);
  12. #endif
  13. }
  14. #ifdef _CONTROL_FLOW_GUARD
  15. extern "C" PVOID __guard_check_icall_fptr;
  16. #endif
  17. namespace IR
  18. {
  19. enum JnHelperMethod
  20. {
  21. #define HELPERCALL(Name, Address, Attributes) Helper##Name,
  22. #include "JnHelperMethodList.h"
  23. JnHelperMethodCount
  24. };
  25. class HelperCallOpnd;
  26. // Verify the table is read-only.
  27. void CheckJnHelperTable(intptr_t const *table);
  28. // Return address of the helper which can be intercepted by debugger wrapper.
  29. intptr_t GetMethodAddress(ThreadContextInfo * context, HelperCallOpnd* opnd);
  30. intptr_t GetNonTableMethodAddress(ThreadContextInfo * context, JnHelperMethod helperMethod);
  31. // Returns the original address of the helper, this one is never the intercepted by debugger helper.
  32. intptr_t GetMethodOriginalAddress(ThreadContextInfo * context, JnHelperMethod helperMethod);
  33. #if DBG_DUMP || defined(ENABLE_IR_VIEWER)
  34. char16 const* GetMethodName(JnHelperMethod helperMethod);
  35. #endif
  36. } // namespace IR.
  37. namespace HelperMethodAttributes
  38. {
  39. bool CanThrow(IR::JnHelperMethod helper);
  40. bool IsInVariant(IR::JnHelperMethod helper);
  41. bool CanBeReentrant(IR::JnHelperMethod helper);
  42. bool TempObjectProducing(IR::JnHelperMethod helper);
  43. } // namespace HelperMethodAttributes.