mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibJS+LibWeb: Replace StringOrSymbol usage with PropertyKey
- Avoids unnecessary conversions between StringOrSymbol and PropertyKey on the hot path of property access. - Simplifies the code by removing StringOrSymbol and using PropertyKey directly. There was no reason to have a separate StringOrSymbol type representing the same data as PropertyKey, just with the index key stored as a string. PropertyKey has been updated to use a tagged pointer instead of a Variant, so it still occupies 8 bytes, same as StringOrSymbol. 12% improvement on JetStream/gcc-loops.cpp.js 12% improvement on MicroBench/object-assign.js 7% improvement on MicroBench/object-keys.js
This commit is contained in:
parent
5495531118
commit
b559965448
Notes:
github-actions[bot]
2025-05-17 14:09:31 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: b559965448
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4761
12 changed files with 195 additions and 275 deletions
|
|
@ -1921,7 +1921,7 @@ static void dump_object(Object& o, HashTable<Object const*>& seen, int indent =
|
|||
seen.set(&o);
|
||||
for (auto& it : o.shape().property_table()) {
|
||||
auto value = o.get_direct(it.value.offset);
|
||||
dbgln("{} {} -> {}", String::repeated(' ', indent).release_value(), it.key.to_display_string(), value);
|
||||
dbgln("{} {} -> {}", String::repeated(' ', indent).release_value(), it.key.to_string(), value);
|
||||
if (value.is_object()) {
|
||||
dump_object(value.as_object(), seen, indent + 2);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue