From: stephan Date: Fri, 9 Dec 2022 08:44:22 +0000 (+0000) Subject: Micro-optimization in the oft-activated JS-to-WASM arguments conversion step. X-Git-Tag: version-3.41.0~281 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a83f52f4881aa461ee3b7132892fddb8e20c9b2;p=thirdparty%2Fsqlite.git Micro-optimization in the oft-activated JS-to-WASM arguments conversion step. FossilOrigin-Name: ee47e9b83ca668b37dc1d8e519048a635693cf33d9967a2d81ff0824b7eea4ba --- diff --git a/ext/wasm/common/whwasmutil.js b/ext/wasm/common/whwasmutil.js index 3f32818765..9724f03e47 100644 --- a/ext/wasm/common/whwasmutil.js +++ b/ext/wasm/common/whwasmutil.js @@ -1549,18 +1549,19 @@ self.WhWasmUtilInstaller = function(target){ /*Verify the arg type conversions are valid...*/; if(undefined!==resultType && null!==resultType) __xResultAdapterCheck(resultType); argTypes.forEach(__xArgAdapterCheck); + const cxw = cache.xWrap; if(0===xf.length){ // No args to convert, so we can create a simpler wrapper... return (...args)=>(args.length ? __argcMismatch(fname, xf.length) - : cache.xWrap.convertResult(resultType, xf.call(null))); + : cxw.convertResult(resultType, xf.call(null))); } return function(...args){ if(args.length!==xf.length) __argcMismatch(fname, xf.length); const scope = target.scopedAllocPush(); try{ - const rc = xf.apply(null,args.map((v,i)=>cache.xWrap.convertArg(argTypes[i], v))); - return cache.xWrap.convertResult(resultType, rc); + for(const i in args) args[i] = cxw.convertArg(argTypes[i], args[i]); + return cxw.convertResult(resultType, xf.apply(null,args)); }finally{ target.scopedAllocPop(scope); } diff --git a/manifest b/manifest index 8ed2466095..f30b31d761 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Correct\sa\stest\sbug\swhich\sbroke\sthe\sprevious\scheckin's\swasm\stests\sin\shigher\soptimization\slevels.\sTest\sbug\s-\sit\sshould\snot\shave\sworked\sin\s-O0\smode. -D 2022-12-09T07:17:54.882 +C Micro-optimization\sin\sthe\soft-activated\sJS-to-WASM\sarguments\sconversion\sstep. +D 2022-12-09T08:44:22.095 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -521,7 +521,7 @@ F ext/wasm/c-pp.c 92285f7bce67ed7b7020b40fde8ed0982c442b63dc33df9dfd4b658d4a6c07 F ext/wasm/common/SqliteTestUtil.js d8bf97ecb0705a2299765c8fc9e11b1a5ac7f10988bbf375a6558b7ca287067b F ext/wasm/common/emscripten.css 11bd104b6c0d597c67d40cc8ecc0a60dae2b965151e3b6a37fa5708bac3acd15 F ext/wasm/common/testing.css 0ff15602a3ab2bad8aef2c3bd120c7ee3fd1c2054ad2ace7e214187ae68d926f -F ext/wasm/common/whwasmutil.js 44a1ef32d56448ccea711cefe1ecd235fe48084a04d96d3947e810bc5ac53042 +F ext/wasm/common/whwasmutil.js 96085c3fb17e019ac8e92a1310d6c976acdbc3dc1caec056ae7288d60df0f1b6 F ext/wasm/demo-123-worker.html a0b58d9caef098a626a1a1db567076fca4245e8d60ba94557ede8684350a81ed F ext/wasm/demo-123.html 8c70a412ce386bd3796534257935eb1e3ea5c581e5d5aea0490b8232e570a508 F ext/wasm/demo-123.js ebae30756585bca655b4ab2553ec9236a87c23ad24fc8652115dcedb06d28df6 @@ -2067,8 +2067,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P e144fd5c88fa4151429a2fef3daf389588402e158267f0afa0dfd142527d76b9 -R c7a76ce5f59dc497d6ac049e327b4de7 +P f07141b7500c36169c2c96e045acf37ec97a0d75c0a5f4d0ebed4dc1d2094ccf +R bbdb4e606f2496a8e678d46149d27e66 U stephan -Z d33bb823bea6299d8e67d21141180032 +Z a13be2222b1eb37b716fa4d706c4fcde # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 3499bd1a35..66e94c3dc5 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f07141b7500c36169c2c96e045acf37ec97a0d75c0a5f4d0ebed4dc1d2094ccf \ No newline at end of file +ee47e9b83ca668b37dc1d8e519048a635693cf33d9967a2d81ff0824b7eea4ba \ No newline at end of file