Skip to content

Commit f61ac64

Browse files
committed
Automatic rebaseline of codesize expectations. NFC
This is an automatic change generated by tools/maint/rebaseline_tests.py. The following (4) test expectation files were updated by running the tests with `--rebaseline`: ``` test/code_size/audio_worklet_wasm.js updated code_size/audio_worklet_wasm.json: 5660 => 5719 [+59 bytes / +1.04%] test/other/codesize/test_codesize_minimal_esm.gzsize updated test/other/codesize/test_codesize_minimal_esm.jssize updated Average change: +1.04% (+1.04% - +1.04%) ```
1 parent 9c0d9b1 commit f61ac64

File tree

4 files changed

+102
-96
lines changed

4 files changed

+102
-96
lines changed

test/code_size/audio_worklet_wasm.js

Lines changed: 96 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
var k = globalThis.Module || "undefined" != typeof Module ? Module : {}, p = "em-ww" == globalThis.name, q = "undefined" !== typeof AudioWorkletGlobalScope, r, v, L, M, G, I, C, X, J, E, D, Y, Z;
1+
var k = globalThis.Module || "undefined" != typeof Module ? Module : {}, p = "em-ww" == globalThis.name, q = "undefined" !== typeof AudioWorkletGlobalScope, u, v, y, N, O, J, K, E, W, L, H, F, X, Z;
22

33
q && (p = !0);
44

5-
function u(a) {
6-
r = a;
7-
v = a.I;
8-
x();
5+
var r = new Promise((a => {
6+
u = a;
7+
}));
8+
9+
function x(a) {
10+
v = a;
11+
y = a.I;
12+
C();
913
k ||= {};
1014
k.wasm = a.C;
11-
y();
15+
D();
1216
a.C = a.J = 0;
1317
}
1418

1519
p && !q && (onmessage = a => {
1620
onmessage = null;
17-
u(a.data);
21+
x(a.data);
1822
});
1923

2024
if (q) {
@@ -23,88 +27,89 @@ if (q) {
2327
constructor(e) {
2428
super();
2529
e = e.processorOptions;
26-
this.u = C.get(e.u);
30+
this.u = E.get(e.u);
2731
this.v = e.v;
2832
this.s = e.s;
2933
}
3034
static get parameterDescriptors() {
3135
return c;
3236
}
3337
process(e, h, f) {
34-
let m = e.length, w = h.length, F = 0, l, z, n, t = 4 * this.s, g = 12 * (m + w), W = D(), A, H, B;
38+
let m = e.length, w = h.length, G = 0, l, z, n, t = 4 * this.s, g = 12 * (m + w), Y = F(), A, I, B;
3539
for (l of e) g += l.length * t;
3640
for (l of h) g += l.length * t;
37-
for (l in f) g += f[l].byteLength + 8, ++F;
38-
A = E(g);
41+
for (l in f) g += f[l].byteLength + 8, ++G;
42+
A = H(g);
3943
g = A >> 2;
4044
n = A + 12 * m;
4145
for (l of e) {
42-
G[g] = l.length;
43-
G[g + 1] = this.s;
44-
G[g + 2] = n;
46+
J[g] = l.length;
47+
J[g + 1] = this.s;
48+
J[g + 2] = n;
4549
g += 3;
46-
for (z of l) I.set(z, n >> 2), n += t;
50+
for (z of l) K.set(z, n >> 2), n += t;
4751
}
48-
H = n;
49-
g = H >> 2;
52+
I = n;
53+
g = I >> 2;
5054
e = (n += 12 * w) >> 2;
51-
for (l of h) G[g] = l.length, G[g + 1] = this.s, G[g + 2] = n, g += 3, n += t * l.length;
55+
for (l of h) J[g] = l.length, J[g + 1] = this.s, J[g + 2] = n, g += 3, n += t * l.length;
5256
t = n;
5357
g = t >> 2;
54-
n += 8 * F;
55-
for (l = 0; B = f[l++]; ) G[g] = B.length, G[g + 1] = n, g += 2, I.set(B, n >> 2),
58+
n += 8 * G;
59+
for (l = 0; B = f[l++]; ) J[g] = B.length, J[g + 1] = n, g += 2, K.set(B, n >> 2),
5660
n += 4 * B.length;
57-
if (f = this.u(m, A, w, H, F, t, this.v)) for (l of h) for (z of l) for (g = 0; g < this.s; ++g) z[g] = I[e++];
58-
J(W);
61+
if (f = this.u(m, A, w, I, G, t, this.v)) for (l of h) for (z of l) for (g = 0; g < this.s; ++g) z[g] = K[e++];
62+
L(Y);
5963
return !!f;
6064
}
6165
}
6266
return d;
6367
}
64-
var K;
68+
var M;
6569
class b extends AudioWorkletProcessor {
6670
constructor(c) {
6771
super();
68-
u(c.processorOptions);
69-
K = this.port;
70-
K.onmessage = async d => {
72+
x(c.processorOptions);
73+
M = this.port;
74+
M.onmessage = async d => {
75+
await r;
7176
d = d.data;
72-
d._wpn ? (registerProcessor(d._wpn, a(d.D)), K.postMessage({
77+
d._wpn ? (registerProcessor(d._wpn, a(d.D)), M.postMessage({
7378
_wsc: d.u,
7479
A: [ d.F, 1, d.v ]
75-
})) : d._wsc && C.get(d._wsc)(...d.A);
80+
})) : d._wsc && (await r, E.get(d._wsc)(...d.A));
7681
};
7782
}
7883
process() {}
7984
}
8085
registerProcessor("em-bootstrap", b);
8186
}
8287

83-
function x() {
84-
var a = v.buffer;
85-
L = new Uint8Array(a);
86-
M = new Int32Array(a);
87-
G = new Uint32Array(a);
88-
I = new Float32Array(a);
88+
function C() {
89+
var a = y.buffer;
90+
N = new Uint8Array(a);
91+
O = new Int32Array(a);
92+
J = new Uint32Array(a);
93+
K = new Float32Array(a);
8994
}
9095

91-
p || (v = k.mem || new WebAssembly.Memory({
96+
p || (y = k.mem || new WebAssembly.Memory({
9297
initial: 256,
9398
maximum: 256,
9499
shared: !0
95-
}), x());
100+
}), C());
96101

97-
var N = [], O = a => {
102+
var P = [], Q = a => {
98103
a = a.data;
99104
let b = a._wsc;
100-
b && C.get(b)(...a.x);
101-
}, P = a => {
102-
N.push(a);
103-
}, Q = a => J(a), R = () => D(), aa = (a, b, c, d) => {
105+
b && E.get(b)(...a.x);
106+
}, R = a => {
107+
P.push(a);
108+
}, aa = a => L(a), ba = () => F(), ca = (a, b, c, d) => {
104109
b = S[b];
105110
S[a].connect(b.destination || b, c, d);
106111
}, S = {}, T = 0, U = "undefined" != typeof TextDecoder ? new TextDecoder : void 0, V = (a = 0) => {
107-
for (var b = L, c = a, d = c + void 0; b[c] && !(c >= d); ) ++c;
112+
for (var b = N, c = a, d = c + void 0; b[c] && !(c >= d); ) ++c;
108113
if (16 < c - a && b.buffer && U) return U.decode(b.slice(a, c));
109114
for (d = ""; a < c; ) {
110115
var e = b[a++];
@@ -118,25 +123,25 @@ var N = [], O = a => {
118123
} else d += String.fromCharCode(e);
119124
}
120125
return d;
121-
}, ba = a => {
126+
}, da = a => {
122127
var b = window.AudioContext || window.webkitAudioContext;
123128
if (a >>= 2) {
124-
var c = G[a] ? (c = G[a]) ? V(c) : "" : void 0;
129+
var c = J[a] ? (c = J[a]) ? V(c) : "" : void 0;
125130
a = {
126131
latencyHint: c,
127-
sampleRate: M[a + 1] || void 0
132+
sampleRate: O[a + 1] || void 0
128133
};
129134
} else a = void 0;
130135
if (c = b) b = new b(a), S[++T] = b, c = T;
131136
return c;
132-
}, ca = (a, b, c, d, e) => {
137+
}, ea = (a, b, c, d, e) => {
133138
if (c >>= 2) {
134-
var h = M[c], f = M[c + 1];
135-
if (G[c + 2]) {
136-
var m = G[c + 2] >> 2;
137-
c = M[c + 1];
139+
var h = O[c], f = O[c + 1];
140+
if (J[c + 2]) {
141+
var m = J[c + 2] >> 2;
142+
c = O[c + 1];
138143
let w = [];
139-
for (;c--; ) w.push(G[m++]);
144+
for (;c--; ) w.push(J[m++]);
140145
m = w;
141146
} else m = void 0;
142147
d = {
@@ -153,51 +158,51 @@ var N = [], O = a => {
153158
a = new AudioWorkletNode(S[a], b ? V(b) : "", d);
154159
S[++T] = a;
155160
return T;
156-
}, da = (a, b, c, d) => {
161+
}, fa = (a, b, c, d) => {
157162
b >>= 2;
158-
let e = [], h = G[b + 1], f = G[b + 2] >> 2, m = 0;
163+
let e = [], h = J[b + 1], f = J[b + 2] >> 2, m = 0;
159164
for (;h--; ) e.push({
160165
name: m++,
161-
defaultValue: I[f++],
162-
minValue: I[f++],
163-
maxValue: I[f++],
164-
automationRate: [ "a", "k" ][G[f++]] + "-rate"
166+
defaultValue: K[f++],
167+
minValue: K[f++],
168+
maxValue: K[f++],
169+
automationRate: [ "a", "k" ][J[f++]] + "-rate"
165170
});
166171
h = S[a].audioWorklet.B.port;
167172
f = h.postMessage;
168-
b = (b = G[b]) ? V(b) : "";
173+
b = (b = J[b]) ? V(b) : "";
169174
f.call(h, {
170175
_wpn: b,
171176
D: e,
172177
F: a,
173178
u: c,
174179
v: d
175180
});
176-
}, ea = () => !1, fa = 1, ha = a => {
181+
}, ha = () => !1, ia = 1, ja = a => {
177182
a = a.data;
178183
let b = a._wsc;
179-
b && C.get(b)(...a.A);
180-
}, ia = a => E(a), ja = (a, b, c, d, e) => {
184+
b && E.get(b)(...a.A);
185+
}, ka = a => H(a), la = (a, b, c, d, e) => {
181186
let h = S[a], f = h.audioWorklet, m = () => {
182-
C.get(d)(a, 0, e);
187+
E.get(d)(a, 0, e);
183188
};
184189
if (!f) return m();
185190
f.addModule(k.js).then((() => {
186191
f.B = new AudioWorkletNode(h, "em-bootstrap", {
187192
processorOptions: {
188-
K: fa++,
193+
K: ia++,
189194
C: k.wasm,
190-
I: v,
195+
I: y,
191196
G: b,
192197
H: c
193198
}
194199
});
195-
f.B.port.onmessage = ha;
196-
C.get(d)(a, 1, e);
200+
f.B.port.onmessage = ja;
201+
E.get(d)(a, 1, e);
197202
})).catch(m);
198203
};
199204

200-
function ka(a) {
205+
function ma(a) {
201206
let b = document.createElement("button");
202207
b.innerHTML = "Toggle playback";
203208
document.body.appendChild(b);
@@ -207,35 +212,36 @@ function ka(a) {
207212
};
208213
}
209214

210-
function y() {
215+
function D() {
211216
Z = {
212-
f: ka,
213-
g: aa,
214-
d: ba,
215-
h: ca,
216-
e: da,
217-
b: ea,
218-
c: ja,
219-
a: v
217+
f: ma,
218+
g: ca,
219+
d: da,
220+
h: ea,
221+
e: fa,
222+
b: ha,
223+
c: la,
224+
a: y
220225
};
221226
WebAssembly.instantiate(k.wasm, {
222227
a: Z
223228
}).then((a => {
224229
a = a.instance.exports;
225-
X = a.j;
226-
J = a.l;
227-
E = a.m;
228-
D = a.n;
229-
Y = a.o;
230-
C = a.k;
231-
k.stackSave = R;
232-
k.stackAlloc = ia;
233-
k.stackRestore = Q;
234-
k.wasmTable = C;
235-
p ? (Y(r.G, r.H), "undefined" === typeof AudioWorkletGlobalScope && (removeEventListener("message", P),
236-
N = N.forEach(O), addEventListener("message", O))) : a.i();
237-
p || X();
230+
W = a.j;
231+
L = a.l;
232+
H = a.m;
233+
F = a.n;
234+
X = a.o;
235+
E = a.k;
236+
k.stackSave = ba;
237+
k.stackAlloc = ka;
238+
k.stackRestore = aa;
239+
k.wasmTable = E;
240+
p ? (X(v.G, v.H), "undefined" === typeof AudioWorkletGlobalScope && (removeEventListener("message", R),
241+
P = P.forEach(Q), addEventListener("message", Q))) : a.i();
242+
u?.(k);
243+
p || W();
238244
}));
239245
}
240246

241-
p || y();
247+
p || D();
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"a.html": 519,
33
"a.html.gz": 357,
4-
"a.js": 3853,
5-
"a.js.gz": 2045,
4+
"a.js": 3912,
5+
"a.js.gz": 2078,
66
"a.wasm": 1288,
77
"a.wasm.gz": 860,
8-
"total": 5660,
9-
"total_gz": 3262
8+
"total": 5719,
9+
"total_gz": 3295
1010
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1240
1+
1237
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2566
1+
2556

0 commit comments

Comments
 (0)