mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-06-23 09:50:33 +00:00
Keep basic block offsets as construction-only metadata rather than storing them on every Executable. The validator now receives the offsets through a transient Rust FFI span, and the bytecode dump rebuilds block starts by scanning labels, terminators, and exception handler metadata. Drop the table from the bytecode cache format and bump the format version so old caches are rebuilt. This removes a field that was only used by validation and bytecode dump paths.
28 lines
669 B
C++
28 lines
669 B
C++
/*
|
|
* Copyright (c) 2026-present, the Ladybird developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Error.h>
|
|
#include <AK/Span.h>
|
|
#include <LibJS/Forward.h>
|
|
|
|
namespace JS::Bytecode {
|
|
|
|
class Executable;
|
|
|
|
// Whether the bytecode being validated still has m_cache fields stored as
|
|
// indices (BeforeFixup) or has had Executable::fixup_cache_pointers() rewrite
|
|
// them into live pointers (AfterFixup). Cache fields are only range-checked
|
|
// in the BeforeFixup case.
|
|
enum class CacheState : u8 {
|
|
BeforeFixup,
|
|
AfterFixup,
|
|
};
|
|
|
|
ErrorOr<void> validate_bytecode(Executable const&, ReadonlySpan<u32> basic_block_offsets, CacheState);
|
|
|
|
}
|