JOP_IN JOP_GET JOP_GET_INDEX JOP_PUT_INDEX JOP_NEXT handle arrays and tuples
without calling janet_in, janet_get, janet_getindex, janet_putindex, janet_next_impl.
As this inline case can't raise or allocate to the fiber stack, it can skip vm_commit
and reloading the stack!
The same approach works for strings and buffers, but strings share an implementation
with symbols and keywords, requiring some extra checks. I built the switch to avoid
slow downs due to such checks (for dictionary? ds) but stringly types aren't on
the hot path and expanding JOP_IN and JOP_GET's implementation seems worse than the gain.
Found by a fuzzer and manually simplified. Comparison operators have
custom inlining code that wasn't checking the distance between jump
targets before compiling.
The old code had a quirk where it implicitly assumed that the capacity
was a power of 2. This actually isn't always the case for huge tables
but the side effect was just a bad distribution of keys in that case.
Either way, seems better to make sure the traversal code doesn't
diverge. Splitting into *_shallow and *_deep implementations shows the
logic better as well for the optimization.
Two bundles can now share a directory created with the same permissions.
When removing bundles, each package installs a unique ".keep" file that
must be removed before the outer directory can be removed. If we failed
to delete a directory during cleanup, it is likely because it still has
contents from other packages. The keep file means that adding directory
will also add at least 1 child file.
After adding the "too many closures" error, we tried to pop a NULL scope
during cleanup - this can segfault. Handle bad scope state better during
cleanup.
the same as our register size.
Mostly for x32, but gets rid of the hard-coded ifdef with logic that
calls out the issue and makes it clear what assumptions we are making.
Previously, we had silent miscompiles in some cases.
The ideal fix is to let us reference upvalues beyond slot 255. One way
would be to add a new instruction pair that would reference a 16-bit
constant index, which would itself encode a pair of at least 16 bit
values instead of the current instruction which encodes a pair of 8 bit
values.
Streams sent to another thread with ev/thread were only re-registered with the receiving thread's event loop on the poll backend. On kqueue and epoll, waiting on them hung forever, and on epoll closing them raised "No such file or directory".
Co-authored-by: jcates <jcates@>
GCC aligns alloca to the widest enabled vector type (16 bytes, 32 with avx,
64 with avx-512). With AVX the block address is `lea 0x1f(%rsp)` rounded down
to the nearest 32-divisible, but half the time the block starts 16 bytes higher
so the function reads the stack arguments 2 slots away from where it should.
Without AVX the address is `lea 0xf(%rsp)` which is the stack pointer.