@wasmgroundup/emit 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +20 -0
- package/dist/index.js +21 -1
- package/index.ts +21 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -26,10 +26,18 @@ declare const exportdesc: {
|
|
|
26
26
|
declare function module(sections: any): BytecodeFragment;
|
|
27
27
|
declare const instr: {
|
|
28
28
|
nop: number;
|
|
29
|
+
block: number;
|
|
30
|
+
loop: number;
|
|
29
31
|
if: number;
|
|
30
32
|
else: number;
|
|
31
33
|
end: number;
|
|
34
|
+
br: number;
|
|
35
|
+
br_if: number;
|
|
36
|
+
br_table: number;
|
|
37
|
+
return: number;
|
|
32
38
|
call: number;
|
|
39
|
+
call_indirect: number;
|
|
40
|
+
drop: number;
|
|
33
41
|
local: {
|
|
34
42
|
get: number;
|
|
35
43
|
set: number;
|
|
@@ -38,9 +46,21 @@ declare const instr: {
|
|
|
38
46
|
global: {
|
|
39
47
|
get: number;
|
|
40
48
|
set: number;
|
|
49
|
+
tee: number;
|
|
41
50
|
};
|
|
42
51
|
i32: {
|
|
43
52
|
const: number;
|
|
53
|
+
eqz: number;
|
|
54
|
+
eq: number;
|
|
55
|
+
ne: number;
|
|
56
|
+
lt_s: number;
|
|
57
|
+
lt_u: number;
|
|
58
|
+
gt_s: number;
|
|
59
|
+
gt_u: number;
|
|
60
|
+
le_s: number;
|
|
61
|
+
le_u: number;
|
|
62
|
+
ge_s: number;
|
|
63
|
+
ge_u: number;
|
|
44
64
|
add: number;
|
|
45
65
|
sub: number;
|
|
46
66
|
mul: number;
|
package/dist/index.js
CHANGED
|
@@ -91,10 +91,18 @@ var numtype;
|
|
|
91
91
|
})(numtype || (numtype = {}));
|
|
92
92
|
const instr = {
|
|
93
93
|
nop: 0x01,
|
|
94
|
+
block: 0x02,
|
|
95
|
+
loop: 0x03,
|
|
94
96
|
if: 0x04,
|
|
95
97
|
else: 0x05,
|
|
96
98
|
end: 0x0b,
|
|
99
|
+
br: 0x0c,
|
|
100
|
+
br_if: 0x0d,
|
|
101
|
+
br_table: 0x0e,
|
|
102
|
+
return: 0x0f,
|
|
97
103
|
call: 0x10,
|
|
104
|
+
call_indirect: 0x11,
|
|
105
|
+
drop: 0x1a,
|
|
98
106
|
local: {
|
|
99
107
|
get: 0x20,
|
|
100
108
|
set: 0x21,
|
|
@@ -103,9 +111,21 @@ const instr = {
|
|
|
103
111
|
global: {
|
|
104
112
|
get: 0x23,
|
|
105
113
|
set: 0x24,
|
|
114
|
+
tee: 0x25,
|
|
106
115
|
},
|
|
107
116
|
i32: {
|
|
108
117
|
const: 0x41,
|
|
118
|
+
eqz: 0x45,
|
|
119
|
+
eq: 0x46,
|
|
120
|
+
ne: 0x47,
|
|
121
|
+
lt_s: 0x48,
|
|
122
|
+
lt_u: 0x49,
|
|
123
|
+
gt_s: 0x4a,
|
|
124
|
+
gt_u: 0x4b,
|
|
125
|
+
le_s: 0x4c,
|
|
126
|
+
le_u: 0x4d,
|
|
127
|
+
ge_s: 0x4e,
|
|
128
|
+
ge_u: 0x4f,
|
|
109
129
|
add: 0x6a,
|
|
110
130
|
sub: 0x6b,
|
|
111
131
|
mul: 0x6c,
|
|
@@ -187,7 +207,7 @@ function importsec(ims) {
|
|
|
187
207
|
const importdesc = {
|
|
188
208
|
// x:typeidx
|
|
189
209
|
func(x) {
|
|
190
|
-
return [0x00,
|
|
210
|
+
return [0x00, typeidx(x)];
|
|
191
211
|
},
|
|
192
212
|
};
|
|
193
213
|
const globalidx = u32;
|
package/index.ts
CHANGED
|
@@ -121,10 +121,18 @@ enum numtype {
|
|
|
121
121
|
|
|
122
122
|
const instr = {
|
|
123
123
|
nop: 0x01,
|
|
124
|
+
block: 0x02,
|
|
125
|
+
loop: 0x03,
|
|
124
126
|
if: 0x04,
|
|
125
127
|
else: 0x05,
|
|
126
128
|
end: 0x0b,
|
|
129
|
+
br: 0x0c,
|
|
130
|
+
br_if: 0x0d,
|
|
131
|
+
br_table: 0x0e,
|
|
132
|
+
return: 0x0f,
|
|
127
133
|
call: 0x10,
|
|
134
|
+
call_indirect: 0x11,
|
|
135
|
+
drop: 0x1a,
|
|
128
136
|
|
|
129
137
|
local: {
|
|
130
138
|
get: 0x20,
|
|
@@ -134,10 +142,22 @@ const instr = {
|
|
|
134
142
|
global: {
|
|
135
143
|
get: 0x23,
|
|
136
144
|
set: 0x24,
|
|
145
|
+
tee: 0x25,
|
|
137
146
|
},
|
|
138
147
|
|
|
139
148
|
i32: {
|
|
140
149
|
const: 0x41,
|
|
150
|
+
eqz: 0x45,
|
|
151
|
+
eq: 0x46,
|
|
152
|
+
ne: 0x47,
|
|
153
|
+
lt_s: 0x48,
|
|
154
|
+
lt_u: 0x49,
|
|
155
|
+
gt_s: 0x4a,
|
|
156
|
+
gt_u: 0x4b,
|
|
157
|
+
le_s: 0x4c,
|
|
158
|
+
le_u: 0x4d,
|
|
159
|
+
ge_s: 0x4e,
|
|
160
|
+
ge_u: 0x4f,
|
|
141
161
|
add: 0x6a,
|
|
142
162
|
sub: 0x6b,
|
|
143
163
|
mul: 0x6c,
|
|
@@ -234,7 +254,7 @@ function importsec(ims: BytecodeFragment): BytecodeFragment {
|
|
|
234
254
|
const importdesc = {
|
|
235
255
|
// x:typeidx
|
|
236
256
|
func(x: number): BytecodeFragment {
|
|
237
|
-
return [0x00,
|
|
257
|
+
return [0x00, typeidx(x)];
|
|
238
258
|
},
|
|
239
259
|
};
|
|
240
260
|
|