mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +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,8 +40,9 @@ BoundFunction::BoundFunction(GlobalObject& global_object, Function& target_funct
|
||||
|
||||
void BoundFunction::initialize(GlobalObject& global_object)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
Function::initialize(global_object);
|
||||
define_property("length", Value(m_length), Attribute::Configurable);
|
||||
define_property(vm.names.length, Value(m_length), Attribute::Configurable);
|
||||
}
|
||||
|
||||
BoundFunction::~BoundFunction()
|
||||
|
||||
Reference in New Issue
Block a user