summaryrefslogtreecommitdiff
path: root/Libraries/LibJS/Heap
AgeCommit message (Collapse)Author
2020-04-06LibJS: Do a garbage collection every N allocations (N=10'000)Andreas Kling
To prevent the heap from growing infinitely large, we now do a full GC every 10'000 allocations. :^)
2020-03-25LibJS: Disable HEAP_DEBUG logging on non-SerenityOS platformsAndreas Kling
This makes it a bit easier to work with LibJS on Linux for now.
2020-03-23LibJS: Always collect all garbage when destroying HeapAndreas Kling
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. :^)
2020-03-23LibJS: Put some more Heap debug logging behind HEAP_DEBUGAndreas Kling
2020-03-23LibJS: Port garbage collector to LinuxAndreas Kling
Well that was easy. LibJS can now run on Linux :^)
2020-03-21LibJS: Include the cell size in HeapBlock mmap namesAndreas Kling
HeapBlocks now show up in SystemMonitor as "LibJS: HeapBlock(32)" :^)
2020-03-21LibJS: Round cell sizes up to a multiple of 16 bytesAndreas Kling
This increases HeapBlock utilization significantly (and reduces overall memory usage.)
2020-03-21LibJS: Delete fully-empty HeapBlocks after garbage collectionAndreas Kling
We now deallocate GC blocks when they are found to have no live cells inside them.
2020-03-18LibJS: Add missing copyright headersAndreas Kling
2020-03-18LibJS: Add Handle<T>, a strong C++ handle for keeping GC objects aliveAndreas Kling
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.
2020-03-16LibJS+js: Add a debug option (js -g) to GC after every allocationAndreas Kling
This is very useful for discovering collector bugs.
2020-03-16LibJS: Implement basic conservative garbage collectionAndreas Kling
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.)
2020-03-16LibJS: Add "Heap" and "Runtime" subdirectoriesAndreas Kling
Let's try to keep LibJS tidy as it expands. :^)