少年修仙传客户端基础资源
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
/**
 * \file
 * CIL instruction information
 *
 * Author:
 *   Paolo Molaro (lupus@ximian.com)
 *
 * Copyright 2002-2003 Ximian, Inc (http://www.ximian.com)
 * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
 */
#include <mono/metadata/opcodes.h>
#include <stddef.h> /* for NULL */
#include <config.h>
 
#define MONO_PREFIX1_OFFSET MONO_CEE_ARGLIST
#define MONO_CUSTOM_PREFIX_OFFSET MONO_CEE_MONO_ICALL
 
#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
    { Mono ## e, MONO_FLOW_ ## j, MONO_ ## a },
 
const MonoOpcode
mono_opcodes [MONO_CEE_LAST + 1] = {
#include "mono/cil/opcode.def"
    {0}
};
 
#undef OPDEF
 
#ifdef HAVE_ARRAY_ELEM_INIT
#define MSGSTRFIELD(line) MSGSTRFIELD1(line)
#define MSGSTRFIELD1(line) str##line
static const struct msgstr_t {
#define OPDEF(a,b,c,d,e,f,g,h,i,j) char MSGSTRFIELD(__LINE__) [sizeof (b)];
#include "mono/cil/opcode.def"
#undef OPDEF
} opstr = {
#define OPDEF(a,b,c,d,e,f,g,h,i,j) b,
#include "mono/cil/opcode.def"
#undef OPDEF
};
static const int16_t opidx [] = {
#define OPDEF(a,b,c,d,e,f,g,h,i,j) [MONO_ ## a] = offsetof (struct msgstr_t, MSGSTRFIELD(__LINE__)),
#include "mono/cil/opcode.def"
#undef OPDEF
};
 
/**
 * mono_opcode_name:
 */
const char*
mono_opcode_name (int opcode)
{
    return (const char*)&opstr + opidx [opcode];
}
 
#else
#define OPDEF(a,b,c,d,e,f,g,h,i,j) b,
static const char* const
mono_opcode_names [MONO_CEE_LAST + 1] = {
#include "mono/cil/opcode.def"
    NULL
};
 
const char*
mono_opcode_name (int opcode)
{
    return mono_opcode_names [opcode];
}
 
#endif
 
MonoOpcodeEnum
mono_opcode_value (const mono_byte **ip, const mono_byte *end)
{
    MonoOpcodeEnum res;
    const mono_byte *p = *ip;
 
    if (p >= end)
        return (MonoOpcodeEnum)-1;
    if (*p == 0xfe) {
        ++p;
        if (p >= end)
            return (MonoOpcodeEnum)-1;
        res = (MonoOpcodeEnum)(*p + MONO_PREFIX1_OFFSET);
    } else if (*p == MONO_CUSTOM_PREFIX) {
        ++p;
        if (p >= end)
            return (MonoOpcodeEnum)-1;
        res = (MonoOpcodeEnum)(*p + MONO_CUSTOM_PREFIX_OFFSET);
    } else {
        res = (MonoOpcodeEnum)*p;
    }
    *ip = p;
    return res;
}