aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/common/whwasmutil.js
Commit message (Collapse)AuthorAge
* Approximately 100 typo corrections spanning the whole tree, submitted via ↵stephan2025-02-27
| | | | | [forum:0db9827f0464bc33|forum post 0db9827f0464bc33] and individually audited and verified. Affects only code comments, innocuous test strings, error message text in tool (not library) code, and configure-level help text. FossilOrigin-Name: f50c21484d3cac73589da0376c423de39ae8b842218105786c5aa3726e4dcaed
* Approximately 50 typo fixes, spanning the whole tree, contributed via ↵stephan2025-02-25
| | | | | [forum:006c8fa165083ac3|forum post 006c8fa165083ac3] and individually checked for correctness. Affects only code comments, docs, and a single line of debug output in a test app. FossilOrigin-Name: af928818a030924060ee0762431dae0f16d53a62f4e1132754d052eb9c621ac2
* URL typo fix in code comments. No code changes.stephan2025-02-02
| | | FossilOrigin-Name: 002a123094e4ef14eb5ec28033adca6083ba2717e1eaa23e80595e37a947e6c2
* JS doc typo fixes. No functional changes.stephan2025-02-01
| | | FossilOrigin-Name: e0d9c74c1cdddb2321131255b94f9cda6530be3f2a06aed4abb54dcda092481e
* Fix an age-old bug in the lower-level wasm/js helper bits which was (A) ↵stephan2025-01-11
| | | | | caused removal of customized WASM func/argument conversion to siltently fail and (B) triggered a warning in the closure toolchain. Reported in [jaccwabyt ticket c5c296e85a7c01360820|https://fossil.wanderinghorse.net/r/jaccwabyt/info/c5c296e85a7c01360820]. FossilOrigin-Name: 99917a5bb04b5ad6ace95baf86d91e6ce098f9d3001de1a29d3d0b0b817acdce
* Doc updates in JS code. No functional changes.stephan2024-06-12
| | | FossilOrigin-Name: 587ed3a5d283898ad0e67ccee86a0a4ccc432fa292c0a3534e9e6ec70a7b7780
* Add a maintenance-reminder comment explaining [dc58ed65492857].stephan2024-05-09
| | | FossilOrigin-Name: 857f5d7fadce1cfe30b3468826f403f736cfecacb1eb6d3b858b01ea3cfd6ffc
* Reformulate a for-in loop to a for loop in wasm.xWrap() to work around a ↵stephan2024-05-09
| | | | | downstream framework-level misbehavior, as reported in [forum:b549992634b55104|forum post b549992634b55104]. FossilOrigin-Name: dc58ed654928574ef254af289bd21c654c587aac80aea36ab96772c35d4ca754
* Internal JS doc touchups. No functional changes.stephan2024-04-26
| | | FossilOrigin-Name: 626b997b4e727554d7ec8b60fb37b2a94cb861a87325da4ae484bd9aa8961ca5
* Additional internal docs in the wasm utilities.stephan2024-04-26
| | | FossilOrigin-Name: 5a2245a9ebae6d23cd343e46b9d730f66ec4d5ffc91b83ed11a0fbd2194ad807
* Resolve the timing/ordering issue of a JS-to-WASM-converted xDestroy() ↵stephan2023-08-04
| | | | | function being uninstalled from WASM right before the underlying native call tries to call it. This has been a long-unnoticed bug which appears only when removing such functions or replacing them. FossilOrigin-Name: 031c9a76b6ad1572e7a88f4d2d62f206b0d37bd1170e2c8a24248c5ec628f2f5
* Part 2 of the fix from [a0f808363318c00fd1db78b].stephan2023-08-04
| | | FossilOrigin-Name: 5c3104228d75c8fafbe24e46623777f3a8647f1b50267af61d46f7fad0e0434e
* Accommodate a breaking change in emcc 3.1.44.stephan2023-07-27
| | | FossilOrigin-Name: 2c5dd34199f5bcf729be814b8b46d9997821fe3a39ab12779c93df1bb2fd108d
* Significant surgery on the wasm build on the way to incorporating wasmfs as ↵stephan2023-07-13
| | | | | a first-class build option. FossilOrigin-Name: 215c37fce38cf647e073480689b79d952af7eb8165ae08c7f5caed27003fecfc
* Replace some JS 'self' references with 'globalThis', as reported via the npm ↵stephan2023-06-26
| | | | | subproject. FossilOrigin-Name: d4e66dfc2e87112fa73a9c64db358429d88fb2ab3a08908b0eb655f6ed42f94b
* Replace use of 'self' in JS code with 'globalThis', as that works in ↵stephan2023-03-07
| | | | | browsers and node environments. Avoid using globalThis.location if it's not set (e.g. in node). Based on feedback in [forum:ac7a94d4f77db235|forum post ac7a94d4f77db235]. Minor JS build tweaks. FossilOrigin-Name: dbbe8f25e58738c10b6192d41f1e3886983871f17631cbc45ce626d3f05a6e26
* Expose the auto-extension API to JS and reorganize some nearby code.stephan2022-12-26
| | | FossilOrigin-Name: 52b229d11d82bfb81c8b63e252c51c57a34dc50498dd685451588c185873c628
* Extend [0e69b2c379e618] to support uninstalling stale JS-to-WASM function ↵stephan2022-12-26
| | | | | pointers added on behalf of UDFs. FossilOrigin-Name: 7a46e629dcbf97ae037c5abb39306af7ad55f1910c1e962373e09d88d8bd5a33
* Reimplement sqlite3.capi.sqlite3_close_v2() and sqlite3session_delete() as a ↵stephan2022-12-26
| | | | | hand-written bindings so that they can attempt to clean up certain (potentially) FuncPtrAdapter-installed functions before closing. Correct the create-function family of JS-to-function-pointer automated conversions to include the UDF's arity as part of the mapping's key so that (un)binding a UDF to different functions for different arities works (and add tests confirming it). Correct a broken doc link in module-symbols.html. FossilOrigin-Name: 60b262ef0f57b162c2566b12e70685a92afb00b441332ea7a6540fcb188cc7af
* Rename the new wasm.irSizeof() to sizeofIR() because that seems clearer.stephan2022-12-25
| | | FossilOrigin-Name: 49a83ca3ba46d3ae8021fbdd72b48ce9181eea6845fa7bb7aa83b16fad1728be
* Merge wasm-session-api branch into trunk, adding the session API to the ↵stephan2022-12-25
|\ | | | | | | | | JS/WASM components. FossilOrigin-Name: dfb8b651fa4faef2d3307a05512cdc479398484c3a59715827179c363861a777
| * Add sqlite3.wasm.irSizeof() and extend certain allocation functions to make ↵stephan2022-12-25
| | | | | | | | | | use of it. FossilOrigin-Name: 1cbc7b1875e8611b9db7a747b4c9499501450deaf90c929d212511837d6f72b6
| * Merge trunk into wasm-session-api branch.stephan2022-12-25
| |\ | | | | | | FossilOrigin-Name: 7f8f1acd82be7dc2eb2147d96299b1b443e86774dfe0b0a8d32669a0500fc9c6
| * \ Merge trunk into wasm-session-api branch.stephan2022-12-23
| |\ \ | | | | | | | | FossilOrigin-Name: 6cdb036d8e8c5ddb0c6578aeefe318e74d7a90228e57b9f9047057dae3252963
| * | | Internal cleanups and minor speed optimizations in the sqlite3.wasm.xWrap() ↵stephan2022-12-23
| | | | | | | | | | | | | | | | | | | | infrastructure. FossilOrigin-Name: c4dab53b8ea3401abd57671b8f3cb39fa4431b864d4c4e14ae24592f8d4cba0a
| * | | Add sqlite3.capi JS bindings for the sqlite3session_...(), ↵stephan2022-12-23
| | | | | | | | | | | | | | | | | | | | sqlite3changeset_...() and sqlite3changegroup_...() APIs, noting that they are completely untested. Aside from missing tests, these bindings reveal a slight string-argument-type shortcoming in the callback function pointer "reverse binding" which should ideally be resolved before publishing them. FossilOrigin-Name: 0a39172ee134816f5ce17a403b960e9c22bb56efd5bcf77ecde465efe0d88b1d
* | | | Replace the "manual" implementation of sqlite3.capi.sqlite3_exec() with a ↵stephan2022-12-25
| |_|/ |/| | | | | | | | | | | briefer "automated" one via the [7f9ace1b11a67] feature addition. Minor code-adjacent internal cleanups. FossilOrigin-Name: 4888957baf18c6763f959fbba998a74156ff656368779107f502b926e9e9d949
* | | Add missing sqlite3_context_db_handle() JS binding. Reimplement ↵stephan2022-12-25
| | | | | | | | | | | | | | | sqlite3_set_authorizer() and sqlite3_set_auxdata() JS bindings to take advantage of [7f9ace1b11a67]. Teach FuncPtrAdapter to emit a console.warn() message if it is invoked after the library is bootstrapped, the goal being to inform users that it's an internal API and should not be invoked from client-side code. FossilOrigin-Name: 8e3d4f6294037396e388ec21abb18bf0201a6bec6ff004730cc5d11b705a6d2b
* | | Enhance sqlite3.wasm.xWrap.FuncPtrAdapter to be able to handle ↵stephan2022-12-25
| | | | | | | | | | | | | | | sqlite3_create_function() and friends and reimplement those bindings to use this feature (this will also simplify certain session API bindings). Interal API changes only with no client-side breakage. FossilOrigin-Name: 7f9ace1b11a6703031790af9cf08ab25df25850a86e6ca2a7aeaefd8aa395e6d
* | | Reimplement JS's sqlite3_bind_text/blob() with hand-written bindings to ↵stephan2022-12-23
| |/ |/| | | | | | | permit more flexible inputs. Add automated JS-to-C function conversion to sqlite3_busy_handler(). sqlite3.wasm.xWrap()'s '*' argument conversion no longer treats JS strings as C-strings: those conversions require explicit opt-in via the 'string' converter (or equivalent). FossilOrigin-Name: 96ba44946b3e88b6aa305c4363cbbfeab0d9120b3d8c4d2587d68b9293ea7cc6
* | Internal JS cleanups. Correct part of [ac136925a645] to account for the ↵stephan2022-12-23
| | | | | | | | | | eTextRep flag being able to hold flags other than the encoding. FossilOrigin-Name: 1dfc03ab1e0269807beef27bf884ab9ead7553d4a5f6ed213f812d7fa052045f
* | Cherry-pick [c4dab53b8ea3401abd] for sqlite3.wasm.xWrap() optimizations.stephan2022-12-23
|/ | | FossilOrigin-Name: 9b97412d3aa791870016ab3c6f565b6a6afa1764f98e969833aec093b9b29919
* Add sqlite3_set_authorizer() support and related tests to JS.stephan2022-12-16
| | | FossilOrigin-Name: 551b848894c249cb3c9d237643d2ed53ffcb3b003d0cf3f797a535df1731ce39
* Internal refactoring of how sqlite3.wasm.xWrap() handles JS-to-C function ↵stephan2022-12-15
| | | | | pointer conversions, to enable similar conversions to be added more easily. FossilOrigin-Name: 10cfe3fae6f680d3ecc3b0afbbf628ce91e34e3757b19dd27c231f0daf44232a
* Rename the new peek/pokeF32() and peek/pokeF64() to peek/poke32f() and ↵stephan2022-12-14
| | | | | peek/poke64f() for consistency with related APIs and because they're easier on both the eyes and the fingers. FossilOrigin-Name: cc86f03ed698a071cd02ef3dfaba69092226bff20c917d662f808061627ad285
* Add convenience variants of sqlite3.wasm.peek/poke() for each numeric type ↵stephan2022-12-14
| | | | | to help reduce errors related to typos in the final argument (type-name strings). If wasm.xWrap.FuncPtrAdapter is called as a function, instead of a constructor, it now behaves as if it were called as a constructor (previously it threw an exception). FossilOrigin-Name: 14e3fc01b929fa3f9a2fdbd93deb4a8aad58c111d46369c772def0437152fa75
* Extend the sqlite3.wasm function pointer argument converter to be able to ↵stephan2022-12-13
| | | | | handle the "two-layered context" of sqlite3_create_collation() and friends and make use of FuncPtrAdapter to perform JS-to-WASM function conversion for them. FossilOrigin-Name: 0a60b7215e433f8c50027c70731b11e58d74c90ec5903e66ae42f9c98e40b044
* Revert part of [9386d6f63468] because the new automatic function pointer ↵stephan2022-12-12
| | | | | binding cannot properly track per-context function mappings when the context is more complex than a single context-type pointer. e.g. it is fine for sqlite3_trace_v2() but it breaks down with sqlite3_create_collation() because that one needs to use the collation name as part of the context key and we cannot sensibly do so with the current code. FossilOrigin-Name: 6cd21b79075367227b57bccf829cc7d4ccc7d7fbcfaed226b4c8e942ddae4eb6
* Move JS-to-C binding signatures from sqlite3-api-prologue.js to ↵stephan2022-12-12
| | | | | sqlite3-api-glue.js to allow for use of the new/experimental sqlite3.wasm.xWrap() feature which automatically binds JS functions to WASM/C as needed, which simplifies creation of bindings which take C function pointers. Reimplement sqlite3_exec(), sqlite3_create_collation(), sqlite3_progress_handler() to use this new feature. FossilOrigin-Name: 9386d6f634680b4e0fa5487c34c63acb29f0b7a6ae738b8f6164ad084a229b62
* Rework the internals of how argument/result types are converted to/from wasm ↵stephan2022-12-12
| | | | | in prep for attempting to support automated conversions of function pointer argument types. FossilOrigin-Name: 58052d8285cbc2aa8c4f8a9f5c2d33ac12014f6a70afbc93bc4ce5b9fd1f9ee5
* Refactor the sqlite3_value-to-JS conversion from an internal detail to ↵stephan2022-12-09
| | | | | sqlite3.capi.sqlite3_value_to_js() for use with routines like sqlite3_module::xFilter(). FossilOrigin-Name: f6dbf280f99809a80c99337e4c22a86dea7a35ae41ae9a69144c4502385a0a1f
* Rename the oft-used, verbose sqlite3.wasm.get/setMemValue() and ↵stephan2022-12-09
| | | | | get/setPtrValue() to peek/poke() and peek/pokePtr(). The old names are retained as aliases just in case any client code actually uses them, but they are now deprecated. FossilOrigin-Name: ad0a8139b0b025f8e9d2eca0c303557ef10fdfab8c8b65afb08c510a804073d5
* Micro-optimization in the oft-activated JS-to-WASM arguments conversion step.stephan2022-12-09
| | | FossilOrigin-Name: ee47e9b83ca668b37dc1d8e519048a635693cf33d9967a2d81ff0824b7eea4ba
* Export sqlite3_status() and sqlite3_stmt_status() to wasm. Expand the ↵stephan2022-12-09
| | | | | arg/return semantics of wasm.get/setPtrValue() and get/setMemValue() to simplify handling of multiple pointers. FossilOrigin-Name: e144fd5c88fa4151429a2fef3daf389588402e158267f0afa0dfd142527d76b9
* Rename wasm.cstringToJs() to wasm.cstrToJs() for consistency with other ↵stephan2022-12-06
| | | | | wasm.cstr... APIs. FossilOrigin-Name: cbf483ea0ba3e6dc08ad7ed654380f818544b4c3cedfdb8aa848a83298268ceb
* Add wasm.cArgvToJs() to support sqlite3_module::xConnect().stephan2022-12-06
| | | FossilOrigin-Name: c3ebdccf94d5e63c229bf91056c08052d78732e663334070ef3b0ef6fb4bfb8f
* Minor internal JS code/docs cleanups.stephan2022-12-06
| | | FossilOrigin-Name: 21331bdd36a91b07a687ffadce392dcf2ccd0fd824b35d9dd027d4289a40fc96
* Export sqlite3_bind/value/result_pointer() to wasm. Add 'static-string' ↵stephan2022-12-05
| | | | | argument converter to support the lifetime requirements of bind/result_pointer()'s string argument. Correct an endless loop in wasm.cstrlen() when passed a non-C-string argument. FossilOrigin-Name: a94552434a657376d5ce1831de05c1b15fb153020848cd825fb0df413c3baa70
* Initial infrastructure for adding virtual table/table-valued function ↵stephan2022-12-05
| | | | | support to WASM. FossilOrigin-Name: c202d7a0398b9aabc2babba5c4c91a313f32bbf37549d419775642bb4aa3936a
* Rename wasm.xWrap.resultAdapter() X:free entries to X:dealloc for ↵stephan2022-12-03
| | | | | consistency with wasm.dealloc(). Add an undocumented feature to replace wasm.alloc/dealloc/realloc() with the C-standard allocators (after an allocator misuse led down a several-hour rabbit hole trying to discover a mis-free() violation). Related test updates. FossilOrigin-Name: d9807656f8a7c2a893d3f68ee5592f44826b8e999ae66f7d9000674b5c1b0207