少年修仙传客户端基础资源
hch
2024-04-01 d01413b00ef631ac20347716b23818b0b811f65f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#pragma once
 
#include "codegen/il2cpp-codegen-il2cpp.h"
 
#include "InterpreterDefs.h"
 
namespace hybridclr
{
namespace interpreter
{
    
    struct TypeDesc
    {
        LocationDataType type;
        uint32_t stackObjectSize; //
    };
 
    IL2CPP_FORCE_INLINE void RuntimeInitClassCCtor(Il2CppClass* klass)
    {
        il2cpp::vm::ClassInlines::InitFromCodegen(klass);
        if (!IS_CCTOR_FINISH_OR_NO_CCTOR(klass))
        {
            il2cpp_codegen_runtime_class_init(klass);
        }
    }
 
    IL2CPP_FORCE_INLINE void RuntimeInitClassCCtor(const MethodInfo* method)
    {
        RuntimeInitClassCCtor(method->klass);
    }
 
    IL2CPP_FORCE_INLINE void RuntimeInitClassCCtorWithoutInitClass(Il2CppClass* klass)
    {
        if (!IS_CCTOR_FINISH_OR_NO_CCTOR(klass))
        {
            il2cpp_codegen_runtime_class_init(klass);
        }
    }
 
    IL2CPP_FORCE_INLINE void RuntimeInitClassCCtorWithoutInitClass(const MethodInfo* method)
    {
        RuntimeInitClassCCtorWithoutInitClass(method->klass);
    }
 
    inline bool IsNeedExpandLocationType(LocationDataType type)
    {
        return type < LocationDataType::U8;
    }
 
    TypeDesc GetTypeArgDesc(const Il2CppType* type);
 
    inline LocationDataType GetLocationDataTypeByType(const Il2CppType* type)
    {
        return GetTypeArgDesc(type).type;
    }
 
    inline void ExpandLocationData2StackDataByType(void* retValue, LocationDataType type)
    {
        switch (type)
        {
        case LocationDataType::I1:
            *(int32_t*)retValue = *(int8_t*)retValue;
            break;
        case LocationDataType::U1:
            *(int32_t*)retValue = *(uint8_t*)retValue;
            break;
        case LocationDataType::I2:
            *(int32_t*)retValue = *(int16_t*)retValue;
            break;
        case LocationDataType::U2:
            *(int32_t*)retValue = *(uint16_t*)retValue;
            break;
        default:
            break;
        }
    }
 
    inline void CopyLocationData2StackDataByType(StackObject* dst, StackObject* src, LocationDataType type)
    {
        switch (type)
        {
        case LocationDataType::I1:
            *(int32_t*)dst = *(int8_t*)src;
            break;
        case LocationDataType::U1:
            *(int32_t*)dst = *(uint8_t*)src;
            break;
        case LocationDataType::I2:
            *(int32_t*)dst = *(int16_t*)src;
            break;
        case LocationDataType::U2:
            *(int32_t*)dst = *(uint16_t*)src;
            break;
        default:
            *dst = *src;
            break;
        }
    }
 
    TypeDesc GetValueTypeArgDescBySize(uint32_t size);
    
    Il2CppObject* TranslateNativeValueToBoxValue(const Il2CppType* type, void* value);
 
 
}
}