Age | Commit message (Collapse) | Author |
|
This is regarding PR #234. Sergey pointed out that not every Mach is Darwin.
|
|
Lagom now builds under macOS. Only two minor adjustments were required:
* LibCore TCP/UDP code can't use `SOCK_{NONBLOCK,CLOEXEC}` on macOS,
use ioctl() and fcntl() instead
* LibJS `Heap` code pthread usage ported to MacOS
|
|
This (seemingly) no-op cast communicates our intention to clang
|
|
|
|
A MarkedValueList is basically a Vector<JS::Value> that registers with
the Heap and makes sure that the stored values don't get GC'd.
Before this change, we were unsafely keeping Vector<JS::Value> in some
places, which is out-of-reach for the live reference finding logic
since Vector puts its elements on the heap by default.
We now pass all the JavaScript tests even when running with "js -g",
which does a GC on every heap allocation.
|
|
|
|
This simplifies the cell visiting functions by letting them not worry
about the pointers they pass to the visitor being null.
|
|
Instead of just throwing Error objects with a name string, we now throw
the real Error subclass types. :^)
|
|
To prevent the heap from growing infinitely large, we now do a full GC
every 10'000 allocations. :^)
|
|
This makes it a bit easier to work with LibJS on Linux for now.
|
|
When the Heap is going down, it's our last chance to run destructors,
so add a separate collector mode where we simply skip over the marking
phase and go directly to sweeping. This causes everything to get swept
and all live cells get destroyed.
This way, valgrind reports 0 leaks on exit. :^)
|
|
|
|
Well that was easy. LibJS can now run on Linux :^)
|
|
This increases HeapBlock utilization significantly (and reduces overall
memory usage.)
|
|
We now deallocate GC blocks when they are found to have no live cells
inside them.
|
|
This is pretty heavy and unoptimized, but it will do the trick for now.
Basically, Heap now has a HashTable<HandleImpl*> and you can call
JS::make_handle(T*) to construct a Handle<T> that guarantees that the
pointee will always survive GC until the Handle<T> is destroyed.
|
|
This is very useful for discovering collector bugs.
|
|
We now scan the stack and CPU registers for potential pointers into the
GC heap, and include any valid Cell pointers in the set of roots.
This works pretty well but we'll also need to solve marking of things
passed to native functions, since those are currently in Vector<Value>
and the Vector storage is on the heap (not scanned.)
|
|
Let's try to keep LibJS tidy as it expands. :^)
|