mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibJS/JIT: Add fast path for GetById of Array.length
Array.length is magical (since it has to reflect the number of elements in the object's property storage). We now handle it specially in jitted code, giving us a massive speed-up on Kraken/ai-astar.js (and probably many other things as well) :^)
This commit is contained in:
parent
e41f0d9dec
commit
b532dedc91
Notes:
sideshowbarker
2024-07-17 06:39:26 +09:00
Author: https://github.com/awesomekling
Commit: b532dedc91
Pull-request: https://github.com/SerenityOS/serenity/pull/21910
Reviewed-by: https://github.com/Hendiadyoin1
3 changed files with 65 additions and 0 deletions
|
@ -64,6 +64,7 @@ NonnullGCPtr<Array> Array::create_from(Realm& realm, Vector<Value> const& elemen
|
|||
Array::Array(Object& prototype)
|
||||
: Object(ConstructWithPrototypeTag::Tag, prototype)
|
||||
{
|
||||
m_has_magical_length_property = true;
|
||||
}
|
||||
|
||||
// 10.4.2.4 ArraySetLength ( A, Desc ), https://tc39.es/ecma262/#sec-arraysetlength
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue