ladybird/Libraries/LibJS/Bytecode
Luke Wilde d4deafe5fe LibJS: Track current shape dictionary generation in PropertyLookupCache
When an object becomes too big (currently 64 properties or more), we
change its shape to a dictionary and don't do any further transitions.

However, this means the Shape of the object no longer changes, so the
cache invalidation check of `current_shape != cache.shape` is no longer
a valid check.

This fixes that by keeping track of a generation number for the Shape
both on the Shape object and in the cache, allowing that to be checked
instead of the Shape identity. The generation is incremented whenever
the dictionary is mutated.

Fixes stale cache lookups on Gmail preventing emails from being
displayed.

I was not able to produce a reproduction for this, plus the generation
count was over the 20k mark on Gmail.
2025-10-24 15:35:04 +02:00
..
ASTCodegen.cpp LibJS: Split PutBy* instructions into specialized per-kind variants 2025-10-11 20:08:58 +02:00
BasicBlock.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
BasicBlock.h Everywhere: Slap some [[clang::lifetimebound]] where appropriate 2025-09-01 11:11:38 +02:00
Builtins.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Builtins.h LibJS: Avoid function call if @@hasInstance is default implementation 2025-10-13 17:15:44 +02:00
CodeGenerationError.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
CodeGenerationError.h LibJS: Revert Enable EXPLICIT_SYMBOL_EXPORT 2025-07-22 11:51:29 -04:00
Executable.cpp LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
Executable.h LibJS: Track current shape dictionary generation in PropertyLookupCache 2025-10-24 15:35:04 +02:00
Generator.cpp LibJS: Split PutBy* instructions into specialized per-kind variants 2025-10-11 20:08:58 +02:00
Generator.h LibJS: Rename Bytecode::Op::PropertyKind => Bytecode::PutKind 2025-10-11 20:08:58 +02:00
IdentifierTable.cpp LibJS+LibWeb+WebContent: Port JS::PropertyKey to UTF-16 2025-08-05 07:07:15 -04:00
IdentifierTable.h LibJS: Give Interpreter a direct pointer to the identifier table 2025-10-07 23:50:51 +02:00
Instruction.cpp LibJS: Remove unused InstructionStreamIterator::source_code getter 2025-04-16 10:41:44 -06:00
Instruction.h LibJS: Split PutBy* instructions into specialized per-kind variants 2025-10-11 20:08:58 +02:00
Interpreter.cpp LibJS: Track current shape dictionary generation in PropertyLookupCache 2025-10-24 15:35:04 +02:00
Interpreter.h LibJS: Give Interpreter a direct pointer to the identifier table 2025-10-07 23:50:51 +02:00
Label.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Label.h LibJS: Revert Enable EXPLICIT_SYMBOL_EXPORT 2025-07-22 11:51:29 -04:00
Op.h LibJS: Add fast path for division of two numbers 2025-10-11 20:08:58 +02:00
Operand.h LibJS: Revert Enable EXPLICIT_SYMBOL_EXPORT 2025-07-22 11:51:29 -04:00
PropertyAccess.h LibJS: Track current shape dictionary generation in PropertyLookupCache 2025-10-24 15:35:04 +02:00
PutKind.h LibJS: Rename Bytecode::Op::PropertyKind => Bytecode::PutKind 2025-10-11 20:08:58 +02:00
RegexTable.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
RegexTable.h LibJS: Revert Enable EXPLICIT_SYMBOL_EXPORT 2025-07-22 11:51:29 -04:00
Register.h LibJS: Revert Enable EXPLICIT_SYMBOL_EXPORT 2025-07-22 11:51:29 -04:00
ScopedOperand.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
ScopedOperand.h LibJS: Revert Enable EXPLICIT_SYMBOL_EXPORT 2025-07-22 11:51:29 -04:00
StringTable.cpp LibJS+LibWeb: Port interned bytecode strings to UTF-16 2025-08-14 10:27:08 +02:00
StringTable.h LibJS+LibWeb: Port interned bytecode strings to UTF-16 2025-08-14 10:27:08 +02:00