objdiff-wasm 3.0.0 → 3.0.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.
Binary file
package/dist/objdiff.js CHANGED
@@ -76,7 +76,7 @@ function utf8Encode(s, realloc, memory) {
76
76
  let exports0;
77
77
  let exports1;
78
78
  let memory0;
79
- function trampoline3(arg0, arg1, arg2, arg3, arg4) {
79
+ function trampoline4(arg0, arg1, arg2, arg3, arg4) {
80
80
  let enum0;
81
81
  switch(arg0){
82
82
  case 0:
@@ -125,7 +125,7 @@ const handleTable0 = [
125
125
  ];
126
126
  const finalizationRegistry0 = finalizationRegistryCreate((handle)=>{
127
127
  const { rep } = rscTableRemove(handleTable0, handle);
128
- exports0['1'](rep);
128
+ exports0['3'](rep);
129
129
  });
130
130
  handleTables[0] = handleTable0;
131
131
  const trampoline0 = rscTableCreateOwn.bind(null, handleTable0);
@@ -139,16 +139,20 @@ const finalizationRegistry1 = finalizationRegistryCreate((handle)=>{
139
139
  });
140
140
  handleTables[1] = handleTable1;
141
141
  const trampoline1 = rscTableCreateOwn.bind(null, handleTable1);
142
+ function trampoline2(handle) {
143
+ const handleEntry = rscTableRemove(handleTable0, handle);
144
+ if (handleEntry.own) exports0['3'](handleEntry.rep);
145
+ }
142
146
  const handleTable2 = [
143
147
  T_FLAG,
144
148
  0
145
149
  ];
146
150
  const finalizationRegistry2 = finalizationRegistryCreate((handle)=>{
147
151
  const { rep } = rscTableRemove(handleTable2, handle);
148
- exports0['3'](rep);
152
+ exports0['1'](rep);
149
153
  });
150
154
  handleTables[2] = handleTable2;
151
- const trampoline2 = rscTableCreateOwn.bind(null, handleTable2);
155
+ const trampoline3 = rscTableCreateOwn.bind(null, handleTable2);
152
156
  let exports1Init;
153
157
  function init(arg0) {
154
158
  var val0 = arg0;
@@ -198,15 +202,15 @@ class DiffConfig {
198
202
  writable: true,
199
203
  value: handle1
200
204
  });
201
- finalizationRegistry1.register(rsc0, handle1, rsc0);
205
+ finalizationRegistry2.register(rsc0, handle1, rsc0);
202
206
  Object.defineProperty(rsc0, symbolDispose, {
203
207
  writable: true,
204
208
  value: function() {
205
- finalizationRegistry1.unregister(rsc0);
206
- rscTableRemove(handleTable1, handle1);
209
+ finalizationRegistry2.unregister(rsc0);
210
+ rscTableRemove(handleTable2, handle1);
207
211
  rsc0[symbolDispose] = emptyFunc;
208
212
  rsc0[symbolRscHandle] = void 0;
209
- exports0['2'](handleTable1[(handle1 << 1) + 1] & ~T_FLAG);
213
+ exports0['1'](handleTable2[(handle1 << 1) + 1] & ~T_FLAG);
210
214
  }
211
215
  });
212
216
  return rsc0;
@@ -215,8 +219,8 @@ class DiffConfig {
215
219
  let diffMethodDiffConfigSetProperty;
216
220
  DiffConfig.prototype.setProperty = function(arg1, arg2) {
217
221
  var handle1 = this[symbolRscHandle];
218
- if (!handle1 || (handleTable1[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
219
- var handle0 = handleTable1[(handle1 << 1) + 1] & ~T_FLAG;
222
+ if (!handle1 || (handleTable2[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
223
+ var handle0 = handleTable2[(handle1 << 1) + 1] & ~T_FLAG;
220
224
  var ptr2 = utf8Encode(arg1, realloc0, memory0);
221
225
  var len2 = utf8EncodedLen;
222
226
  var ptr3 = utf8Encode(arg2, realloc0, memory0);
@@ -250,8 +254,8 @@ DiffConfig.prototype.setProperty = function(arg1, arg2) {
250
254
  let diffMethodDiffConfigGetProperty;
251
255
  DiffConfig.prototype.getProperty = function(arg1) {
252
256
  var handle1 = this[symbolRscHandle];
253
- if (!handle1 || (handleTable1[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
254
- var handle0 = handleTable1[(handle1 << 1) + 1] & ~T_FLAG;
257
+ if (!handle1 || (handleTable2[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
258
+ var handle0 = handleTable2[(handle1 << 1) + 1] & ~T_FLAG;
255
259
  var ptr2 = utf8Encode(arg1, realloc0, memory0);
256
260
  var len2 = utf8EncodedLen;
257
261
  const ret = diffMethodDiffConfigGetProperty(handle0, ptr2, len2);
@@ -296,8 +300,8 @@ Object$1.parse = function(arg0, arg1) {
296
300
  var src0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, +len0);
297
301
  new Uint8Array(memory0.buffer, ptr0, +len0).set(src0);
298
302
  var handle2 = arg1[symbolRscHandle];
299
- if (!handle2 || (handleTable1[(handle2 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
300
- var handle1 = handleTable1[(handle2 << 1) + 1] & ~T_FLAG;
303
+ if (!handle2 || (handleTable2[(handle2 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
304
+ var handle1 = handleTable2[(handle2 << 1) + 1] & ~T_FLAG;
301
305
  const ret = diffStaticObjectParse(ptr0, len0, handle1);
302
306
  let variant6;
303
307
  switch(dataView(memory0).getUint8(ret + 0, true)){
@@ -308,15 +312,15 @@ Object$1.parse = function(arg0, arg1) {
308
312
  writable: true,
309
313
  value: handle4
310
314
  });
311
- finalizationRegistry2.register(rsc3, handle4, rsc3);
315
+ finalizationRegistry1.register(rsc3, handle4, rsc3);
312
316
  Object.defineProperty(rsc3, symbolDispose, {
313
317
  writable: true,
314
318
  value: function() {
315
- finalizationRegistry2.unregister(rsc3);
316
- rscTableRemove(handleTable2, handle4);
319
+ finalizationRegistry1.unregister(rsc3);
320
+ rscTableRemove(handleTable1, handle4);
317
321
  rsc3[symbolDispose] = emptyFunc;
318
322
  rsc3[symbolRscHandle] = void 0;
319
- exports0['3'](handleTable2[(handle4 << 1) + 1] & ~T_FLAG);
323
+ exports0['2'](handleTable1[(handle4 << 1) + 1] & ~T_FLAG);
320
324
  }
321
325
  });
322
326
  variant6 = {
@@ -344,8 +348,8 @@ Object$1.parse = function(arg0, arg1) {
344
348
  let diffMethodObjectHash;
345
349
  Object$1.prototype.hash = function() {
346
350
  var handle1 = this[symbolRscHandle];
347
- if (!handle1 || (handleTable2[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "Object" resource.');
348
- var handle0 = handleTable2[(handle1 << 1) + 1] & ~T_FLAG;
351
+ if (!handle1 || (handleTable1[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "Object" resource.');
352
+ var handle0 = handleTable1[(handle1 << 1) + 1] & ~T_FLAG;
349
353
  const ret = diffMethodObjectHash(handle0);
350
354
  return BigInt.asUintN(64, ret);
351
355
  };
@@ -637,8 +641,8 @@ function runDiff(arg0, arg1, arg2, arg3) {
637
641
  } else {
638
642
  const e = variant2;
639
643
  var handle1 = e[symbolRscHandle];
640
- if (!handle1 || (handleTable2[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "Object" resource.');
641
- var handle0 = handleTable2[(handle1 << 1) + 1] & ~T_FLAG;
644
+ if (!handle1 || (handleTable1[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "Object" resource.');
645
+ var handle0 = handleTable1[(handle1 << 1) + 1] & ~T_FLAG;
642
646
  variant2_0 = 1;
643
647
  variant2_1 = handle0;
644
648
  }
@@ -651,14 +655,14 @@ function runDiff(arg0, arg1, arg2, arg3) {
651
655
  } else {
652
656
  const e = variant5;
653
657
  var handle4 = e[symbolRscHandle];
654
- if (!handle4 || (handleTable2[(handle4 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "Object" resource.');
655
- var handle3 = handleTable2[(handle4 << 1) + 1] & ~T_FLAG;
658
+ if (!handle4 || (handleTable1[(handle4 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "Object" resource.');
659
+ var handle3 = handleTable1[(handle4 << 1) + 1] & ~T_FLAG;
656
660
  variant5_0 = 1;
657
661
  variant5_1 = handle3;
658
662
  }
659
663
  var handle7 = arg2[symbolRscHandle];
660
- if (!handle7 || (handleTable1[(handle7 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
661
- var handle6 = handleTable1[(handle7 << 1) + 1] & ~T_FLAG;
664
+ if (!handle7 || (handleTable2[(handle7 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
665
+ var handle6 = handleTable2[(handle7 << 1) + 1] & ~T_FLAG;
662
666
  var { mappings: v8_0, selectingLeft: v8_1, selectingRight: v8_2 } = arg3;
663
667
  var vec12 = v8_0;
664
668
  var len12 = vec12.length;
@@ -733,7 +737,7 @@ function runDiff(arg0, arg1, arg2, arg3) {
733
737
  rscTableRemove(handleTable0, handle18);
734
738
  rsc17[symbolDispose] = emptyFunc;
735
739
  rsc17[symbolRscHandle] = void 0;
736
- exports0['1'](handleTable0[(handle18 << 1) + 1] & ~T_FLAG);
740
+ exports0['3'](handleTable0[(handle18 << 1) + 1] & ~T_FLAG);
737
741
  }
738
742
  });
739
743
  variant19 = rsc17;
@@ -761,7 +765,7 @@ function runDiff(arg0, arg1, arg2, arg3) {
761
765
  rscTableRemove(handleTable0, handle21);
762
766
  rsc20[symbolDispose] = emptyFunc;
763
767
  rsc20[symbolRscHandle] = void 0;
764
- exports0['1'](handleTable0[(handle21 << 1) + 1] & ~T_FLAG);
768
+ exports0['3'](handleTable0[(handle21 << 1) + 1] & ~T_FLAG);
765
769
  }
766
770
  });
767
771
  variant22 = rsc20;
@@ -1029,8 +1033,8 @@ function displayInstructionRow(arg0, arg1, arg2, arg3) {
1029
1033
  if (!handle1 || (handleTable0[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "ObjectDiff" resource.');
1030
1034
  var handle0 = handleTable0[(handle1 << 1) + 1] & ~T_FLAG;
1031
1035
  var handle3 = arg3[symbolRscHandle];
1032
- if (!handle3 || (handleTable1[(handle3 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
1033
- var handle2 = handleTable1[(handle3 << 1) + 1] & ~T_FLAG;
1036
+ if (!handle3 || (handleTable2[(handle3 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
1037
+ var handle2 = handleTable2[(handle3 << 1) + 1] & ~T_FLAG;
1034
1038
  const ret = displayDisplayInstructionRow(handle0, toUint32(arg1), toUint32(arg2), handle2);
1035
1039
  var len12 = dataView(memory0).getInt32(ret + 4, true);
1036
1040
  var base12 = dataView(memory0).getInt32(ret + 0, true);
@@ -1381,8 +1385,8 @@ function instructionContext(arg0, arg1, arg2, arg3) {
1381
1385
  if (!handle1 || (handleTable0[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "ObjectDiff" resource.');
1382
1386
  var handle0 = handleTable0[(handle1 << 1) + 1] & ~T_FLAG;
1383
1387
  var handle3 = arg3[symbolRscHandle];
1384
- if (!handle3 || (handleTable1[(handle3 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
1385
- var handle2 = handleTable1[(handle3 << 1) + 1] & ~T_FLAG;
1388
+ if (!handle3 || (handleTable2[(handle3 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
1389
+ var handle2 = handleTable2[(handle3 << 1) + 1] & ~T_FLAG;
1386
1390
  const ret = displayInstructionContext(handle0, toUint32(arg1), toUint32(arg2), handle2);
1387
1391
  var len10 = dataView(memory0).getInt32(ret + 4, true);
1388
1392
  var base10 = dataView(memory0).getInt32(ret + 0, true);
@@ -1465,8 +1469,8 @@ function instructionHover(arg0, arg1, arg2, arg3) {
1465
1469
  if (!handle1 || (handleTable0[(handle1 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "ObjectDiff" resource.');
1466
1470
  var handle0 = handleTable0[(handle1 << 1) + 1] & ~T_FLAG;
1467
1471
  var handle3 = arg3[symbolRscHandle];
1468
- if (!handle3 || (handleTable1[(handle3 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
1469
- var handle2 = handleTable1[(handle3 << 1) + 1] & ~T_FLAG;
1472
+ if (!handle3 || (handleTable2[(handle3 << 1) + 1] & T_FLAG) === 0) throw new TypeError('Resource error: Not a valid "DiffConfig" resource.');
1473
+ var handle2 = handleTable2[(handle3 << 1) + 1] & ~T_FLAG;
1470
1474
  const ret = displayInstructionHover(handle0, toUint32(arg1), toUint32(arg2), handle2);
1471
1475
  var len8 = dataView(memory0).getInt32(ret + 4, true);
1472
1476
  var base8 = dataView(memory0).getInt32(ret + 0, true);
@@ -1530,13 +1534,14 @@ function instructionHover(arg0, arg1, arg2, arg3) {
1530
1534
  const $init = (()=>{
1531
1535
  let gen = function*() {
1532
1536
  const module0 = fetchCompile(new URL('./objdiff.core.wasm', import.meta.url));
1533
- const module1 = base64Compile('AGFzbQEAAAABDQJgAX8AYAV/f39/fwADBQQBAAAABAUBcAEEBAccBQEwAAABMQABATIAAgEzAAMIJGltcG9ydHMBAAoxBBEAIAAgASACIAMgBEEAEQEACwkAIABBAREAAAsJACAAQQIRAAALCQAgAEEDEQAACwAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BzAuMjM0LjA');
1534
- const module2 = base64Compile('AGFzbQEAAAABDQJgAX8AYAV/f39/fwACJAUAATAAAQABMQAAAAEyAAAAATMAAAAIJGltcG9ydHMBcAEEBAkKAQBBAAsEAAECAwAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BzAuMjM0LjA');
1537
+ const module1 = base64Compile('AGFzbQEAAAABDQJgAX8AYAV/f39/fwADBQQBAAAABAUBcAEEBAccBQEwAAABMQABATIAAgEzAAMIJGltcG9ydHMBAAoxBBEAIAAgASACIAMgBEEAEQEACwkAIABBAREAAAsJACAAQQIRAAALCQAgAEEDEQAACwAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BzAuMjM3LjA');
1538
+ const module2 = base64Compile('AGFzbQEAAAABDQJgAX8AYAV/f39/fwACJAUAATAAAQABMQAAAAEyAAAAATMAAAAIJGltcG9ydHMBcAEEBAkKAQBBAAsEAAECAwAvCXByb2R1Y2VycwEMcHJvY2Vzc2VkLWJ5AQ13aXQtY29tcG9uZW50BzAuMjM3LjA');
1535
1539
  ({ exports: exports0 } = yield instantiateCore((yield module1)));
1536
1540
  ({ exports: exports1 } = yield instantiateCore((yield module0), {
1537
1541
  '[export]objdiff:core/diff': {
1538
- '[resource-new]diff-config': trampoline1,
1539
- '[resource-new]object': trampoline2,
1542
+ '[resource-drop]object-diff': trampoline2,
1543
+ '[resource-new]diff-config': trampoline3,
1544
+ '[resource-new]object': trampoline1,
1540
1545
  '[resource-new]object-diff': trampoline0
1541
1546
  },
1542
1547
  'wasi:logging/logging@0.1.0-draft': {
@@ -1547,10 +1552,10 @@ const $init = (()=>{
1547
1552
  ({ exports: exports2 } = yield instantiateCore((yield module2), {
1548
1553
  '': {
1549
1554
  $imports: exports0.$imports,
1550
- 0: trampoline3,
1551
- 1: exports1['objdiff:core/diff#[dtor]object-diff'],
1552
- 2: exports1['objdiff:core/diff#[dtor]diff-config'],
1553
- 3: exports1['objdiff:core/diff#[dtor]object']
1555
+ 0: trampoline4,
1556
+ 1: exports1['objdiff:core/diff#[dtor]diff-config'],
1557
+ 2: exports1['objdiff:core/diff#[dtor]object'],
1558
+ 3: exports1['objdiff:core/diff#[dtor]object-diff']
1554
1559
  }
1555
1560
  }));
1556
1561
  postReturn0 = exports1.cabi_post_version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "objdiff-wasm",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "A local diffing tool for decompilation projects.",
5
5
  "author": {
6
6
  "name": "Luke Street",
@@ -19,8 +19,8 @@
19
19
  "types": "dist/objdiff.d.ts",
20
20
  "scripts": {
21
21
  "build": "npm run build:wasm && npm run build:transpile && npm run build:lib",
22
- "build:wasm": "cargo +nightly -Zbuild-std=panic_abort,core,alloc -Zbuild-std-features=compiler-builtins-mem build --target wasm32-wasip2 --release --no-default-features",
23
- "build:transpile": "jco transpile ../target/wasm32-wasip2/release/objdiff_wasm.wasm --no-nodejs-compat --no-wasi-shim --no-namespaced-exports --map wasi:logging/logging=./wasi-logging.js --optimize -o pkg --name objdiff",
22
+ "build:wasm": "cargo build --profile release-min --no-default-features",
23
+ "build:transpile": "jco transpile ../target/wasm32-wasip2/release-min/objdiff_wasm.wasm --no-nodejs-compat --no-wasi-shim --no-namespaced-exports --map wasi:logging/logging=./wasi-logging.js --optimize -o pkg --name objdiff",
24
24
  "build:lib": "rslib build"
25
25
  },
26
26
  "devDependencies": {