Use fuses to optimize IsOptimizableInitForMapOrSet
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
People
(Reporter: jandem, Unassigned)
References
(Blocks 3 open bugs)
Details
(Whiteboard: [sp3])
This function is used to determine if we can optimize new Set(array)
with a fast path. Bug 1933557 is adding support for Map
and renaming it to IsOptimizableInitForMapOrSet
.
The checks at the end, for the iterator protocol, could probably be replaced with a fuse check now. It may also be possible then to make this function infallible and return optimized
directly instead of as outparam.
This would also make it easier to eventually optimize new Map(iterable)
and new Set(iterable)
more from JIT code. If this function and the array optimization can no longer trigger a GC, we could call it with callWithABI
and if that returns "can't optimize" we could call MapConstructorInit
or SetConstructorInit
directly from JIT code which is a lot faster than the current call into self-hosted code from C++. See bug 1933557 comment 1.
Reporter | ||
Comment 1•2 months ago
|
||
We could also use a fuse to optimize the code checking that Set.prototype.add
and Map.prototype.set
are the original builtin functions. This would get rid of a relatively slow property lookup on the prototype object.
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Description
•