/* * Copyright (c) 2026-present, the Ladybird developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include namespace JS::FFI { struct DecodedBytecodeCacheBlob; } namespace JS::RustIntegration { enum class ProgramType : u8 { Script = 0, Module = 1, }; class JS_API DecodedBytecodeCache final : public RefCounted { public: static RefPtr create(Core::ImmutableBytes, ProgramType, ReadonlyBytes source_hash); static NonnullRefPtr create(FFI::DecodedBytecodeCacheBlob*); ~DecodedBytecodeCache(); FFI::DecodedBytecodeCacheBlob* create_materialization_handle() const; private: explicit DecodedBytecodeCache(FFI::DecodedBytecodeCacheBlob*); FFI::DecodedBytecodeCacheBlob* m_blob { nullptr }; }; }