Il2CppGenericContextHash.cpp 773 B

123456789101112131415161718192021222324252627
  1. #include "il2cpp-config.h"
  2. #include "il2cpp-class-internals.h"
  3. #include "Il2CppGenericContextHash.h"
  4. #include "Il2CppGenericInstHash.h"
  5. #include "Il2CppTypeHash.h"
  6. #include "utils/HashUtils.h"
  7. using il2cpp::utils::HashUtils;
  8. namespace il2cpp
  9. {
  10. namespace metadata
  11. {
  12. size_t Il2CppGenericContextHash::operator()(const Il2CppGenericContext* context) const
  13. {
  14. return Hash(context);
  15. }
  16. size_t Il2CppGenericContextHash::Hash(const Il2CppGenericContext* context)
  17. {
  18. size_t classInstHash = HashUtils::AlignedPointerHash(context->class_inst);
  19. size_t methodInstHash = HashUtils::AlignedPointerHash(context->method_inst);
  20. return HashUtils::Combine(classInstHash, methodInstHash);
  21. }
  22. } /* namespace vm */
  23. } /* namespace il2cpp */