GenericMetadata.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #pragma once
  2. #include <stdint.h>
  3. #include "il2cpp-metadata.h"
  4. #include "os/Mutex.h"
  5. struct Il2CppGenericClass;
  6. struct Il2CppGenericContext;
  7. struct Il2CppGenericInst;
  8. struct Il2CppGenericMethod;
  9. union Il2CppRGCTXData;
  10. struct Il2CppRGCTXDefinition;
  11. struct Il2CppType;
  12. struct MethodInfo;
  13. struct ParameterInfo;
  14. struct Il2CppClass;
  15. namespace il2cpp
  16. {
  17. namespace metadata
  18. {
  19. class GenericMetadata
  20. {
  21. public:
  22. static const Il2CppType** InflateParameters(const Il2CppType**, uint8_t parameterCount, const Il2CppGenericContext* context, bool inflateMethodVars);
  23. static Il2CppGenericClass* GetGenericClass(const Il2CppClass* genericTypeDefinition, const Il2CppGenericInst* inst);
  24. static Il2CppGenericClass* GetGenericClass(const Il2CppType* genericTypeDefinition, const Il2CppGenericInst* inst);
  25. static const MethodInfo* Inflate(const MethodInfo* methodDefinition, const Il2CppGenericContext* context);
  26. static const Il2CppGenericMethod* Inflate(const Il2CppGenericMethod* genericMethod, const Il2CppGenericContext* context);
  27. static const Il2CppGenericInst* GetInflatedGenericIntance(const Il2CppGenericInst* inst, const Il2CppGenericContext* context, bool inflatMethodVars);
  28. static Il2CppRGCTXData* InflateRGCTXLocked(const Il2CppImage* image, uint32_t token, const Il2CppGenericContext* context, const il2cpp::os::FastAutoLock& lock);
  29. static void RegisterGenericClasses(Il2CppGenericClass* const* genericClasses, int32_t genericClassesCount);
  30. static bool ContainsGenericParameters(const Il2CppClass* klass);
  31. static bool ContainsGenericParameters(const MethodInfo* method);
  32. static bool ContainsGenericParameters(const Il2CppGenericInst* inst);
  33. static bool ContainsGenericParameters(const Il2CppType* type);
  34. static const Il2CppType* InflateIfNeeded(const Il2CppType* type, const Il2CppGenericContext* context, bool inflateMethodVars);
  35. typedef void(*GenericClassWalkCallback)(Il2CppClass* type, void* context);
  36. static void WalkAllGenericClasses(GenericClassWalkCallback callback, void* context);
  37. static int GetMaximumRuntimeGenericDepth();
  38. static void SetMaximumRuntimeGenericDepth(int depth);
  39. static int GetGenericVirtualIterations();
  40. static void SetGenericVirtualIterations(int iterations);
  41. static void Clear();
  42. };
  43. } /* namespace vm */
  44. } /* namespace il2cpp */