-
-
Notifications
You must be signed in to change notification settings - Fork 670
/
Copy pathtypeinfo.ts
72 lines (69 loc) · 2.81 KB
/
typeinfo.ts
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
// This file is shared with the compiler and must remain portable
// ╒═══════════════════ Typeinfo interpretation ═══════════════════╕
// 3 2 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 bits
// ├─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┤ ◄─ __rtti_base
// │ count │
// ╞═══════════════════════════════════════════════════════════════╡ ┐
// │ Typeinfo#flags [id=0] │ id < count
// ├───────────────────────────────────────────────────────────────┤
// │ ... │
/** Runtime type information data structure. */
@unmanaged
export class Typeinfo {
/** Flags describing the shape of this class type. */
flags: TypeinfoFlags = TypeinfoFlags.NONE;
}
/** Runtime type information flags. */
export const enum TypeinfoFlags {
/** No specific flags. */
NONE = 0,
/** Type is an `ArrayBufferView`. */
ARRAYBUFFERVIEW = 1 << 0,
/** Type is an `Array`. */
ARRAY = 1 << 1,
/** Type is a `StaticArray`. */
STATICARRAY = 1 << 2,
/** Type is a `Set`. */
SET = 1 << 3,
/** Type is a `Map`. */
MAP = 1 << 4,
/** Type has no outgoing pointers. */
POINTERFREE = 1 << 5,
/** Value alignment of 1 byte. */
VALUE_ALIGN_0 = 1 << 6,
/** Value alignment of 2 bytes. */
VALUE_ALIGN_1 = 1 << 7,
/** Value alignment of 4 bytes. */
VALUE_ALIGN_2 = 1 << 8,
/** Value alignment of 8 bytes. */
VALUE_ALIGN_3 = 1 << 9,
/** Value alignment of 16 bytes. */
VALUE_ALIGN_4 = 1 << 10,
/** Value is a signed type. */
VALUE_SIGNED = 1 << 11,
/** Value is a float type. */
VALUE_FLOAT = 1 << 12,
/** Value type is nullable. */
VALUE_NULLABLE = 1 << 13,
/** Value type is managed. */
VALUE_MANAGED = 1 << 14,
/** Key alignment of 1 byte. */
KEY_ALIGN_0 = 1 << 15,
/** Key alignment of 2 bytes. */
KEY_ALIGN_1 = 1 << 16,
/** Key alignment of 4 bytes. */
KEY_ALIGN_2 = 1 << 17,
/** Key alignment of 8 bytes. */
KEY_ALIGN_3 = 1 << 18,
/** Key alignment of 16 bytes. */
KEY_ALIGN_4 = 1 << 19,
/** Key is a signed type. */
KEY_SIGNED = 1 << 20,
/** Key is a float type. */
KEY_FLOAT = 1 << 21,
/** Key type is nullable. */
KEY_NULLABLE = 1 << 22,
/** Key type is managed. */
KEY_MANAGED = 1 << 23
}