LibGC/LibJS/js: port to windows
This commit adds support for running javascript using the js executable. It does not have repl functionality.
The allocator in LibGC had to be reworked using winapi as the library that provides an mmap interface on windows does not support MAP_FIXED.
Most changes are related to data visibilty across dll boundaries which requires dllimport/dllexport attriubutes on windows.
A minimum windows version of 10 was defined to get access to certain new APIs(DiscardVirtualMemory),to emulate behavior of madvise(MADV_FREE).
A static_assert checking the size of IteratorRecord was ifdef'ed out as the layout of the struct is different (larger) on windows.
Hello!
One or more of the commit messages in this PR do not match the Ladybird code submission policy, please check the lint_commits CI job for more details on which commits were flagged and why.
Please do not close this PR and open another, instead modify your commit message(s) with git commit --amend and force push those changes to update this PR.
Looking at BlockAllocator again, would it make sense to change the blocks to no access when "deallocating" them, for both linux and windows? Or is this to avoid runtime overhead. Currently they are only poisoned for sanitizers.
Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.
This needs chunked into several commits.
At least the following:
- One per library adding the incomplete export header and export macro annotations. A # TODO comment above each manual call to the cmake function to use the helper that also sets the visibility preset is in order.
- One to move functions around in js.cpp
- One to add #ifdef WINDOWS macros to js.cpp
- One adding extra options to comon_compile_options.cmake
- One that enables more libraries and tests on windows CI.
- One to move functions around in js.cpp
- One to add #ifdef WINDOWS macros to js.cpp
This would be rather painful. Can this stay as one commit?