-
Notifications
You must be signed in to change notification settings - Fork 0
/
enums.ts
80 lines (72 loc) · 1.61 KB
/
enums.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
73
74
75
76
77
78
79
80
/** The type of a number. */
export enum SpiderNumberType {
/** A 32-bit integer. */
i32 = 0x7F,
/** A 64-bit integer. */
i64 = 0x7E,
/** A 32-bit floating-point. */
f32 = 0x7D,
/** A 64-bit floating-point. */
f64 = 0x7C
}
/** The type of a reference. */
export enum SpiderReferenceType {
/** A reference to a function. */
funcref = 0x70,
/** A reference to an external object. */
externref = 0x6F
}
/** The type of a vector. Used for SIMD instructions. */
export enum SpiderVectorType {
/** A 128-bit vector of packed integer or floating-point data. */
v128 = 0x7B
}
/** The type of any value (like a parameter or variable). */
export type SpiderValueType = SpiderNumberType | SpiderReferenceType | SpiderVectorType;
/** The position of a custom section within the module. */
export enum SpiderCustomSectionPosition {
AFTER_HEADER,
AFTER_TYPE,
AFTER_IMPORT,
AFTER_FUNCTION,
AFTER_TABLE,
AFTER_MEMORY,
AFTER_GLOBAL,
AFTER_EXPORT,
AFTER_START,
AFTER_ELEMENT,
AFTER_DATA_COUNT,
AFTER_CODE,
AFTER_DATA
}
export const enum SpiderExportType {
func = 0x00,
table = 0x01,
mem = 0x02,
global = 0x03
}
export const enum SpiderImportType {
func = 0x00,
table = 0x01,
mem = 0x02,
global = 0x03
}
export const enum WasmSectionType {
custom = 0,
type = 1,
import = 2,
function = 3,
table = 4,
memory = 5,
global = 6,
export = 7,
start = 8,
element = 9,
code = 10,
data = 11,
dataCount = 12
}
export const enum WasmBlockOpcode {
else = 0x05,
end = 0x0b
}