objdiff-wasm 2.0.0-beta.9 → 3.0.0-alpha.1
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/config-schema.json +256 -0
- package/dist/interfaces/objdiff-core-diff.d.ts +33 -0
- package/dist/interfaces/objdiff-core-display.d.ts +224 -0
- package/dist/interfaces/wasi-logging-logging.d.ts +18 -0
- package/dist/objdiff.core.wasm +0 -0
- package/dist/objdiff.d.ts +7 -0
- package/dist/objdiff.js +1351 -0
- package/dist/wasi-logging.js +24 -0
- package/package.json +11 -18
- package/dist/main.d.ts +0 -765
- package/dist/main.js +0 -1415
- package/dist/main.js.map +0 -1
- package/dist/objdiff_core_bg.wasm +0 -0
- package/dist/worker.js +0 -2
- package/dist/worker.js.map +0 -1
package/dist/main.js
DELETED
|
@@ -1,1415 +0,0 @@
|
|
|
1
|
-
// gen/diff_pb.ts
|
|
2
|
-
import { WireType } from "@protobuf-ts/runtime";
|
|
3
|
-
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
|
|
4
|
-
import { reflectionMergePartial } from "@protobuf-ts/runtime";
|
|
5
|
-
import { MessageType } from "@protobuf-ts/runtime";
|
|
6
|
-
var SymbolFlag = /* @__PURE__ */ ((SymbolFlag2) => {
|
|
7
|
-
SymbolFlag2[SymbolFlag2["SYMBOL_NONE"] = 0] = "SYMBOL_NONE";
|
|
8
|
-
SymbolFlag2[SymbolFlag2["SYMBOL_GLOBAL"] = 1] = "SYMBOL_GLOBAL";
|
|
9
|
-
SymbolFlag2[SymbolFlag2["SYMBOL_LOCAL"] = 2] = "SYMBOL_LOCAL";
|
|
10
|
-
SymbolFlag2[SymbolFlag2["SYMBOL_WEAK"] = 3] = "SYMBOL_WEAK";
|
|
11
|
-
SymbolFlag2[SymbolFlag2["SYMBOL_COMMON"] = 4] = "SYMBOL_COMMON";
|
|
12
|
-
SymbolFlag2[SymbolFlag2["SYMBOL_HIDDEN"] = 5] = "SYMBOL_HIDDEN";
|
|
13
|
-
return SymbolFlag2;
|
|
14
|
-
})(SymbolFlag || {});
|
|
15
|
-
var DiffKind = /* @__PURE__ */ ((DiffKind2) => {
|
|
16
|
-
DiffKind2[DiffKind2["DIFF_NONE"] = 0] = "DIFF_NONE";
|
|
17
|
-
DiffKind2[DiffKind2["DIFF_REPLACE"] = 1] = "DIFF_REPLACE";
|
|
18
|
-
DiffKind2[DiffKind2["DIFF_DELETE"] = 2] = "DIFF_DELETE";
|
|
19
|
-
DiffKind2[DiffKind2["DIFF_INSERT"] = 3] = "DIFF_INSERT";
|
|
20
|
-
DiffKind2[DiffKind2["DIFF_OP_MISMATCH"] = 4] = "DIFF_OP_MISMATCH";
|
|
21
|
-
DiffKind2[DiffKind2["DIFF_ARG_MISMATCH"] = 5] = "DIFF_ARG_MISMATCH";
|
|
22
|
-
return DiffKind2;
|
|
23
|
-
})(DiffKind || {});
|
|
24
|
-
var SectionKind = /* @__PURE__ */ ((SectionKind2) => {
|
|
25
|
-
SectionKind2[SectionKind2["SECTION_UNKNOWN"] = 0] = "SECTION_UNKNOWN";
|
|
26
|
-
SectionKind2[SectionKind2["SECTION_TEXT"] = 1] = "SECTION_TEXT";
|
|
27
|
-
SectionKind2[SectionKind2["SECTION_DATA"] = 2] = "SECTION_DATA";
|
|
28
|
-
SectionKind2[SectionKind2["SECTION_BSS"] = 3] = "SECTION_BSS";
|
|
29
|
-
SectionKind2[SectionKind2["SECTION_COMMON"] = 4] = "SECTION_COMMON";
|
|
30
|
-
return SectionKind2;
|
|
31
|
-
})(SectionKind || {});
|
|
32
|
-
var Symbol$Type = class extends MessageType {
|
|
33
|
-
constructor() {
|
|
34
|
-
super("objdiff.diff.Symbol", [
|
|
35
|
-
{
|
|
36
|
-
no: 1,
|
|
37
|
-
name: "name",
|
|
38
|
-
kind: "scalar",
|
|
39
|
-
T: 9
|
|
40
|
-
/*ScalarType.STRING*/
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
no: 2,
|
|
44
|
-
name: "demangled_name",
|
|
45
|
-
kind: "scalar",
|
|
46
|
-
localName: "demangled_name",
|
|
47
|
-
opt: true,
|
|
48
|
-
T: 9
|
|
49
|
-
/*ScalarType.STRING*/
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
no: 3,
|
|
53
|
-
name: "address",
|
|
54
|
-
kind: "scalar",
|
|
55
|
-
T: 4,
|
|
56
|
-
L: 0
|
|
57
|
-
/*LongType.BIGINT*/
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
no: 4,
|
|
61
|
-
name: "size",
|
|
62
|
-
kind: "scalar",
|
|
63
|
-
T: 4,
|
|
64
|
-
L: 0
|
|
65
|
-
/*LongType.BIGINT*/
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
no: 5,
|
|
69
|
-
name: "flags",
|
|
70
|
-
kind: "scalar",
|
|
71
|
-
T: 13
|
|
72
|
-
/*ScalarType.UINT32*/
|
|
73
|
-
}
|
|
74
|
-
]);
|
|
75
|
-
}
|
|
76
|
-
create(value) {
|
|
77
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
78
|
-
message.name = "";
|
|
79
|
-
message.address = 0n;
|
|
80
|
-
message.size = 0n;
|
|
81
|
-
message.flags = 0;
|
|
82
|
-
if (value !== void 0)
|
|
83
|
-
reflectionMergePartial(this, message, value);
|
|
84
|
-
return message;
|
|
85
|
-
}
|
|
86
|
-
internalBinaryRead(reader, length, options, target) {
|
|
87
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
88
|
-
while (reader.pos < end) {
|
|
89
|
-
let [fieldNo, wireType] = reader.tag();
|
|
90
|
-
switch (fieldNo) {
|
|
91
|
-
case /* string name */
|
|
92
|
-
1:
|
|
93
|
-
message.name = reader.string();
|
|
94
|
-
break;
|
|
95
|
-
case /* optional string demangled_name */
|
|
96
|
-
2:
|
|
97
|
-
message.demangled_name = reader.string();
|
|
98
|
-
break;
|
|
99
|
-
case /* uint64 address */
|
|
100
|
-
3:
|
|
101
|
-
message.address = reader.uint64().toBigInt();
|
|
102
|
-
break;
|
|
103
|
-
case /* uint64 size */
|
|
104
|
-
4:
|
|
105
|
-
message.size = reader.uint64().toBigInt();
|
|
106
|
-
break;
|
|
107
|
-
case /* uint32 flags */
|
|
108
|
-
5:
|
|
109
|
-
message.flags = reader.uint32();
|
|
110
|
-
break;
|
|
111
|
-
default:
|
|
112
|
-
let u = options.readUnknownField;
|
|
113
|
-
if (u === "throw")
|
|
114
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
115
|
-
let d = reader.skip(wireType);
|
|
116
|
-
if (u !== false)
|
|
117
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return message;
|
|
121
|
-
}
|
|
122
|
-
internalBinaryWrite(message, writer, options) {
|
|
123
|
-
if (message.name !== "")
|
|
124
|
-
writer.tag(1, WireType.LengthDelimited).string(message.name);
|
|
125
|
-
if (message.demangled_name !== void 0)
|
|
126
|
-
writer.tag(2, WireType.LengthDelimited).string(message.demangled_name);
|
|
127
|
-
if (message.address !== 0n)
|
|
128
|
-
writer.tag(3, WireType.Varint).uint64(message.address);
|
|
129
|
-
if (message.size !== 0n)
|
|
130
|
-
writer.tag(4, WireType.Varint).uint64(message.size);
|
|
131
|
-
if (message.flags !== 0)
|
|
132
|
-
writer.tag(5, WireType.Varint).uint32(message.flags);
|
|
133
|
-
let u = options.writeUnknownFields;
|
|
134
|
-
if (u !== false)
|
|
135
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
136
|
-
return writer;
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
var Symbol = new Symbol$Type();
|
|
140
|
-
var Instruction$Type = class extends MessageType {
|
|
141
|
-
constructor() {
|
|
142
|
-
super("objdiff.diff.Instruction", [
|
|
143
|
-
{
|
|
144
|
-
no: 1,
|
|
145
|
-
name: "address",
|
|
146
|
-
kind: "scalar",
|
|
147
|
-
T: 4,
|
|
148
|
-
L: 0
|
|
149
|
-
/*LongType.BIGINT*/
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
no: 2,
|
|
153
|
-
name: "size",
|
|
154
|
-
kind: "scalar",
|
|
155
|
-
T: 13
|
|
156
|
-
/*ScalarType.UINT32*/
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
no: 3,
|
|
160
|
-
name: "opcode",
|
|
161
|
-
kind: "scalar",
|
|
162
|
-
T: 13
|
|
163
|
-
/*ScalarType.UINT32*/
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
no: 4,
|
|
167
|
-
name: "mnemonic",
|
|
168
|
-
kind: "scalar",
|
|
169
|
-
T: 9
|
|
170
|
-
/*ScalarType.STRING*/
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
no: 5,
|
|
174
|
-
name: "formatted",
|
|
175
|
-
kind: "scalar",
|
|
176
|
-
T: 9
|
|
177
|
-
/*ScalarType.STRING*/
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
no: 6,
|
|
181
|
-
name: "original",
|
|
182
|
-
kind: "scalar",
|
|
183
|
-
opt: true,
|
|
184
|
-
T: 9
|
|
185
|
-
/*ScalarType.STRING*/
|
|
186
|
-
},
|
|
187
|
-
{ no: 7, name: "arguments", kind: "message", repeat: 1, T: () => Argument },
|
|
188
|
-
{ no: 8, name: "relocation", kind: "message", T: () => Relocation },
|
|
189
|
-
{
|
|
190
|
-
no: 9,
|
|
191
|
-
name: "branch_dest",
|
|
192
|
-
kind: "scalar",
|
|
193
|
-
localName: "branch_dest",
|
|
194
|
-
opt: true,
|
|
195
|
-
T: 4,
|
|
196
|
-
L: 0
|
|
197
|
-
/*LongType.BIGINT*/
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
no: 10,
|
|
201
|
-
name: "line_number",
|
|
202
|
-
kind: "scalar",
|
|
203
|
-
localName: "line_number",
|
|
204
|
-
opt: true,
|
|
205
|
-
T: 13
|
|
206
|
-
/*ScalarType.UINT32*/
|
|
207
|
-
}
|
|
208
|
-
]);
|
|
209
|
-
}
|
|
210
|
-
create(value) {
|
|
211
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
212
|
-
message.address = 0n;
|
|
213
|
-
message.size = 0;
|
|
214
|
-
message.opcode = 0;
|
|
215
|
-
message.mnemonic = "";
|
|
216
|
-
message.formatted = "";
|
|
217
|
-
message.arguments = [];
|
|
218
|
-
if (value !== void 0)
|
|
219
|
-
reflectionMergePartial(this, message, value);
|
|
220
|
-
return message;
|
|
221
|
-
}
|
|
222
|
-
internalBinaryRead(reader, length, options, target) {
|
|
223
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
224
|
-
while (reader.pos < end) {
|
|
225
|
-
let [fieldNo, wireType] = reader.tag();
|
|
226
|
-
switch (fieldNo) {
|
|
227
|
-
case /* uint64 address */
|
|
228
|
-
1:
|
|
229
|
-
message.address = reader.uint64().toBigInt();
|
|
230
|
-
break;
|
|
231
|
-
case /* uint32 size */
|
|
232
|
-
2:
|
|
233
|
-
message.size = reader.uint32();
|
|
234
|
-
break;
|
|
235
|
-
case /* uint32 opcode */
|
|
236
|
-
3:
|
|
237
|
-
message.opcode = reader.uint32();
|
|
238
|
-
break;
|
|
239
|
-
case /* string mnemonic */
|
|
240
|
-
4:
|
|
241
|
-
message.mnemonic = reader.string();
|
|
242
|
-
break;
|
|
243
|
-
case /* string formatted */
|
|
244
|
-
5:
|
|
245
|
-
message.formatted = reader.string();
|
|
246
|
-
break;
|
|
247
|
-
case /* optional string original */
|
|
248
|
-
6:
|
|
249
|
-
message.original = reader.string();
|
|
250
|
-
break;
|
|
251
|
-
case /* repeated objdiff.diff.Argument arguments */
|
|
252
|
-
7:
|
|
253
|
-
message.arguments.push(Argument.internalBinaryRead(reader, reader.uint32(), options));
|
|
254
|
-
break;
|
|
255
|
-
case /* optional objdiff.diff.Relocation relocation */
|
|
256
|
-
8:
|
|
257
|
-
message.relocation = Relocation.internalBinaryRead(reader, reader.uint32(), options, message.relocation);
|
|
258
|
-
break;
|
|
259
|
-
case /* optional uint64 branch_dest */
|
|
260
|
-
9:
|
|
261
|
-
message.branch_dest = reader.uint64().toBigInt();
|
|
262
|
-
break;
|
|
263
|
-
case /* optional uint32 line_number */
|
|
264
|
-
10:
|
|
265
|
-
message.line_number = reader.uint32();
|
|
266
|
-
break;
|
|
267
|
-
default:
|
|
268
|
-
let u = options.readUnknownField;
|
|
269
|
-
if (u === "throw")
|
|
270
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
271
|
-
let d = reader.skip(wireType);
|
|
272
|
-
if (u !== false)
|
|
273
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
return message;
|
|
277
|
-
}
|
|
278
|
-
internalBinaryWrite(message, writer, options) {
|
|
279
|
-
if (message.address !== 0n)
|
|
280
|
-
writer.tag(1, WireType.Varint).uint64(message.address);
|
|
281
|
-
if (message.size !== 0)
|
|
282
|
-
writer.tag(2, WireType.Varint).uint32(message.size);
|
|
283
|
-
if (message.opcode !== 0)
|
|
284
|
-
writer.tag(3, WireType.Varint).uint32(message.opcode);
|
|
285
|
-
if (message.mnemonic !== "")
|
|
286
|
-
writer.tag(4, WireType.LengthDelimited).string(message.mnemonic);
|
|
287
|
-
if (message.formatted !== "")
|
|
288
|
-
writer.tag(5, WireType.LengthDelimited).string(message.formatted);
|
|
289
|
-
if (message.original !== void 0)
|
|
290
|
-
writer.tag(6, WireType.LengthDelimited).string(message.original);
|
|
291
|
-
for (let i = 0; i < message.arguments.length; i++)
|
|
292
|
-
Argument.internalBinaryWrite(message.arguments[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join();
|
|
293
|
-
if (message.relocation)
|
|
294
|
-
Relocation.internalBinaryWrite(message.relocation, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
|
|
295
|
-
if (message.branch_dest !== void 0)
|
|
296
|
-
writer.tag(9, WireType.Varint).uint64(message.branch_dest);
|
|
297
|
-
if (message.line_number !== void 0)
|
|
298
|
-
writer.tag(10, WireType.Varint).uint32(message.line_number);
|
|
299
|
-
let u = options.writeUnknownFields;
|
|
300
|
-
if (u !== false)
|
|
301
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
302
|
-
return writer;
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
var Instruction = new Instruction$Type();
|
|
306
|
-
var Argument$Type = class extends MessageType {
|
|
307
|
-
constructor() {
|
|
308
|
-
super("objdiff.diff.Argument", [
|
|
309
|
-
{
|
|
310
|
-
no: 1,
|
|
311
|
-
name: "plain_text",
|
|
312
|
-
kind: "scalar",
|
|
313
|
-
localName: "plain_text",
|
|
314
|
-
oneof: "value",
|
|
315
|
-
T: 9
|
|
316
|
-
/*ScalarType.STRING*/
|
|
317
|
-
},
|
|
318
|
-
{ no: 2, name: "argument", kind: "message", oneof: "value", T: () => ArgumentValue },
|
|
319
|
-
{ no: 3, name: "relocation", kind: "message", oneof: "value", T: () => ArgumentRelocation },
|
|
320
|
-
{
|
|
321
|
-
no: 4,
|
|
322
|
-
name: "branch_dest",
|
|
323
|
-
kind: "scalar",
|
|
324
|
-
localName: "branch_dest",
|
|
325
|
-
oneof: "value",
|
|
326
|
-
T: 4,
|
|
327
|
-
L: 0
|
|
328
|
-
/*LongType.BIGINT*/
|
|
329
|
-
}
|
|
330
|
-
]);
|
|
331
|
-
}
|
|
332
|
-
create(value) {
|
|
333
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
334
|
-
message.value = { oneofKind: void 0 };
|
|
335
|
-
if (value !== void 0)
|
|
336
|
-
reflectionMergePartial(this, message, value);
|
|
337
|
-
return message;
|
|
338
|
-
}
|
|
339
|
-
internalBinaryRead(reader, length, options, target) {
|
|
340
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
341
|
-
while (reader.pos < end) {
|
|
342
|
-
let [fieldNo, wireType] = reader.tag();
|
|
343
|
-
switch (fieldNo) {
|
|
344
|
-
case /* string plain_text */
|
|
345
|
-
1:
|
|
346
|
-
message.value = {
|
|
347
|
-
oneofKind: "plain_text",
|
|
348
|
-
plain_text: reader.string()
|
|
349
|
-
};
|
|
350
|
-
break;
|
|
351
|
-
case /* objdiff.diff.ArgumentValue argument */
|
|
352
|
-
2:
|
|
353
|
-
message.value = {
|
|
354
|
-
oneofKind: "argument",
|
|
355
|
-
argument: ArgumentValue.internalBinaryRead(reader, reader.uint32(), options, message.value.argument)
|
|
356
|
-
};
|
|
357
|
-
break;
|
|
358
|
-
case /* objdiff.diff.ArgumentRelocation relocation */
|
|
359
|
-
3:
|
|
360
|
-
message.value = {
|
|
361
|
-
oneofKind: "relocation",
|
|
362
|
-
relocation: ArgumentRelocation.internalBinaryRead(reader, reader.uint32(), options, message.value.relocation)
|
|
363
|
-
};
|
|
364
|
-
break;
|
|
365
|
-
case /* uint64 branch_dest */
|
|
366
|
-
4:
|
|
367
|
-
message.value = {
|
|
368
|
-
oneofKind: "branch_dest",
|
|
369
|
-
branch_dest: reader.uint64().toBigInt()
|
|
370
|
-
};
|
|
371
|
-
break;
|
|
372
|
-
default:
|
|
373
|
-
let u = options.readUnknownField;
|
|
374
|
-
if (u === "throw")
|
|
375
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
376
|
-
let d = reader.skip(wireType);
|
|
377
|
-
if (u !== false)
|
|
378
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
return message;
|
|
382
|
-
}
|
|
383
|
-
internalBinaryWrite(message, writer, options) {
|
|
384
|
-
if (message.value.oneofKind === "plain_text")
|
|
385
|
-
writer.tag(1, WireType.LengthDelimited).string(message.value.plain_text);
|
|
386
|
-
if (message.value.oneofKind === "argument")
|
|
387
|
-
ArgumentValue.internalBinaryWrite(message.value.argument, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
|
388
|
-
if (message.value.oneofKind === "relocation")
|
|
389
|
-
ArgumentRelocation.internalBinaryWrite(message.value.relocation, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
|
390
|
-
if (message.value.oneofKind === "branch_dest")
|
|
391
|
-
writer.tag(4, WireType.Varint).uint64(message.value.branch_dest);
|
|
392
|
-
let u = options.writeUnknownFields;
|
|
393
|
-
if (u !== false)
|
|
394
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
395
|
-
return writer;
|
|
396
|
-
}
|
|
397
|
-
};
|
|
398
|
-
var Argument = new Argument$Type();
|
|
399
|
-
var ArgumentValue$Type = class extends MessageType {
|
|
400
|
-
constructor() {
|
|
401
|
-
super("objdiff.diff.ArgumentValue", [
|
|
402
|
-
{
|
|
403
|
-
no: 1,
|
|
404
|
-
name: "signed",
|
|
405
|
-
kind: "scalar",
|
|
406
|
-
oneof: "value",
|
|
407
|
-
T: 3,
|
|
408
|
-
L: 0
|
|
409
|
-
/*LongType.BIGINT*/
|
|
410
|
-
},
|
|
411
|
-
{
|
|
412
|
-
no: 2,
|
|
413
|
-
name: "unsigned",
|
|
414
|
-
kind: "scalar",
|
|
415
|
-
oneof: "value",
|
|
416
|
-
T: 4,
|
|
417
|
-
L: 0
|
|
418
|
-
/*LongType.BIGINT*/
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
no: 3,
|
|
422
|
-
name: "opaque",
|
|
423
|
-
kind: "scalar",
|
|
424
|
-
oneof: "value",
|
|
425
|
-
T: 9
|
|
426
|
-
/*ScalarType.STRING*/
|
|
427
|
-
}
|
|
428
|
-
]);
|
|
429
|
-
}
|
|
430
|
-
create(value) {
|
|
431
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
432
|
-
message.value = { oneofKind: void 0 };
|
|
433
|
-
if (value !== void 0)
|
|
434
|
-
reflectionMergePartial(this, message, value);
|
|
435
|
-
return message;
|
|
436
|
-
}
|
|
437
|
-
internalBinaryRead(reader, length, options, target) {
|
|
438
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
439
|
-
while (reader.pos < end) {
|
|
440
|
-
let [fieldNo, wireType] = reader.tag();
|
|
441
|
-
switch (fieldNo) {
|
|
442
|
-
case /* int64 signed */
|
|
443
|
-
1:
|
|
444
|
-
message.value = {
|
|
445
|
-
oneofKind: "signed",
|
|
446
|
-
signed: reader.int64().toBigInt()
|
|
447
|
-
};
|
|
448
|
-
break;
|
|
449
|
-
case /* uint64 unsigned */
|
|
450
|
-
2:
|
|
451
|
-
message.value = {
|
|
452
|
-
oneofKind: "unsigned",
|
|
453
|
-
unsigned: reader.uint64().toBigInt()
|
|
454
|
-
};
|
|
455
|
-
break;
|
|
456
|
-
case /* string opaque */
|
|
457
|
-
3:
|
|
458
|
-
message.value = {
|
|
459
|
-
oneofKind: "opaque",
|
|
460
|
-
opaque: reader.string()
|
|
461
|
-
};
|
|
462
|
-
break;
|
|
463
|
-
default:
|
|
464
|
-
let u = options.readUnknownField;
|
|
465
|
-
if (u === "throw")
|
|
466
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
467
|
-
let d = reader.skip(wireType);
|
|
468
|
-
if (u !== false)
|
|
469
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
return message;
|
|
473
|
-
}
|
|
474
|
-
internalBinaryWrite(message, writer, options) {
|
|
475
|
-
if (message.value.oneofKind === "signed")
|
|
476
|
-
writer.tag(1, WireType.Varint).int64(message.value.signed);
|
|
477
|
-
if (message.value.oneofKind === "unsigned")
|
|
478
|
-
writer.tag(2, WireType.Varint).uint64(message.value.unsigned);
|
|
479
|
-
if (message.value.oneofKind === "opaque")
|
|
480
|
-
writer.tag(3, WireType.LengthDelimited).string(message.value.opaque);
|
|
481
|
-
let u = options.writeUnknownFields;
|
|
482
|
-
if (u !== false)
|
|
483
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
484
|
-
return writer;
|
|
485
|
-
}
|
|
486
|
-
};
|
|
487
|
-
var ArgumentValue = new ArgumentValue$Type();
|
|
488
|
-
var ArgumentRelocation$Type = class extends MessageType {
|
|
489
|
-
constructor() {
|
|
490
|
-
super("objdiff.diff.ArgumentRelocation", []);
|
|
491
|
-
}
|
|
492
|
-
create(value) {
|
|
493
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
494
|
-
if (value !== void 0)
|
|
495
|
-
reflectionMergePartial(this, message, value);
|
|
496
|
-
return message;
|
|
497
|
-
}
|
|
498
|
-
internalBinaryRead(reader, length, options, target) {
|
|
499
|
-
return target ?? this.create();
|
|
500
|
-
}
|
|
501
|
-
internalBinaryWrite(message, writer, options) {
|
|
502
|
-
let u = options.writeUnknownFields;
|
|
503
|
-
if (u !== false)
|
|
504
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
505
|
-
return writer;
|
|
506
|
-
}
|
|
507
|
-
};
|
|
508
|
-
var ArgumentRelocation = new ArgumentRelocation$Type();
|
|
509
|
-
var Relocation$Type = class extends MessageType {
|
|
510
|
-
constructor() {
|
|
511
|
-
super("objdiff.diff.Relocation", [
|
|
512
|
-
{
|
|
513
|
-
no: 1,
|
|
514
|
-
name: "type",
|
|
515
|
-
kind: "scalar",
|
|
516
|
-
T: 13
|
|
517
|
-
/*ScalarType.UINT32*/
|
|
518
|
-
},
|
|
519
|
-
{
|
|
520
|
-
no: 2,
|
|
521
|
-
name: "type_name",
|
|
522
|
-
kind: "scalar",
|
|
523
|
-
localName: "type_name",
|
|
524
|
-
T: 9
|
|
525
|
-
/*ScalarType.STRING*/
|
|
526
|
-
},
|
|
527
|
-
{ no: 3, name: "target", kind: "message", T: () => RelocationTarget }
|
|
528
|
-
]);
|
|
529
|
-
}
|
|
530
|
-
create(value) {
|
|
531
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
532
|
-
message.type = 0;
|
|
533
|
-
message.type_name = "";
|
|
534
|
-
if (value !== void 0)
|
|
535
|
-
reflectionMergePartial(this, message, value);
|
|
536
|
-
return message;
|
|
537
|
-
}
|
|
538
|
-
internalBinaryRead(reader, length, options, target) {
|
|
539
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
540
|
-
while (reader.pos < end) {
|
|
541
|
-
let [fieldNo, wireType] = reader.tag();
|
|
542
|
-
switch (fieldNo) {
|
|
543
|
-
case /* uint32 type */
|
|
544
|
-
1:
|
|
545
|
-
message.type = reader.uint32();
|
|
546
|
-
break;
|
|
547
|
-
case /* string type_name */
|
|
548
|
-
2:
|
|
549
|
-
message.type_name = reader.string();
|
|
550
|
-
break;
|
|
551
|
-
case /* objdiff.diff.RelocationTarget target */
|
|
552
|
-
3:
|
|
553
|
-
message.target = RelocationTarget.internalBinaryRead(reader, reader.uint32(), options, message.target);
|
|
554
|
-
break;
|
|
555
|
-
default:
|
|
556
|
-
let u = options.readUnknownField;
|
|
557
|
-
if (u === "throw")
|
|
558
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
559
|
-
let d = reader.skip(wireType);
|
|
560
|
-
if (u !== false)
|
|
561
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
return message;
|
|
565
|
-
}
|
|
566
|
-
internalBinaryWrite(message, writer, options) {
|
|
567
|
-
if (message.type !== 0)
|
|
568
|
-
writer.tag(1, WireType.Varint).uint32(message.type);
|
|
569
|
-
if (message.type_name !== "")
|
|
570
|
-
writer.tag(2, WireType.LengthDelimited).string(message.type_name);
|
|
571
|
-
if (message.target)
|
|
572
|
-
RelocationTarget.internalBinaryWrite(message.target, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
|
573
|
-
let u = options.writeUnknownFields;
|
|
574
|
-
if (u !== false)
|
|
575
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
576
|
-
return writer;
|
|
577
|
-
}
|
|
578
|
-
};
|
|
579
|
-
var Relocation = new Relocation$Type();
|
|
580
|
-
var RelocationTarget$Type = class extends MessageType {
|
|
581
|
-
constructor() {
|
|
582
|
-
super("objdiff.diff.RelocationTarget", [
|
|
583
|
-
{ no: 1, name: "symbol", kind: "message", T: () => Symbol },
|
|
584
|
-
{
|
|
585
|
-
no: 2,
|
|
586
|
-
name: "addend",
|
|
587
|
-
kind: "scalar",
|
|
588
|
-
T: 3,
|
|
589
|
-
L: 0
|
|
590
|
-
/*LongType.BIGINT*/
|
|
591
|
-
}
|
|
592
|
-
]);
|
|
593
|
-
}
|
|
594
|
-
create(value) {
|
|
595
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
596
|
-
message.addend = 0n;
|
|
597
|
-
if (value !== void 0)
|
|
598
|
-
reflectionMergePartial(this, message, value);
|
|
599
|
-
return message;
|
|
600
|
-
}
|
|
601
|
-
internalBinaryRead(reader, length, options, target) {
|
|
602
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
603
|
-
while (reader.pos < end) {
|
|
604
|
-
let [fieldNo, wireType] = reader.tag();
|
|
605
|
-
switch (fieldNo) {
|
|
606
|
-
case /* objdiff.diff.Symbol symbol */
|
|
607
|
-
1:
|
|
608
|
-
message.symbol = Symbol.internalBinaryRead(reader, reader.uint32(), options, message.symbol);
|
|
609
|
-
break;
|
|
610
|
-
case /* int64 addend */
|
|
611
|
-
2:
|
|
612
|
-
message.addend = reader.int64().toBigInt();
|
|
613
|
-
break;
|
|
614
|
-
default:
|
|
615
|
-
let u = options.readUnknownField;
|
|
616
|
-
if (u === "throw")
|
|
617
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
618
|
-
let d = reader.skip(wireType);
|
|
619
|
-
if (u !== false)
|
|
620
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
return message;
|
|
624
|
-
}
|
|
625
|
-
internalBinaryWrite(message, writer, options) {
|
|
626
|
-
if (message.symbol)
|
|
627
|
-
Symbol.internalBinaryWrite(message.symbol, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
628
|
-
if (message.addend !== 0n)
|
|
629
|
-
writer.tag(2, WireType.Varint).int64(message.addend);
|
|
630
|
-
let u = options.writeUnknownFields;
|
|
631
|
-
if (u !== false)
|
|
632
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
633
|
-
return writer;
|
|
634
|
-
}
|
|
635
|
-
};
|
|
636
|
-
var RelocationTarget = new RelocationTarget$Type();
|
|
637
|
-
var InstructionDiff$Type = class extends MessageType {
|
|
638
|
-
constructor() {
|
|
639
|
-
super("objdiff.diff.InstructionDiff", [
|
|
640
|
-
{ no: 1, name: "diff_kind", kind: "enum", localName: "diff_kind", T: () => ["objdiff.diff.DiffKind", DiffKind] },
|
|
641
|
-
{ no: 2, name: "instruction", kind: "message", T: () => Instruction },
|
|
642
|
-
{ no: 3, name: "branch_from", kind: "message", localName: "branch_from", T: () => InstructionBranchFrom },
|
|
643
|
-
{ no: 4, name: "branch_to", kind: "message", localName: "branch_to", T: () => InstructionBranchTo },
|
|
644
|
-
{ no: 5, name: "arg_diff", kind: "message", localName: "arg_diff", repeat: 1, T: () => ArgumentDiff }
|
|
645
|
-
]);
|
|
646
|
-
}
|
|
647
|
-
create(value) {
|
|
648
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
649
|
-
message.diff_kind = 0;
|
|
650
|
-
message.arg_diff = [];
|
|
651
|
-
if (value !== void 0)
|
|
652
|
-
reflectionMergePartial(this, message, value);
|
|
653
|
-
return message;
|
|
654
|
-
}
|
|
655
|
-
internalBinaryRead(reader, length, options, target) {
|
|
656
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
657
|
-
while (reader.pos < end) {
|
|
658
|
-
let [fieldNo, wireType] = reader.tag();
|
|
659
|
-
switch (fieldNo) {
|
|
660
|
-
case /* objdiff.diff.DiffKind diff_kind */
|
|
661
|
-
1:
|
|
662
|
-
message.diff_kind = reader.int32();
|
|
663
|
-
break;
|
|
664
|
-
case /* optional objdiff.diff.Instruction instruction */
|
|
665
|
-
2:
|
|
666
|
-
message.instruction = Instruction.internalBinaryRead(reader, reader.uint32(), options, message.instruction);
|
|
667
|
-
break;
|
|
668
|
-
case /* optional objdiff.diff.InstructionBranchFrom branch_from */
|
|
669
|
-
3:
|
|
670
|
-
message.branch_from = InstructionBranchFrom.internalBinaryRead(reader, reader.uint32(), options, message.branch_from);
|
|
671
|
-
break;
|
|
672
|
-
case /* optional objdiff.diff.InstructionBranchTo branch_to */
|
|
673
|
-
4:
|
|
674
|
-
message.branch_to = InstructionBranchTo.internalBinaryRead(reader, reader.uint32(), options, message.branch_to);
|
|
675
|
-
break;
|
|
676
|
-
case /* repeated objdiff.diff.ArgumentDiff arg_diff */
|
|
677
|
-
5:
|
|
678
|
-
message.arg_diff.push(ArgumentDiff.internalBinaryRead(reader, reader.uint32(), options));
|
|
679
|
-
break;
|
|
680
|
-
default:
|
|
681
|
-
let u = options.readUnknownField;
|
|
682
|
-
if (u === "throw")
|
|
683
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
684
|
-
let d = reader.skip(wireType);
|
|
685
|
-
if (u !== false)
|
|
686
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
return message;
|
|
690
|
-
}
|
|
691
|
-
internalBinaryWrite(message, writer, options) {
|
|
692
|
-
if (message.diff_kind !== 0)
|
|
693
|
-
writer.tag(1, WireType.Varint).int32(message.diff_kind);
|
|
694
|
-
if (message.instruction)
|
|
695
|
-
Instruction.internalBinaryWrite(message.instruction, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
|
696
|
-
if (message.branch_from)
|
|
697
|
-
InstructionBranchFrom.internalBinaryWrite(message.branch_from, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
|
|
698
|
-
if (message.branch_to)
|
|
699
|
-
InstructionBranchTo.internalBinaryWrite(message.branch_to, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
|
|
700
|
-
for (let i = 0; i < message.arg_diff.length; i++)
|
|
701
|
-
ArgumentDiff.internalBinaryWrite(message.arg_diff[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
|
|
702
|
-
let u = options.writeUnknownFields;
|
|
703
|
-
if (u !== false)
|
|
704
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
705
|
-
return writer;
|
|
706
|
-
}
|
|
707
|
-
};
|
|
708
|
-
var InstructionDiff = new InstructionDiff$Type();
|
|
709
|
-
var ArgumentDiff$Type = class extends MessageType {
|
|
710
|
-
constructor() {
|
|
711
|
-
super("objdiff.diff.ArgumentDiff", [
|
|
712
|
-
{
|
|
713
|
-
no: 1,
|
|
714
|
-
name: "diff_index",
|
|
715
|
-
kind: "scalar",
|
|
716
|
-
localName: "diff_index",
|
|
717
|
-
opt: true,
|
|
718
|
-
T: 13
|
|
719
|
-
/*ScalarType.UINT32*/
|
|
720
|
-
}
|
|
721
|
-
]);
|
|
722
|
-
}
|
|
723
|
-
create(value) {
|
|
724
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
725
|
-
if (value !== void 0)
|
|
726
|
-
reflectionMergePartial(this, message, value);
|
|
727
|
-
return message;
|
|
728
|
-
}
|
|
729
|
-
internalBinaryRead(reader, length, options, target) {
|
|
730
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
731
|
-
while (reader.pos < end) {
|
|
732
|
-
let [fieldNo, wireType] = reader.tag();
|
|
733
|
-
switch (fieldNo) {
|
|
734
|
-
case /* optional uint32 diff_index */
|
|
735
|
-
1:
|
|
736
|
-
message.diff_index = reader.uint32();
|
|
737
|
-
break;
|
|
738
|
-
default:
|
|
739
|
-
let u = options.readUnknownField;
|
|
740
|
-
if (u === "throw")
|
|
741
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
742
|
-
let d = reader.skip(wireType);
|
|
743
|
-
if (u !== false)
|
|
744
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
return message;
|
|
748
|
-
}
|
|
749
|
-
internalBinaryWrite(message, writer, options) {
|
|
750
|
-
if (message.diff_index !== void 0)
|
|
751
|
-
writer.tag(1, WireType.Varint).uint32(message.diff_index);
|
|
752
|
-
let u = options.writeUnknownFields;
|
|
753
|
-
if (u !== false)
|
|
754
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
755
|
-
return writer;
|
|
756
|
-
}
|
|
757
|
-
};
|
|
758
|
-
var ArgumentDiff = new ArgumentDiff$Type();
|
|
759
|
-
var InstructionBranchFrom$Type = class extends MessageType {
|
|
760
|
-
constructor() {
|
|
761
|
-
super("objdiff.diff.InstructionBranchFrom", [
|
|
762
|
-
{
|
|
763
|
-
no: 1,
|
|
764
|
-
name: "instruction_index",
|
|
765
|
-
kind: "scalar",
|
|
766
|
-
localName: "instruction_index",
|
|
767
|
-
repeat: 1,
|
|
768
|
-
T: 13
|
|
769
|
-
/*ScalarType.UINT32*/
|
|
770
|
-
},
|
|
771
|
-
{
|
|
772
|
-
no: 2,
|
|
773
|
-
name: "branch_index",
|
|
774
|
-
kind: "scalar",
|
|
775
|
-
localName: "branch_index",
|
|
776
|
-
T: 13
|
|
777
|
-
/*ScalarType.UINT32*/
|
|
778
|
-
}
|
|
779
|
-
]);
|
|
780
|
-
}
|
|
781
|
-
create(value) {
|
|
782
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
783
|
-
message.instruction_index = [];
|
|
784
|
-
message.branch_index = 0;
|
|
785
|
-
if (value !== void 0)
|
|
786
|
-
reflectionMergePartial(this, message, value);
|
|
787
|
-
return message;
|
|
788
|
-
}
|
|
789
|
-
internalBinaryRead(reader, length, options, target) {
|
|
790
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
791
|
-
while (reader.pos < end) {
|
|
792
|
-
let [fieldNo, wireType] = reader.tag();
|
|
793
|
-
switch (fieldNo) {
|
|
794
|
-
case /* repeated uint32 instruction_index */
|
|
795
|
-
1:
|
|
796
|
-
if (wireType === WireType.LengthDelimited)
|
|
797
|
-
for (let e = reader.int32() + reader.pos; reader.pos < e; )
|
|
798
|
-
message.instruction_index.push(reader.uint32());
|
|
799
|
-
else
|
|
800
|
-
message.instruction_index.push(reader.uint32());
|
|
801
|
-
break;
|
|
802
|
-
case /* uint32 branch_index */
|
|
803
|
-
2:
|
|
804
|
-
message.branch_index = reader.uint32();
|
|
805
|
-
break;
|
|
806
|
-
default:
|
|
807
|
-
let u = options.readUnknownField;
|
|
808
|
-
if (u === "throw")
|
|
809
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
810
|
-
let d = reader.skip(wireType);
|
|
811
|
-
if (u !== false)
|
|
812
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
return message;
|
|
816
|
-
}
|
|
817
|
-
internalBinaryWrite(message, writer, options) {
|
|
818
|
-
if (message.instruction_index.length) {
|
|
819
|
-
writer.tag(1, WireType.LengthDelimited).fork();
|
|
820
|
-
for (let i = 0; i < message.instruction_index.length; i++)
|
|
821
|
-
writer.uint32(message.instruction_index[i]);
|
|
822
|
-
writer.join();
|
|
823
|
-
}
|
|
824
|
-
if (message.branch_index !== 0)
|
|
825
|
-
writer.tag(2, WireType.Varint).uint32(message.branch_index);
|
|
826
|
-
let u = options.writeUnknownFields;
|
|
827
|
-
if (u !== false)
|
|
828
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
829
|
-
return writer;
|
|
830
|
-
}
|
|
831
|
-
};
|
|
832
|
-
var InstructionBranchFrom = new InstructionBranchFrom$Type();
|
|
833
|
-
var InstructionBranchTo$Type = class extends MessageType {
|
|
834
|
-
constructor() {
|
|
835
|
-
super("objdiff.diff.InstructionBranchTo", [
|
|
836
|
-
{
|
|
837
|
-
no: 1,
|
|
838
|
-
name: "instruction_index",
|
|
839
|
-
kind: "scalar",
|
|
840
|
-
localName: "instruction_index",
|
|
841
|
-
T: 13
|
|
842
|
-
/*ScalarType.UINT32*/
|
|
843
|
-
},
|
|
844
|
-
{
|
|
845
|
-
no: 2,
|
|
846
|
-
name: "branch_index",
|
|
847
|
-
kind: "scalar",
|
|
848
|
-
localName: "branch_index",
|
|
849
|
-
T: 13
|
|
850
|
-
/*ScalarType.UINT32*/
|
|
851
|
-
}
|
|
852
|
-
]);
|
|
853
|
-
}
|
|
854
|
-
create(value) {
|
|
855
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
856
|
-
message.instruction_index = 0;
|
|
857
|
-
message.branch_index = 0;
|
|
858
|
-
if (value !== void 0)
|
|
859
|
-
reflectionMergePartial(this, message, value);
|
|
860
|
-
return message;
|
|
861
|
-
}
|
|
862
|
-
internalBinaryRead(reader, length, options, target) {
|
|
863
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
864
|
-
while (reader.pos < end) {
|
|
865
|
-
let [fieldNo, wireType] = reader.tag();
|
|
866
|
-
switch (fieldNo) {
|
|
867
|
-
case /* uint32 instruction_index */
|
|
868
|
-
1:
|
|
869
|
-
message.instruction_index = reader.uint32();
|
|
870
|
-
break;
|
|
871
|
-
case /* uint32 branch_index */
|
|
872
|
-
2:
|
|
873
|
-
message.branch_index = reader.uint32();
|
|
874
|
-
break;
|
|
875
|
-
default:
|
|
876
|
-
let u = options.readUnknownField;
|
|
877
|
-
if (u === "throw")
|
|
878
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
879
|
-
let d = reader.skip(wireType);
|
|
880
|
-
if (u !== false)
|
|
881
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
return message;
|
|
885
|
-
}
|
|
886
|
-
internalBinaryWrite(message, writer, options) {
|
|
887
|
-
if (message.instruction_index !== 0)
|
|
888
|
-
writer.tag(1, WireType.Varint).uint32(message.instruction_index);
|
|
889
|
-
if (message.branch_index !== 0)
|
|
890
|
-
writer.tag(2, WireType.Varint).uint32(message.branch_index);
|
|
891
|
-
let u = options.writeUnknownFields;
|
|
892
|
-
if (u !== false)
|
|
893
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
894
|
-
return writer;
|
|
895
|
-
}
|
|
896
|
-
};
|
|
897
|
-
var InstructionBranchTo = new InstructionBranchTo$Type();
|
|
898
|
-
var FunctionDiff$Type = class extends MessageType {
|
|
899
|
-
constructor() {
|
|
900
|
-
super("objdiff.diff.FunctionDiff", [
|
|
901
|
-
{ no: 1, name: "symbol", kind: "message", T: () => Symbol },
|
|
902
|
-
{ no: 2, name: "instructions", kind: "message", repeat: 1, T: () => InstructionDiff },
|
|
903
|
-
{
|
|
904
|
-
no: 3,
|
|
905
|
-
name: "match_percent",
|
|
906
|
-
kind: "scalar",
|
|
907
|
-
localName: "match_percent",
|
|
908
|
-
opt: true,
|
|
909
|
-
T: 2
|
|
910
|
-
/*ScalarType.FLOAT*/
|
|
911
|
-
}
|
|
912
|
-
]);
|
|
913
|
-
}
|
|
914
|
-
create(value) {
|
|
915
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
916
|
-
message.instructions = [];
|
|
917
|
-
if (value !== void 0)
|
|
918
|
-
reflectionMergePartial(this, message, value);
|
|
919
|
-
return message;
|
|
920
|
-
}
|
|
921
|
-
internalBinaryRead(reader, length, options, target) {
|
|
922
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
923
|
-
while (reader.pos < end) {
|
|
924
|
-
let [fieldNo, wireType] = reader.tag();
|
|
925
|
-
switch (fieldNo) {
|
|
926
|
-
case /* objdiff.diff.Symbol symbol */
|
|
927
|
-
1:
|
|
928
|
-
message.symbol = Symbol.internalBinaryRead(reader, reader.uint32(), options, message.symbol);
|
|
929
|
-
break;
|
|
930
|
-
case /* repeated objdiff.diff.InstructionDiff instructions */
|
|
931
|
-
2:
|
|
932
|
-
message.instructions.push(InstructionDiff.internalBinaryRead(reader, reader.uint32(), options));
|
|
933
|
-
break;
|
|
934
|
-
case /* optional float match_percent */
|
|
935
|
-
3:
|
|
936
|
-
message.match_percent = reader.float();
|
|
937
|
-
break;
|
|
938
|
-
default:
|
|
939
|
-
let u = options.readUnknownField;
|
|
940
|
-
if (u === "throw")
|
|
941
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
942
|
-
let d = reader.skip(wireType);
|
|
943
|
-
if (u !== false)
|
|
944
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
return message;
|
|
948
|
-
}
|
|
949
|
-
internalBinaryWrite(message, writer, options) {
|
|
950
|
-
if (message.symbol)
|
|
951
|
-
Symbol.internalBinaryWrite(message.symbol, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
952
|
-
for (let i = 0; i < message.instructions.length; i++)
|
|
953
|
-
InstructionDiff.internalBinaryWrite(message.instructions[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
|
954
|
-
if (message.match_percent !== void 0)
|
|
955
|
-
writer.tag(3, WireType.Bit32).float(message.match_percent);
|
|
956
|
-
let u = options.writeUnknownFields;
|
|
957
|
-
if (u !== false)
|
|
958
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
959
|
-
return writer;
|
|
960
|
-
}
|
|
961
|
-
};
|
|
962
|
-
var FunctionDiff = new FunctionDiff$Type();
|
|
963
|
-
var DataDiff$Type = class extends MessageType {
|
|
964
|
-
constructor() {
|
|
965
|
-
super("objdiff.diff.DataDiff", [
|
|
966
|
-
{ no: 1, name: "kind", kind: "enum", T: () => ["objdiff.diff.DiffKind", DiffKind] },
|
|
967
|
-
{
|
|
968
|
-
no: 2,
|
|
969
|
-
name: "data",
|
|
970
|
-
kind: "scalar",
|
|
971
|
-
T: 12
|
|
972
|
-
/*ScalarType.BYTES*/
|
|
973
|
-
},
|
|
974
|
-
{
|
|
975
|
-
no: 3,
|
|
976
|
-
name: "size",
|
|
977
|
-
kind: "scalar",
|
|
978
|
-
T: 4,
|
|
979
|
-
L: 0
|
|
980
|
-
/*LongType.BIGINT*/
|
|
981
|
-
}
|
|
982
|
-
]);
|
|
983
|
-
}
|
|
984
|
-
create(value) {
|
|
985
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
986
|
-
message.kind = 0;
|
|
987
|
-
message.data = new Uint8Array(0);
|
|
988
|
-
message.size = 0n;
|
|
989
|
-
if (value !== void 0)
|
|
990
|
-
reflectionMergePartial(this, message, value);
|
|
991
|
-
return message;
|
|
992
|
-
}
|
|
993
|
-
internalBinaryRead(reader, length, options, target) {
|
|
994
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
995
|
-
while (reader.pos < end) {
|
|
996
|
-
let [fieldNo, wireType] = reader.tag();
|
|
997
|
-
switch (fieldNo) {
|
|
998
|
-
case /* objdiff.diff.DiffKind kind */
|
|
999
|
-
1:
|
|
1000
|
-
message.kind = reader.int32();
|
|
1001
|
-
break;
|
|
1002
|
-
case /* bytes data */
|
|
1003
|
-
2:
|
|
1004
|
-
message.data = reader.bytes();
|
|
1005
|
-
break;
|
|
1006
|
-
case /* uint64 size */
|
|
1007
|
-
3:
|
|
1008
|
-
message.size = reader.uint64().toBigInt();
|
|
1009
|
-
break;
|
|
1010
|
-
default:
|
|
1011
|
-
let u = options.readUnknownField;
|
|
1012
|
-
if (u === "throw")
|
|
1013
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
1014
|
-
let d = reader.skip(wireType);
|
|
1015
|
-
if (u !== false)
|
|
1016
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
return message;
|
|
1020
|
-
}
|
|
1021
|
-
internalBinaryWrite(message, writer, options) {
|
|
1022
|
-
if (message.kind !== 0)
|
|
1023
|
-
writer.tag(1, WireType.Varint).int32(message.kind);
|
|
1024
|
-
if (message.data.length)
|
|
1025
|
-
writer.tag(2, WireType.LengthDelimited).bytes(message.data);
|
|
1026
|
-
if (message.size !== 0n)
|
|
1027
|
-
writer.tag(3, WireType.Varint).uint64(message.size);
|
|
1028
|
-
let u = options.writeUnknownFields;
|
|
1029
|
-
if (u !== false)
|
|
1030
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
1031
|
-
return writer;
|
|
1032
|
-
}
|
|
1033
|
-
};
|
|
1034
|
-
var DataDiff = new DataDiff$Type();
|
|
1035
|
-
var SectionDiff$Type = class extends MessageType {
|
|
1036
|
-
constructor() {
|
|
1037
|
-
super("objdiff.diff.SectionDiff", [
|
|
1038
|
-
{
|
|
1039
|
-
no: 1,
|
|
1040
|
-
name: "name",
|
|
1041
|
-
kind: "scalar",
|
|
1042
|
-
T: 9
|
|
1043
|
-
/*ScalarType.STRING*/
|
|
1044
|
-
},
|
|
1045
|
-
{ no: 2, name: "kind", kind: "enum", T: () => ["objdiff.diff.SectionKind", SectionKind] },
|
|
1046
|
-
{
|
|
1047
|
-
no: 3,
|
|
1048
|
-
name: "size",
|
|
1049
|
-
kind: "scalar",
|
|
1050
|
-
T: 4,
|
|
1051
|
-
L: 0
|
|
1052
|
-
/*LongType.BIGINT*/
|
|
1053
|
-
},
|
|
1054
|
-
{
|
|
1055
|
-
no: 4,
|
|
1056
|
-
name: "address",
|
|
1057
|
-
kind: "scalar",
|
|
1058
|
-
T: 4,
|
|
1059
|
-
L: 0
|
|
1060
|
-
/*LongType.BIGINT*/
|
|
1061
|
-
},
|
|
1062
|
-
{ no: 5, name: "functions", kind: "message", repeat: 1, T: () => FunctionDiff },
|
|
1063
|
-
{ no: 6, name: "data", kind: "message", repeat: 1, T: () => DataDiff },
|
|
1064
|
-
{
|
|
1065
|
-
no: 7,
|
|
1066
|
-
name: "match_percent",
|
|
1067
|
-
kind: "scalar",
|
|
1068
|
-
localName: "match_percent",
|
|
1069
|
-
opt: true,
|
|
1070
|
-
T: 2
|
|
1071
|
-
/*ScalarType.FLOAT*/
|
|
1072
|
-
}
|
|
1073
|
-
]);
|
|
1074
|
-
}
|
|
1075
|
-
create(value) {
|
|
1076
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
1077
|
-
message.name = "";
|
|
1078
|
-
message.kind = 0;
|
|
1079
|
-
message.size = 0n;
|
|
1080
|
-
message.address = 0n;
|
|
1081
|
-
message.functions = [];
|
|
1082
|
-
message.data = [];
|
|
1083
|
-
if (value !== void 0)
|
|
1084
|
-
reflectionMergePartial(this, message, value);
|
|
1085
|
-
return message;
|
|
1086
|
-
}
|
|
1087
|
-
internalBinaryRead(reader, length, options, target) {
|
|
1088
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
1089
|
-
while (reader.pos < end) {
|
|
1090
|
-
let [fieldNo, wireType] = reader.tag();
|
|
1091
|
-
switch (fieldNo) {
|
|
1092
|
-
case /* string name */
|
|
1093
|
-
1:
|
|
1094
|
-
message.name = reader.string();
|
|
1095
|
-
break;
|
|
1096
|
-
case /* objdiff.diff.SectionKind kind */
|
|
1097
|
-
2:
|
|
1098
|
-
message.kind = reader.int32();
|
|
1099
|
-
break;
|
|
1100
|
-
case /* uint64 size */
|
|
1101
|
-
3:
|
|
1102
|
-
message.size = reader.uint64().toBigInt();
|
|
1103
|
-
break;
|
|
1104
|
-
case /* uint64 address */
|
|
1105
|
-
4:
|
|
1106
|
-
message.address = reader.uint64().toBigInt();
|
|
1107
|
-
break;
|
|
1108
|
-
case /* repeated objdiff.diff.FunctionDiff functions */
|
|
1109
|
-
5:
|
|
1110
|
-
message.functions.push(FunctionDiff.internalBinaryRead(reader, reader.uint32(), options));
|
|
1111
|
-
break;
|
|
1112
|
-
case /* repeated objdiff.diff.DataDiff data */
|
|
1113
|
-
6:
|
|
1114
|
-
message.data.push(DataDiff.internalBinaryRead(reader, reader.uint32(), options));
|
|
1115
|
-
break;
|
|
1116
|
-
case /* optional float match_percent */
|
|
1117
|
-
7:
|
|
1118
|
-
message.match_percent = reader.float();
|
|
1119
|
-
break;
|
|
1120
|
-
default:
|
|
1121
|
-
let u = options.readUnknownField;
|
|
1122
|
-
if (u === "throw")
|
|
1123
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
1124
|
-
let d = reader.skip(wireType);
|
|
1125
|
-
if (u !== false)
|
|
1126
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
return message;
|
|
1130
|
-
}
|
|
1131
|
-
internalBinaryWrite(message, writer, options) {
|
|
1132
|
-
if (message.name !== "")
|
|
1133
|
-
writer.tag(1, WireType.LengthDelimited).string(message.name);
|
|
1134
|
-
if (message.kind !== 0)
|
|
1135
|
-
writer.tag(2, WireType.Varint).int32(message.kind);
|
|
1136
|
-
if (message.size !== 0n)
|
|
1137
|
-
writer.tag(3, WireType.Varint).uint64(message.size);
|
|
1138
|
-
if (message.address !== 0n)
|
|
1139
|
-
writer.tag(4, WireType.Varint).uint64(message.address);
|
|
1140
|
-
for (let i = 0; i < message.functions.length; i++)
|
|
1141
|
-
FunctionDiff.internalBinaryWrite(message.functions[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
|
|
1142
|
-
for (let i = 0; i < message.data.length; i++)
|
|
1143
|
-
DataDiff.internalBinaryWrite(message.data[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
|
|
1144
|
-
if (message.match_percent !== void 0)
|
|
1145
|
-
writer.tag(7, WireType.Bit32).float(message.match_percent);
|
|
1146
|
-
let u = options.writeUnknownFields;
|
|
1147
|
-
if (u !== false)
|
|
1148
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
1149
|
-
return writer;
|
|
1150
|
-
}
|
|
1151
|
-
};
|
|
1152
|
-
var SectionDiff = new SectionDiff$Type();
|
|
1153
|
-
var ObjectDiff$Type = class extends MessageType {
|
|
1154
|
-
constructor() {
|
|
1155
|
-
super("objdiff.diff.ObjectDiff", [
|
|
1156
|
-
{ no: 1, name: "sections", kind: "message", repeat: 1, T: () => SectionDiff }
|
|
1157
|
-
]);
|
|
1158
|
-
}
|
|
1159
|
-
create(value) {
|
|
1160
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
1161
|
-
message.sections = [];
|
|
1162
|
-
if (value !== void 0)
|
|
1163
|
-
reflectionMergePartial(this, message, value);
|
|
1164
|
-
return message;
|
|
1165
|
-
}
|
|
1166
|
-
internalBinaryRead(reader, length, options, target) {
|
|
1167
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
1168
|
-
while (reader.pos < end) {
|
|
1169
|
-
let [fieldNo, wireType] = reader.tag();
|
|
1170
|
-
switch (fieldNo) {
|
|
1171
|
-
case /* repeated objdiff.diff.SectionDiff sections */
|
|
1172
|
-
1:
|
|
1173
|
-
message.sections.push(SectionDiff.internalBinaryRead(reader, reader.uint32(), options));
|
|
1174
|
-
break;
|
|
1175
|
-
default:
|
|
1176
|
-
let u = options.readUnknownField;
|
|
1177
|
-
if (u === "throw")
|
|
1178
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
1179
|
-
let d = reader.skip(wireType);
|
|
1180
|
-
if (u !== false)
|
|
1181
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1184
|
-
return message;
|
|
1185
|
-
}
|
|
1186
|
-
internalBinaryWrite(message, writer, options) {
|
|
1187
|
-
for (let i = 0; i < message.sections.length; i++)
|
|
1188
|
-
SectionDiff.internalBinaryWrite(message.sections[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
1189
|
-
let u = options.writeUnknownFields;
|
|
1190
|
-
if (u !== false)
|
|
1191
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
1192
|
-
return writer;
|
|
1193
|
-
}
|
|
1194
|
-
};
|
|
1195
|
-
var ObjectDiff = new ObjectDiff$Type();
|
|
1196
|
-
var DiffResult$Type = class extends MessageType {
|
|
1197
|
-
constructor() {
|
|
1198
|
-
super("objdiff.diff.DiffResult", [
|
|
1199
|
-
{ no: 1, name: "left", kind: "message", T: () => ObjectDiff },
|
|
1200
|
-
{ no: 2, name: "right", kind: "message", T: () => ObjectDiff }
|
|
1201
|
-
]);
|
|
1202
|
-
}
|
|
1203
|
-
create(value) {
|
|
1204
|
-
const message = globalThis.Object.create(this.messagePrototype);
|
|
1205
|
-
if (value !== void 0)
|
|
1206
|
-
reflectionMergePartial(this, message, value);
|
|
1207
|
-
return message;
|
|
1208
|
-
}
|
|
1209
|
-
internalBinaryRead(reader, length, options, target) {
|
|
1210
|
-
let message = target ?? this.create(), end = reader.pos + length;
|
|
1211
|
-
while (reader.pos < end) {
|
|
1212
|
-
let [fieldNo, wireType] = reader.tag();
|
|
1213
|
-
switch (fieldNo) {
|
|
1214
|
-
case /* optional objdiff.diff.ObjectDiff left */
|
|
1215
|
-
1:
|
|
1216
|
-
message.left = ObjectDiff.internalBinaryRead(reader, reader.uint32(), options, message.left);
|
|
1217
|
-
break;
|
|
1218
|
-
case /* optional objdiff.diff.ObjectDiff right */
|
|
1219
|
-
2:
|
|
1220
|
-
message.right = ObjectDiff.internalBinaryRead(reader, reader.uint32(), options, message.right);
|
|
1221
|
-
break;
|
|
1222
|
-
default:
|
|
1223
|
-
let u = options.readUnknownField;
|
|
1224
|
-
if (u === "throw")
|
|
1225
|
-
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
1226
|
-
let d = reader.skip(wireType);
|
|
1227
|
-
if (u !== false)
|
|
1228
|
-
(u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
return message;
|
|
1232
|
-
}
|
|
1233
|
-
internalBinaryWrite(message, writer, options) {
|
|
1234
|
-
if (message.left)
|
|
1235
|
-
ObjectDiff.internalBinaryWrite(message.left, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
|
|
1236
|
-
if (message.right)
|
|
1237
|
-
ObjectDiff.internalBinaryWrite(message.right, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
|
|
1238
|
-
let u = options.writeUnknownFields;
|
|
1239
|
-
if (u !== false)
|
|
1240
|
-
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
1241
|
-
return writer;
|
|
1242
|
-
}
|
|
1243
|
-
};
|
|
1244
|
-
var DiffResult = new DiffResult$Type();
|
|
1245
|
-
|
|
1246
|
-
// src/main.ts
|
|
1247
|
-
var workerInit = false;
|
|
1248
|
-
var workerCallbacks = null;
|
|
1249
|
-
var workerReady = new Promise((resolve, reject) => {
|
|
1250
|
-
workerCallbacks = { start: performance.now(), resolve, reject };
|
|
1251
|
-
});
|
|
1252
|
-
async function initialize(data) {
|
|
1253
|
-
if (workerInit) {
|
|
1254
|
-
return workerReady;
|
|
1255
|
-
}
|
|
1256
|
-
workerInit = true;
|
|
1257
|
-
let { workerUrl, wasmUrl } = data || {};
|
|
1258
|
-
if (!workerUrl) {
|
|
1259
|
-
try {
|
|
1260
|
-
workerUrl = new URL("./worker.js", import.meta.url);
|
|
1261
|
-
} catch (_) {
|
|
1262
|
-
workerUrl = "worker.js";
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
if (!wasmUrl) {
|
|
1266
|
-
try {
|
|
1267
|
-
wasmUrl = new URL("./objdiff_core_bg.wasm", import.meta.url);
|
|
1268
|
-
} catch (_) {
|
|
1269
|
-
wasmUrl = "objdiff_core_bg.js";
|
|
1270
|
-
}
|
|
1271
|
-
}
|
|
1272
|
-
const worker = new Worker(workerUrl, {
|
|
1273
|
-
name: "objdiff",
|
|
1274
|
-
type: "module"
|
|
1275
|
-
});
|
|
1276
|
-
worker.onmessage = onMessage;
|
|
1277
|
-
worker.onerror = (event) => {
|
|
1278
|
-
console.error("Worker error", event);
|
|
1279
|
-
workerCallbacks.reject("Worker failed to initialize, wrong URL?");
|
|
1280
|
-
};
|
|
1281
|
-
defer({
|
|
1282
|
-
type: "init",
|
|
1283
|
-
// URL can't be sent directly
|
|
1284
|
-
wasmUrl: wasmUrl.toString()
|
|
1285
|
-
}, worker).then(() => {
|
|
1286
|
-
workerCallbacks.resolve(worker);
|
|
1287
|
-
}, (e) => {
|
|
1288
|
-
workerCallbacks.reject(e);
|
|
1289
|
-
throw e;
|
|
1290
|
-
});
|
|
1291
|
-
return workerReady;
|
|
1292
|
-
}
|
|
1293
|
-
var globalMessageId = 0;
|
|
1294
|
-
var messageCallbacks = /* @__PURE__ */ new Map();
|
|
1295
|
-
function onMessage(event) {
|
|
1296
|
-
switch (event.data.type) {
|
|
1297
|
-
case "result": {
|
|
1298
|
-
const { result, error, messageId } = event.data;
|
|
1299
|
-
const callbacks = messageCallbacks.get(messageId);
|
|
1300
|
-
if (callbacks) {
|
|
1301
|
-
const end = performance.now();
|
|
1302
|
-
console.debug(`Message ${messageId} took ${end - callbacks.start}ms`);
|
|
1303
|
-
messageCallbacks.delete(messageId);
|
|
1304
|
-
if (error != null) {
|
|
1305
|
-
callbacks.reject(error);
|
|
1306
|
-
} else {
|
|
1307
|
-
callbacks.resolve(result);
|
|
1308
|
-
}
|
|
1309
|
-
} else {
|
|
1310
|
-
console.warn(`Unknown message ID ${messageId}`);
|
|
1311
|
-
}
|
|
1312
|
-
break;
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
async function defer(message, worker) {
|
|
1317
|
-
worker = worker || await initialize();
|
|
1318
|
-
const messageId = globalMessageId++;
|
|
1319
|
-
const promise = new Promise((resolve, reject) => {
|
|
1320
|
-
messageCallbacks.set(messageId, { start: performance.now(), resolve, reject });
|
|
1321
|
-
});
|
|
1322
|
-
worker.postMessage({
|
|
1323
|
-
...message,
|
|
1324
|
-
messageId
|
|
1325
|
-
});
|
|
1326
|
-
return promise;
|
|
1327
|
-
}
|
|
1328
|
-
async function runDiff(left, right, config) {
|
|
1329
|
-
const data = await defer({
|
|
1330
|
-
type: "run_diff_proto",
|
|
1331
|
-
left,
|
|
1332
|
-
right,
|
|
1333
|
-
config
|
|
1334
|
-
});
|
|
1335
|
-
const parseStart = performance.now();
|
|
1336
|
-
const result = DiffResult.fromBinary(data, { readUnknownField: false });
|
|
1337
|
-
const end = performance.now();
|
|
1338
|
-
console.debug(`Parsing message took ${end - parseStart}ms`);
|
|
1339
|
-
return result;
|
|
1340
|
-
}
|
|
1341
|
-
function oneof(type) {
|
|
1342
|
-
return type;
|
|
1343
|
-
}
|
|
1344
|
-
function displayDiff(diff, baseAddr, cb) {
|
|
1345
|
-
const ins = diff.instruction;
|
|
1346
|
-
if (!ins) {
|
|
1347
|
-
return;
|
|
1348
|
-
}
|
|
1349
|
-
if (ins.line_number != null) {
|
|
1350
|
-
cb({ type: "line", line_number: ins.line_number });
|
|
1351
|
-
}
|
|
1352
|
-
cb({ type: "address", address: ins.address - baseAddr });
|
|
1353
|
-
if (diff.branch_from) {
|
|
1354
|
-
cb({ type: "basic_color", text: " ~> ", index: diff.branch_from.branch_index });
|
|
1355
|
-
} else {
|
|
1356
|
-
cb({ type: "spacing", count: 4 });
|
|
1357
|
-
}
|
|
1358
|
-
cb({ type: "opcode", mnemonic: ins.mnemonic, opcode: ins.opcode });
|
|
1359
|
-
for (let i = 0; i < ins.arguments.length; i++) {
|
|
1360
|
-
if (i === 0) {
|
|
1361
|
-
cb({ type: "spacing", count: 1 });
|
|
1362
|
-
}
|
|
1363
|
-
const arg = oneof(ins.arguments[i].value);
|
|
1364
|
-
const diff_index = diff.arg_diff[i]?.diff_index;
|
|
1365
|
-
switch (arg.oneofKind) {
|
|
1366
|
-
case "plain_text":
|
|
1367
|
-
cb({ type: "basic", text: arg.plain_text, diff_index });
|
|
1368
|
-
break;
|
|
1369
|
-
case "argument":
|
|
1370
|
-
cb({ type: "argument", value: arg.argument, diff_index });
|
|
1371
|
-
break;
|
|
1372
|
-
case "relocation": {
|
|
1373
|
-
const reloc = ins.relocation;
|
|
1374
|
-
cb({ type: "symbol", target: reloc.target, diff_index });
|
|
1375
|
-
break;
|
|
1376
|
-
}
|
|
1377
|
-
case "branch_dest":
|
|
1378
|
-
if (arg.branch_dest < baseAddr) {
|
|
1379
|
-
cb({ type: "basic", text: "<unknown>", diff_index });
|
|
1380
|
-
} else {
|
|
1381
|
-
cb({ type: "branch_dest", address: arg.branch_dest - baseAddr, diff_index });
|
|
1382
|
-
}
|
|
1383
|
-
break;
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
|
-
if (diff.branch_to) {
|
|
1387
|
-
cb({ type: "basic_color", text: " ~> ", index: diff.branch_to.branch_index });
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
export {
|
|
1391
|
-
Argument,
|
|
1392
|
-
ArgumentDiff,
|
|
1393
|
-
ArgumentRelocation,
|
|
1394
|
-
ArgumentValue,
|
|
1395
|
-
DataDiff,
|
|
1396
|
-
DiffKind,
|
|
1397
|
-
DiffResult,
|
|
1398
|
-
FunctionDiff,
|
|
1399
|
-
Instruction,
|
|
1400
|
-
InstructionBranchFrom,
|
|
1401
|
-
InstructionBranchTo,
|
|
1402
|
-
InstructionDiff,
|
|
1403
|
-
ObjectDiff,
|
|
1404
|
-
Relocation,
|
|
1405
|
-
RelocationTarget,
|
|
1406
|
-
SectionDiff,
|
|
1407
|
-
SectionKind,
|
|
1408
|
-
Symbol,
|
|
1409
|
-
SymbolFlag,
|
|
1410
|
-
displayDiff,
|
|
1411
|
-
initialize,
|
|
1412
|
-
oneof,
|
|
1413
|
-
runDiff
|
|
1414
|
-
};
|
|
1415
|
-
//# sourceMappingURL=main.js.map
|