mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibJS: Cache commonly used FlyStrings in the VM
Roughly 7% of test-js runtime was spent creating FlyStrings from string literals. This patch frontloads that work and caches all the commonly used names in LibJS on a CommonPropertyNames struct that hangs off VM.
This commit is contained in:
@@ -40,7 +40,8 @@ Array* Array::create(GlobalObject& global_object)
|
||||
Array::Array(Object& prototype)
|
||||
: Object(prototype)
|
||||
{
|
||||
define_native_property("length", length_getter, length_setter, Attribute::Writable);
|
||||
auto& vm = this->vm();
|
||||
define_native_property(vm.names.length, length_getter, length_setter, Attribute::Writable);
|
||||
}
|
||||
|
||||
Array::~Array()
|
||||
|
||||
Reference in New Issue
Block a user