mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 14:48:15 +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:
@@ -154,7 +154,7 @@ String JSONObject::serialize_json_property(GlobalObject& global_object, Stringif
|
||||
if (vm.exception())
|
||||
return {};
|
||||
if (value.is_object()) {
|
||||
auto to_json = value.as_object().get("toJSON");
|
||||
auto to_json = value.as_object().get(vm.names.toJSON);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
if (to_json.is_function()) {
|
||||
|
||||
Reference in New Issue
Block a user