chore: rebuild wasm

This commit is contained in:
2024-09-12 22:31:12 +01:00
parent a44698c1d7
commit b97633d3a3
5 changed files with 325 additions and 367 deletions

View File

@ -24,13 +24,13 @@ function takeObject(idx) {
let WASM_VECTOR_LEN = 0;
let cachedUint8Memory0 = null;
let cachedUint8ArrayMemory0 = null;
function getUint8Memory0() {
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
function getUint8ArrayMemory0() {
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
}
return cachedUint8Memory0;
return cachedUint8ArrayMemory0;
}
const cachedTextEncoder =
@ -60,7 +60,7 @@ function passStringToWasm0(arg, malloc, realloc) {
if (realloc === undefined) {
const buf = cachedTextEncoder.encode(arg);
const ptr = malloc(buf.length, 1) >>> 0;
getUint8Memory0()
getUint8ArrayMemory0()
.subarray(ptr, ptr + buf.length)
.set(buf);
WASM_VECTOR_LEN = buf.length;
@ -70,7 +70,7 @@ function passStringToWasm0(arg, malloc, realloc) {
let len = arg.length;
let ptr = malloc(len, 1) >>> 0;
const mem = getUint8Memory0();
const mem = getUint8ArrayMemory0();
let offset = 0;
@ -85,10 +85,11 @@ function passStringToWasm0(arg, malloc, realloc) {
arg = arg.slice(offset);
}
ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0;
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
const ret = encodeString(arg, view);
offset += ret.written;
ptr = realloc(ptr, len, offset, 1) >>> 0;
}
WASM_VECTOR_LEN = offset;
@ -99,13 +100,17 @@ function isLikeNone(x) {
return x === undefined || x === null;
}
let cachedInt32Memory0 = null;
let cachedDataViewMemory0 = null;
function getInt32Memory0() {
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
function getDataViewMemory0() {
if (
cachedDataViewMemory0 === null ||
cachedDataViewMemory0.buffer.detached === true ||
(cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)
) {
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
}
return cachedInt32Memory0;
return cachedDataViewMemory0;
}
function addHeapObject(obj) {
@ -132,25 +137,7 @@ if (typeof TextDecoder !== "undefined") {
function getStringFromWasm0(ptr, len) {
ptr = ptr >>> 0;
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
}
let cachedFloat64Memory0 = null;
function getFloat64Memory0() {
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
}
return cachedFloat64Memory0;
}
let cachedBigInt64Memory0 = null;
function getBigInt64Memory0() {
if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
}
return cachedBigInt64Memory0;
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
}
function debugString(val) {
@ -226,9 +213,9 @@ export function diff_filters(prev, next) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.diff_filters(retptr, addHeapObject(prev), addHeapObject(next));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
if (r2) {
throw takeObject(r1);
}
@ -246,9 +233,9 @@ export function expand_filter(val) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.expand_filter(retptr, addHeapObject(val));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
if (r2) {
throw takeObject(r1);
}
@ -267,9 +254,9 @@ export function get_diff(prev, next) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.get_diff(retptr, addHeapObject(prev), addHeapObject(next));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
if (r2) {
throw takeObject(r1);
}
@ -287,9 +274,9 @@ export function flat_merge(val) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.flat_merge(retptr, addHeapObject(val));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
if (r2) {
throw takeObject(r1);
}
@ -307,9 +294,9 @@ export function compress(val) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.compress(retptr, addHeapObject(val));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
if (r2) {
throw takeObject(r1);
}
@ -328,9 +315,9 @@ export function pow(val, target) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.pow(retptr, addHeapObject(val), addHeapObject(target));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
if (r2) {
throw takeObject(r1);
}
@ -350,9 +337,9 @@ export function schnorr_verify(hash, sig, pub_key) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.schnorr_verify(retptr, addHeapObject(hash), addHeapObject(sig), addHeapObject(pub_key));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
if (r2) {
throw takeObject(r1);
}
@ -370,9 +357,9 @@ export function schnorr_verify_event(event) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm.schnorr_verify_event(retptr, addHeapObject(event));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
if (r2) {
throw takeObject(r1);
}
@ -431,8 +418,8 @@ function __wbg_get_imports() {
const ret = typeof obj === "string" ? obj : undefined;
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};
imports.wbg.__wbindgen_is_object = function (arg0) {
const val = getObject(arg0);
@ -463,14 +450,6 @@ function __wbg_get_imports() {
const ret = new Error(getStringFromWasm0(arg0, arg1));
return addHeapObject(ret);
};
imports.wbg.__wbindgen_number_new = function (arg0) {
const ret = arg0;
return addHeapObject(ret);
};
imports.wbg.__wbindgen_string_new = function (arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
const ret = getObject(arg0) == getObject(arg1);
return ret;
@ -483,17 +462,25 @@ function __wbg_get_imports() {
imports.wbg.__wbindgen_number_get = function (arg0, arg1) {
const obj = getObject(arg1);
const ret = typeof obj === "number" ? obj : undefined;
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
};
imports.wbg.__wbindgen_as_number = function (arg0) {
const ret = +getObject(arg0);
return ret;
};
imports.wbg.__wbindgen_number_new = function (arg0) {
const ret = arg0;
return addHeapObject(ret);
};
imports.wbg.__wbindgen_object_clone_ref = function (arg0) {
const ret = getObject(arg0);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_string_new = function (arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);
};
imports.wbg.__wbg_getwithrefkey_edc2c8960f0f1191 = function (arg0, arg1) {
const ret = getObject(arg0)[getObject(arg1)];
return addHeapObject(ret);
@ -501,15 +488,15 @@ function __wbg_get_imports() {
imports.wbg.__wbg_set_f975102236d3c502 = function (arg0, arg1, arg2) {
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
};
imports.wbg.__wbg_get_44be0491f933a435 = function (arg0, arg1) {
imports.wbg.__wbg_get_3baa728f9d58d3f6 = function (arg0, arg1) {
const ret = getObject(arg0)[arg1 >>> 0];
return addHeapObject(ret);
};
imports.wbg.__wbg_length_fff51ee6522a1a18 = function (arg0) {
imports.wbg.__wbg_length_ae22078168b726f5 = function (arg0) {
const ret = getObject(arg0).length;
return ret;
};
imports.wbg.__wbg_new_898a68150f225f2e = function () {
imports.wbg.__wbg_new_a220cf903aa02ca2 = function () {
const ret = new Array();
return addHeapObject(ret);
};
@ -517,85 +504,85 @@ function __wbg_get_imports() {
const ret = typeof getObject(arg0) === "function";
return ret;
};
imports.wbg.__wbg_next_526fc47e980da008 = function (arg0) {
imports.wbg.__wbg_next_de3e9db4440638b2 = function (arg0) {
const ret = getObject(arg0).next;
return addHeapObject(ret);
};
imports.wbg.__wbg_next_ddb3312ca1c4e32a = function () {
imports.wbg.__wbg_next_f9cb570345655b9a = function () {
return handleError(function (arg0) {
const ret = getObject(arg0).next();
return addHeapObject(ret);
}, arguments);
};
imports.wbg.__wbg_done_5c1f01fb660d73b5 = function (arg0) {
imports.wbg.__wbg_done_bfda7aa8f252b39f = function (arg0) {
const ret = getObject(arg0).done;
return ret;
};
imports.wbg.__wbg_value_1695675138684bd5 = function (arg0) {
imports.wbg.__wbg_value_6d39332ab4788d86 = function (arg0) {
const ret = getObject(arg0).value;
return addHeapObject(ret);
};
imports.wbg.__wbg_iterator_97f0c81209c6c35a = function () {
imports.wbg.__wbg_iterator_888179a48810a9fe = function () {
const ret = Symbol.iterator;
return addHeapObject(ret);
};
imports.wbg.__wbg_get_97b561fb56f034b5 = function () {
imports.wbg.__wbg_get_224d16597dbbfd96 = function () {
return handleError(function (arg0, arg1) {
const ret = Reflect.get(getObject(arg0), getObject(arg1));
return addHeapObject(ret);
}, arguments);
};
imports.wbg.__wbg_call_cb65541d95d71282 = function () {
imports.wbg.__wbg_call_1084a111329e68ce = function () {
return handleError(function (arg0, arg1) {
const ret = getObject(arg0).call(getObject(arg1));
return addHeapObject(ret);
}, arguments);
};
imports.wbg.__wbg_new_b51585de1b234aff = function () {
imports.wbg.__wbg_new_525245e2b9901204 = function () {
const ret = new Object();
return addHeapObject(ret);
};
imports.wbg.__wbg_set_502d29070ea18557 = function (arg0, arg1, arg2) {
imports.wbg.__wbg_set_673dda6c73d19609 = function (arg0, arg1, arg2) {
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
};
imports.wbg.__wbg_isArray_4c24b343cb13cfb1 = function (arg0) {
imports.wbg.__wbg_isArray_8364a5371e9737d8 = function (arg0) {
const ret = Array.isArray(getObject(arg0));
return ret;
};
imports.wbg.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb = function (arg0) {
imports.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902 = function (arg0) {
let result;
try {
result = getObject(arg0) instanceof ArrayBuffer;
} catch {
} catch (_) {
result = false;
}
const ret = result;
return ret;
};
imports.wbg.__wbg_isSafeInteger_bb8e18dd21c97288 = function (arg0) {
imports.wbg.__wbg_isSafeInteger_7f1ed56200d90674 = function (arg0) {
const ret = Number.isSafeInteger(getObject(arg0));
return ret;
};
imports.wbg.__wbg_buffer_085ec1f694018c4f = function (arg0) {
imports.wbg.__wbg_buffer_b7b08af79b0b0974 = function (arg0) {
const ret = getObject(arg0).buffer;
return addHeapObject(ret);
};
imports.wbg.__wbg_new_8125e318e6245eed = function (arg0) {
imports.wbg.__wbg_new_ea1883e1e5e86686 = function (arg0) {
const ret = new Uint8Array(getObject(arg0));
return addHeapObject(ret);
};
imports.wbg.__wbg_set_5cf90238115182c3 = function (arg0, arg1, arg2) {
imports.wbg.__wbg_set_d1e79e2388520f18 = function (arg0, arg1, arg2) {
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
};
imports.wbg.__wbg_length_72e2208bbc0efc61 = function (arg0) {
imports.wbg.__wbg_length_8339fcf5d8ecd12e = function (arg0) {
const ret = getObject(arg0).length;
return ret;
};
imports.wbg.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4 = function (arg0) {
imports.wbg.__wbg_instanceof_Uint8Array_247a91427532499e = function (arg0) {
let result;
try {
result = getObject(arg0) instanceof Uint8Array;
} catch {
} catch (_) {
result = false;
}
const ret = result;
@ -609,8 +596,8 @@ function __wbg_get_imports() {
const ret = getObject(arg1).stack;
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};
imports.wbg.__wbg_error_f851667af71bcfc6 = function (arg0, arg1) {
let deferred0_0;
@ -626,15 +613,15 @@ function __wbg_get_imports() {
imports.wbg.__wbindgen_bigint_get_as_i64 = function (arg0, arg1) {
const v = getObject(arg1);
const ret = typeof v === "bigint" ? v : undefined;
getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
};
imports.wbg.__wbindgen_debug_string = function (arg0, arg1) {
const ret = debugString(getObject(arg1));
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len1 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len1;
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};
imports.wbg.__wbindgen_throw = function (arg0, arg1) {
throw new Error(getStringFromWasm0(arg0, arg1));
@ -647,15 +634,13 @@ function __wbg_get_imports() {
return imports;
}
function __wbg_init_memory(imports, maybe_memory) {}
function __wbg_init_memory(imports, memory) {}
function __wbg_finalize_init(instance, module) {
wasm = instance.exports;
__wbg_init.__wbindgen_wasm_module = module;
cachedBigInt64Memory0 = null;
cachedFloat64Memory0 = null;
cachedInt32Memory0 = null;
cachedUint8Memory0 = null;
cachedDataViewMemory0 = null;
cachedUint8ArrayMemory0 = null;
return wasm;
}
@ -663,6 +648,9 @@ function __wbg_finalize_init(instance, module) {
function initSync(module) {
if (wasm !== undefined) return wasm;
if (typeof module !== "undefined" && Object.getPrototypeOf(module) === Object.prototype) ({ module } = module);
else console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
const imports = __wbg_get_imports();
__wbg_init_memory(imports);
@ -676,25 +664,29 @@ function initSync(module) {
return __wbg_finalize_init(instance, module);
}
async function __wbg_init(input) {
async function __wbg_init(module_or_path) {
if (wasm !== undefined) return wasm;
if (typeof input === "undefined") {
input = new URL("system_wasm_bg.wasm", import.meta.url);
if (typeof module_or_path !== "undefined" && Object.getPrototypeOf(module_or_path) === Object.prototype)
({ module_or_path } = module_or_path);
else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
if (typeof module_or_path === "undefined") {
module_or_path = new URL("system_wasm_bg.wasm", import.meta.url);
}
const imports = __wbg_get_imports();
if (
typeof input === "string" ||
(typeof Request === "function" && input instanceof Request) ||
(typeof URL === "function" && input instanceof URL)
typeof module_or_path === "string" ||
(typeof Request === "function" && module_or_path instanceof Request) ||
(typeof URL === "function" && module_or_path instanceof URL)
) {
input = fetch(input);
module_or_path = fetch(module_or_path);
}
__wbg_init_memory(imports);
const { instance, module } = await __wbg_load(await input, imports);
const { instance, module } = await __wbg_load(await module_or_path, imports);
return __wbg_finalize_init(instance, module);
}