Lenny Maiorani
d00b79568f
Libraries: Use default constructors/destructors in LibJS
...
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules
"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-16 16:19:40 +00:00
Andreas Kling
e08d325124
LibJS: Use HashTable::remove_all_matching() in WeakSet :^)
2022-01-05 18:57:14 +01:00
Andreas Kling
83bd675477
LibJS: Make WeakContainer pruning do less work
...
Instead of iterating *all* swept cells when pruning weak containers,
only iterate the cells actually *in* the container.
Also, instead of compiling a list of all swept cells, we can simply
check the Cell::state() flag to know if something should be pruned.
2021-10-05 18:52:00 +02:00
Andreas Kling
470c99a2a6
LibJS: Tweak the WeakContainer::remove_swept_cells() API a little bit
...
Make this API take a Span<Cell*> instead of a Vector<Cell*>&.
This is behavior neutral, but stops the API looking like it wants to
do mutable things to the Vector.
2021-09-11 12:09:55 +02:00
Andreas Kling
cd53d046b2
LibJS: Fix typo "sweeped" => "swept" everywhere
2021-06-27 22:40:49 +02:00
Idan Horowitz
1a8ee5d8d7
LibJS: Generify the garbage collector's weak container notifications
...
This will allow us to use the same interface for other JS weak
containers like the WeakMap & WeakRef.
2021-06-12 10:44:28 +01:00
Idan Horowitz
a00d154522
LibJS: Notify WeakSets when heap cells are sweeped
...
This is an implementation of the following optional optimization:
https://tc39.es/ecma262/#sec-weakref-execution
2021-06-09 21:52:25 +01:00
Idan Horowitz
8b6beac5ce
LibJS: Add the WeakSet built-in object
2021-06-09 21:52:25 +01:00