LibJS: Store bytecode cache indexes instead of pointers

Store compact cache indexes in bytecode instructions instead of raw
pointers to the executable cache vectors. This keeps the instruction
stream independent from heap addresses and removes pointer fixups when
materializing cached bytecode.

Resolve the mutable cache pointers at execution time from the current
Executable. Bytecode test expectations are updated for the smaller cache
operands and resulting instruction offsets.
This commit is contained in:
Andreas Kling 2026-05-18 13:26:41 +02:00 committed by Andreas Kling
parent 40515a8745
commit 1ce4242b4b
Notes: github-actions[bot] 2026-05-18 18:37:20 +00:00
154 changed files with 1808 additions and 1904 deletions

View file

@ -101,19 +101,6 @@ Executable::Executable(
Executable::~Executable() = default;
void Executable::fixup_cache_pointers()
{
for (auto it = InstructionStreamIterator(bytecode); !it.at_end(); ++it) {
fixup_instruction_cache(
const_cast<Instruction&>(*it),
property_lookup_caches.span(),
global_variable_caches.span(),
template_object_caches.span(),
object_shape_caches.span(),
object_property_iterator_caches.span());
}
}
static SourceMapEntry const* first_real_source_map_entry(Executable const& executable)
{
SourceMapEntry const* first_entry = nullptr;