LibJS: Route bytecode cache installs through owners
Store ExecutableBacking on Script and SourceTextModule, and make those owners coordinate generated cache installation. Replacing executable backing now clears non-cache compile inputs and verifies that mapped cache-backed records no longer retain source or heap bytecode inputs.
This commit is contained in:
parent
795a82d621
commit
1a7b5ebb1d
4 changed files with 229 additions and 12 deletions
|
|
@ -29,7 +29,7 @@ Result<GC::Ref<Script>, Vector<ParserError>> Script::parse(StringView source_tex
|
|||
return Vector<ParserError> {};
|
||||
if (rust_compilation->is_error())
|
||||
return rust_compilation->release_error();
|
||||
return realm.heap().allocate<Script>(realm, filename, move(rust_compilation->value()), host_defined);
|
||||
return realm.heap().allocate<Script>(realm, filename, move(rust_compilation->value()), ExecutableBacking::source(), host_defined);
|
||||
}
|
||||
|
||||
Result<GC::Ref<Script>, Vector<ParserError>> Script::create_from_parsed(FFI::ParsedProgram* parsed, NonnullRefPtr<SourceCode const> source_code, Realm& realm, HostDefined* host_defined)
|
||||
|
|
@ -40,7 +40,7 @@ Result<GC::Ref<Script>, Vector<ParserError>> Script::create_from_parsed(FFI::Par
|
|||
return Vector<ParserError> {};
|
||||
if (rust_compilation->is_error())
|
||||
return rust_compilation->release_error();
|
||||
return realm.heap().allocate<Script>(realm, filename, move(rust_compilation->value()), host_defined);
|
||||
return realm.heap().allocate<Script>(realm, filename, move(rust_compilation->value()), ExecutableBacking::source(), host_defined);
|
||||
}
|
||||
|
||||
Result<GC::Ref<Script>, Vector<ParserError>> Script::create_from_compiled(FFI::CompiledProgram* compiled, NonnullRefPtr<SourceCode const> source_code, Realm& realm, HostDefined* host_defined)
|
||||
|
|
@ -51,7 +51,7 @@ Result<GC::Ref<Script>, Vector<ParserError>> Script::create_from_compiled(FFI::C
|
|||
return Vector<ParserError> {};
|
||||
if (rust_compilation->is_error())
|
||||
return rust_compilation->release_error();
|
||||
return realm.heap().allocate<Script>(realm, filename, move(rust_compilation->value()), host_defined);
|
||||
return realm.heap().allocate<Script>(realm, filename, move(rust_compilation->value()), ExecutableBacking::heap_bytecode(), host_defined);
|
||||
}
|
||||
|
||||
Result<GC::Ref<Script>, Vector<ParserError>> Script::create_from_bytecode_cache(FFI::DecodedBytecodeCacheBlob* bytecode_cache, NonnullRefPtr<SourceCode const> source_code, Realm& realm, HostDefined* host_defined)
|
||||
|
|
@ -62,12 +62,85 @@ Result<GC::Ref<Script>, Vector<ParserError>> Script::create_from_bytecode_cache(
|
|||
return Vector<ParserError> {};
|
||||
if (rust_compilation->is_error())
|
||||
return rust_compilation->release_error();
|
||||
return realm.heap().allocate<Script>(realm, filename, move(rust_compilation->value()), host_defined);
|
||||
return realm.heap().allocate<Script>(realm, filename, move(rust_compilation->value()), ExecutableBacking::mapped_bytecode_cache(), host_defined);
|
||||
}
|
||||
|
||||
Script::Script(Realm& realm, StringView filename, RustIntegration::ScriptResult&& result, HostDefined* host_defined)
|
||||
bool Script::try_install_bytecode_cache(FFI::DecodedBytecodeCacheBlob* bytecode_cache, NonnullRefPtr<SourceCode const> source_code)
|
||||
{
|
||||
if (m_executable_backing.is_mapped_bytecode_cache()) {
|
||||
RustIntegration::free_decoded_bytecode_cache_blob(bytecode_cache);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_executable) {
|
||||
RustIntegration::free_decoded_bytecode_cache_blob(bytecode_cache);
|
||||
return false;
|
||||
}
|
||||
|
||||
auto shared_function_data = collect_shared_function_data();
|
||||
auto executable = RustIntegration::try_install_bytecode_cache_script(bytecode_cache, move(source_code), realm(), *m_executable, shared_function_data);
|
||||
if (!executable)
|
||||
return false;
|
||||
|
||||
complete_bytecode_cache_install(*executable);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Script::install_generated_bytecode_cache(FFI::DecodedBytecodeCacheBlob* bytecode_cache, NonnullRefPtr<SourceCode const> source_code)
|
||||
{
|
||||
VERIFY(can_install_generated_bytecode_cache());
|
||||
VERIFY(m_executable);
|
||||
|
||||
auto shared_function_data = collect_shared_function_data();
|
||||
auto executable = RustIntegration::install_generated_bytecode_cache_script(bytecode_cache, move(source_code), realm(), *m_executable, shared_function_data);
|
||||
complete_bytecode_cache_install(executable);
|
||||
}
|
||||
|
||||
bool Script::can_generate_bytecode_cache() const
|
||||
{
|
||||
return m_executable && m_executable_backing.can_generate_bytecode_cache();
|
||||
}
|
||||
|
||||
bool Script::can_install_generated_bytecode_cache() const
|
||||
{
|
||||
return m_executable && m_executable_backing.can_install_generated_bytecode_cache();
|
||||
}
|
||||
|
||||
void Script::begin_bytecode_cache_generation()
|
||||
{
|
||||
VERIFY(can_generate_bytecode_cache());
|
||||
m_executable_backing.begin_bytecode_cache_generation();
|
||||
verify_executable_backing_invariants();
|
||||
}
|
||||
|
||||
void Script::finish_bytecode_cache_generation_without_install()
|
||||
{
|
||||
m_executable_backing.finish_bytecode_cache_generation_without_install();
|
||||
verify_executable_backing_invariants();
|
||||
}
|
||||
|
||||
Vector<SharedFunctionInstanceData*> Script::collect_shared_function_data()
|
||||
{
|
||||
Vector<SharedFunctionInstanceData*> shared_function_data;
|
||||
shared_function_data.ensure_capacity(m_shared_function_data.size_slow());
|
||||
m_shared_function_data.for_each([&](auto& shared_data) {
|
||||
shared_function_data.unchecked_append(&shared_data);
|
||||
});
|
||||
return shared_function_data;
|
||||
}
|
||||
|
||||
void Script::complete_bytecode_cache_install(GC::Ref<Bytecode::Executable> executable)
|
||||
{
|
||||
m_executable = executable;
|
||||
m_shared_function_data.clear_non_bytecode_cache_compile_inputs();
|
||||
m_executable_backing.finish_bytecode_cache_install();
|
||||
verify_executable_backing_invariants();
|
||||
}
|
||||
|
||||
Script::Script(Realm& realm, StringView filename, RustIntegration::ScriptResult&& result, ExecutableBacking executable_backing, HostDefined* host_defined)
|
||||
: m_realm(realm)
|
||||
, m_executable(result.executable)
|
||||
, m_executable_backing(executable_backing)
|
||||
, m_lexical_names(move(result.lexical_names))
|
||||
, m_var_names(move(result.var_names))
|
||||
, m_declared_function_names(move(result.declared_function_names))
|
||||
|
|
@ -78,9 +151,25 @@ Script::Script(Realm& realm, StringView filename, RustIntegration::ScriptResult&
|
|||
, m_filename(filename)
|
||||
, m_host_defined(host_defined)
|
||||
{
|
||||
for (auto& shared_data : result.shared_function_data)
|
||||
m_shared_function_data.append(*shared_data);
|
||||
|
||||
m_functions_to_initialize.ensure_capacity(result.functions_to_initialize.size());
|
||||
for (auto& f : result.functions_to_initialize)
|
||||
m_functions_to_initialize.append({ *f.shared_data, move(f.name) });
|
||||
|
||||
verify_executable_backing_invariants();
|
||||
}
|
||||
|
||||
void Script::verify_executable_backing_invariants()
|
||||
{
|
||||
VERIFY(m_executable);
|
||||
|
||||
if (!m_executable_backing.requires_non_bytecode_cache_compile_inputs_to_be_cleared())
|
||||
return;
|
||||
|
||||
VERIFY(!m_shared_function_data.contains_rust_function_ast());
|
||||
VERIFY(!m_shared_function_data.contains_precompiled_bytecode());
|
||||
}
|
||||
|
||||
// 16.1.7 GlobalDeclarationInstantiation ( script, env ), https://tc39.es/ecma262/#sec-globaldeclarationinstantiation
|
||||
|
|
@ -223,6 +312,7 @@ void Script::visit_edges(Cell::Visitor& visitor)
|
|||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_realm);
|
||||
visitor.visit(m_executable);
|
||||
m_shared_function_data.visit_edges(visitor);
|
||||
for (auto const& function : m_functions_to_initialize)
|
||||
visitor.visit(function.shared_data);
|
||||
if (m_host_defined)
|
||||
|
|
|
|||
|
|
@ -10,10 +10,12 @@
|
|||
#include <AK/Utf16FlyString.h>
|
||||
#include <LibGC/Ptr.h>
|
||||
#include <LibGC/Root.h>
|
||||
#include <LibJS/ExecutableBacking.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/ParserError.h>
|
||||
#include <LibJS/Runtime/Realm.h>
|
||||
#include <LibJS/Runtime/SharedFunctionInstanceData.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
|
|
@ -67,6 +69,13 @@ public:
|
|||
StringView filename() const LIFETIME_BOUND { return m_filename; }
|
||||
|
||||
Bytecode::Executable* cached_executable() const { return m_executable; }
|
||||
ExecutableBacking const& executable_backing() const { return m_executable_backing; }
|
||||
[[nodiscard]] bool can_generate_bytecode_cache() const;
|
||||
[[nodiscard]] bool can_install_generated_bytecode_cache() const;
|
||||
void begin_bytecode_cache_generation();
|
||||
void finish_bytecode_cache_generation_without_install();
|
||||
bool try_install_bytecode_cache(FFI::DecodedBytecodeCacheBlob*, NonnullRefPtr<SourceCode const> source_code);
|
||||
void install_generated_bytecode_cache(FFI::DecodedBytecodeCacheBlob*, NonnullRefPtr<SourceCode const> source_code);
|
||||
|
||||
ThrowCompletionOr<void> global_declaration_instantiation(VM&, GlobalEnvironment&);
|
||||
|
||||
|
|
@ -83,15 +92,20 @@ public:
|
|||
};
|
||||
|
||||
private:
|
||||
Script(Realm&, StringView filename, RustIntegration::ScriptResult&&, HostDefined*);
|
||||
Script(Realm&, StringView filename, RustIntegration::ScriptResult&&, ExecutableBacking, HostDefined*);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
virtual size_t external_memory_size() const override;
|
||||
Vector<SharedFunctionInstanceData*> collect_shared_function_data();
|
||||
void complete_bytecode_cache_install(GC::Ref<Bytecode::Executable>);
|
||||
void verify_executable_backing_invariants();
|
||||
|
||||
GC::Ptr<Realm> m_realm; // [[Realm]]
|
||||
Vector<LoadedModuleRequest> m_loaded_modules; // [[LoadedModules]]
|
||||
|
||||
mutable GC::Ptr<Bytecode::Executable> m_executable;
|
||||
SharedFunctionInstanceDataList m_shared_function_data;
|
||||
ExecutableBacking m_executable_backing;
|
||||
|
||||
Vector<Utf16FlyString> m_lexical_names;
|
||||
Vector<Utf16FlyString> m_var_names;
|
||||
|
|
|
|||
|
|
@ -65,8 +65,10 @@ SourceTextModule::SourceTextModule(Realm& realm, StringView filename, Script::Ho
|
|||
Vector<ExportEntry> star_export_entries, Optional<Utf16FlyString> default_export_binding_name,
|
||||
Vector<Utf16FlyString> var_declared_names, Vector<LexicalBinding> lexical_bindings,
|
||||
Vector<FunctionToInitialize> functions_to_initialize,
|
||||
Vector<GC::Root<SharedFunctionInstanceData>> shared_function_data,
|
||||
GC::Ptr<Bytecode::Executable> executable,
|
||||
GC::Ptr<SharedFunctionInstanceData> tla_shared_data)
|
||||
GC::Ptr<SharedFunctionInstanceData> tla_shared_data,
|
||||
ExecutableBacking executable_backing)
|
||||
: CyclicModule(realm, filename, has_top_level_await, move(requested_modules), host_defined)
|
||||
, m_execution_context(ExecutionContext::create(0, ReadonlySpan<Value> {}, 0))
|
||||
, m_import_entries(move(import_entries))
|
||||
|
|
@ -79,7 +81,12 @@ SourceTextModule::SourceTextModule(Realm& realm, StringView filename, Script::Ho
|
|||
, m_default_export_binding_name(move(default_export_binding_name))
|
||||
, m_executable(executable)
|
||||
, m_tla_shared_data(tla_shared_data)
|
||||
, m_executable_backing(executable_backing)
|
||||
{
|
||||
for (auto& shared_data : shared_function_data)
|
||||
m_shared_function_data.append(*shared_data);
|
||||
|
||||
verify_executable_backing_invariants();
|
||||
}
|
||||
|
||||
SourceTextModule::~SourceTextModule() = default;
|
||||
|
|
@ -89,6 +96,7 @@ void SourceTextModule::visit_edges(Cell::Visitor& visitor)
|
|||
Base::visit_edges(visitor);
|
||||
visitor.visit(m_import_meta);
|
||||
m_execution_context->visit_edges(visitor);
|
||||
m_shared_function_data.visit_edges(visitor);
|
||||
for (auto const& function : m_functions_to_initialize)
|
||||
visitor.visit(function.shared_data);
|
||||
visitor.visit(m_executable);
|
||||
|
|
@ -128,7 +136,8 @@ Result<GC::Ref<SourceTextModule>, Vector<ParserError>> SourceTextModule::parse_f
|
|||
move(module_result.star_export_entries), move(module_result.default_export_binding_name),
|
||||
move(module_result.var_declared_names), move(module_result.lexical_bindings),
|
||||
move(functions_to_initialize),
|
||||
module_result.executable.ptr(), module_result.tla_shared_data.ptr());
|
||||
move(module_result.shared_function_data),
|
||||
module_result.executable.ptr(), module_result.tla_shared_data.ptr(), ExecutableBacking::source());
|
||||
}
|
||||
|
||||
Result<GC::Ref<SourceTextModule>, Vector<ParserError>> SourceTextModule::parse_from_pre_compiled(FFI::CompiledProgram* compiled, NonnullRefPtr<SourceCode const> source_code, Realm& realm, Script::HostDefined* host_defined)
|
||||
|
|
@ -151,7 +160,8 @@ Result<GC::Ref<SourceTextModule>, Vector<ParserError>> SourceTextModule::parse_f
|
|||
move(module_result.star_export_entries), move(module_result.default_export_binding_name),
|
||||
move(module_result.var_declared_names), move(module_result.lexical_bindings),
|
||||
move(functions_to_initialize),
|
||||
module_result.executable.ptr(), module_result.tla_shared_data.ptr());
|
||||
move(module_result.shared_function_data),
|
||||
module_result.executable.ptr(), module_result.tla_shared_data.ptr(), ExecutableBacking::heap_bytecode());
|
||||
}
|
||||
|
||||
Result<GC::Ref<SourceTextModule>, Vector<ParserError>> SourceTextModule::parse_from_bytecode_cache(FFI::DecodedBytecodeCacheBlob* bytecode_cache, NonnullRefPtr<SourceCode const> source_code, Realm& realm, Script::HostDefined* host_defined)
|
||||
|
|
@ -174,7 +184,85 @@ Result<GC::Ref<SourceTextModule>, Vector<ParserError>> SourceTextModule::parse_f
|
|||
move(module_result.star_export_entries), move(module_result.default_export_binding_name),
|
||||
move(module_result.var_declared_names), move(module_result.lexical_bindings),
|
||||
move(functions_to_initialize),
|
||||
module_result.executable.ptr(), module_result.tla_shared_data.ptr());
|
||||
move(module_result.shared_function_data),
|
||||
module_result.executable.ptr(), module_result.tla_shared_data.ptr(), ExecutableBacking::mapped_bytecode_cache());
|
||||
}
|
||||
|
||||
bool SourceTextModule::try_install_bytecode_cache(FFI::DecodedBytecodeCacheBlob* bytecode_cache, NonnullRefPtr<SourceCode const> source_code)
|
||||
{
|
||||
if (m_executable_backing.is_mapped_bytecode_cache()) {
|
||||
RustIntegration::free_decoded_bytecode_cache_blob(bytecode_cache);
|
||||
return false;
|
||||
}
|
||||
|
||||
auto shared_function_data = collect_shared_function_data();
|
||||
auto result = RustIntegration::try_install_bytecode_cache_module(bytecode_cache, move(source_code), realm(), m_executable, shared_function_data, m_tla_shared_data);
|
||||
if (!result.has_value())
|
||||
return false;
|
||||
|
||||
complete_bytecode_cache_install(result->executable.ptr(), result->top_level_await_executable.ptr());
|
||||
return true;
|
||||
}
|
||||
|
||||
void SourceTextModule::install_generated_bytecode_cache(FFI::DecodedBytecodeCacheBlob* bytecode_cache, NonnullRefPtr<SourceCode const> source_code)
|
||||
{
|
||||
VERIFY(can_install_generated_bytecode_cache());
|
||||
|
||||
auto shared_function_data = collect_shared_function_data();
|
||||
auto result = RustIntegration::install_generated_bytecode_cache_module(bytecode_cache, move(source_code), realm(), m_executable, shared_function_data, m_tla_shared_data);
|
||||
complete_bytecode_cache_install(result.executable.ptr(), result.top_level_await_executable.ptr());
|
||||
}
|
||||
|
||||
bool SourceTextModule::can_generate_bytecode_cache() const
|
||||
{
|
||||
auto has_executable = m_executable || (m_tla_shared_data && m_tla_shared_data->m_executable);
|
||||
return has_executable && m_executable_backing.can_generate_bytecode_cache();
|
||||
}
|
||||
|
||||
bool SourceTextModule::can_install_generated_bytecode_cache() const
|
||||
{
|
||||
auto has_executable = m_executable || (m_tla_shared_data && m_tla_shared_data->m_executable);
|
||||
return has_executable && m_executable_backing.can_install_generated_bytecode_cache();
|
||||
}
|
||||
|
||||
void SourceTextModule::begin_bytecode_cache_generation()
|
||||
{
|
||||
VERIFY(can_generate_bytecode_cache());
|
||||
m_executable_backing.begin_bytecode_cache_generation();
|
||||
verify_executable_backing_invariants();
|
||||
}
|
||||
|
||||
void SourceTextModule::finish_bytecode_cache_generation_without_install()
|
||||
{
|
||||
m_executable_backing.finish_bytecode_cache_generation_without_install();
|
||||
verify_executable_backing_invariants();
|
||||
}
|
||||
|
||||
Vector<SharedFunctionInstanceData*> SourceTextModule::collect_shared_function_data()
|
||||
{
|
||||
Vector<SharedFunctionInstanceData*> shared_function_data;
|
||||
shared_function_data.ensure_capacity(m_shared_function_data.size_slow());
|
||||
m_shared_function_data.for_each([&](auto& shared_data) {
|
||||
shared_function_data.unchecked_append(&shared_data);
|
||||
});
|
||||
return shared_function_data;
|
||||
}
|
||||
|
||||
void SourceTextModule::complete_bytecode_cache_install(GC::Ptr<Bytecode::Executable> executable, GC::Ptr<Bytecode::Executable> top_level_await_executable)
|
||||
{
|
||||
VERIFY(executable || top_level_await_executable);
|
||||
if (executable) {
|
||||
VERIFY(m_executable);
|
||||
m_executable = executable;
|
||||
}
|
||||
if (top_level_await_executable) {
|
||||
VERIFY(m_tla_shared_data);
|
||||
m_tla_shared_data->set_executable(top_level_await_executable);
|
||||
m_tla_shared_data->clear_non_bytecode_cache_compile_inputs();
|
||||
}
|
||||
m_shared_function_data.clear_non_bytecode_cache_compile_inputs();
|
||||
m_executable_backing.finish_bytecode_cache_install();
|
||||
verify_executable_backing_invariants();
|
||||
}
|
||||
|
||||
// 16.2.1.7.1 ParseModule ( sourceText, realm, hostDefined ), https://tc39.es/ecma262/#sec-parsemodule
|
||||
|
|
@ -198,7 +286,19 @@ Result<GC::Ref<SourceTextModule>, Vector<ParserError>> SourceTextModule::parse(S
|
|||
move(module_result.star_export_entries), move(module_result.default_export_binding_name),
|
||||
move(module_result.var_declared_names), move(module_result.lexical_bindings),
|
||||
move(functions_to_initialize),
|
||||
module_result.executable.ptr(), module_result.tla_shared_data.ptr());
|
||||
move(module_result.shared_function_data),
|
||||
module_result.executable.ptr(), module_result.tla_shared_data.ptr(), ExecutableBacking::source());
|
||||
}
|
||||
|
||||
void SourceTextModule::verify_executable_backing_invariants()
|
||||
{
|
||||
VERIFY(m_executable || (m_tla_shared_data && m_tla_shared_data->m_executable));
|
||||
|
||||
if (!m_executable_backing.requires_non_bytecode_cache_compile_inputs_to_be_cleared())
|
||||
return;
|
||||
|
||||
VERIFY(!m_shared_function_data.contains_rust_function_ast());
|
||||
VERIFY(!m_shared_function_data.contains_precompiled_bytecode());
|
||||
}
|
||||
|
||||
// 16.2.1.7.2.1 GetExportedNames ( [ exportStarSet ] ), https://tc39.es/ecma262/#sec-getexportednames
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibJS/CyclicModule.h>
|
||||
#include <LibJS/ExecutableBacking.h>
|
||||
#include <LibJS/Export.h>
|
||||
#include <LibJS/Forward.h>
|
||||
#include <LibJS/ModuleEntry.h>
|
||||
|
|
@ -57,16 +58,26 @@ public:
|
|||
|
||||
Bytecode::Executable* cached_executable() const { return m_executable; }
|
||||
SharedFunctionInstanceData* top_level_await_shared_data() const { return m_tla_shared_data; }
|
||||
ExecutableBacking const& executable_backing() const { return m_executable_backing; }
|
||||
[[nodiscard]] bool can_generate_bytecode_cache() const;
|
||||
[[nodiscard]] bool can_install_generated_bytecode_cache() const;
|
||||
void begin_bytecode_cache_generation();
|
||||
void finish_bytecode_cache_generation_without_install();
|
||||
bool try_install_bytecode_cache(FFI::DecodedBytecodeCacheBlob*, NonnullRefPtr<SourceCode const> source_code);
|
||||
void install_generated_bytecode_cache(FFI::DecodedBytecodeCacheBlob*, NonnullRefPtr<SourceCode const> source_code);
|
||||
|
||||
protected:
|
||||
virtual ThrowCompletionOr<void> initialize_environment(VM& vm) override;
|
||||
virtual ThrowCompletionOr<void> execute_module(VM& vm, GC::Ptr<PromiseCapability> capability) override;
|
||||
|
||||
private:
|
||||
SourceTextModule(Realm&, StringView filename, Script::HostDefined* host_defined, bool has_top_level_await, Vector<ModuleRequest> requested_modules, Vector<ImportEntry> import_entries, Vector<ExportEntry> local_export_entries, Vector<ExportEntry> indirect_export_entries, Vector<ExportEntry> star_export_entries, Optional<Utf16FlyString> default_export_binding_name, Vector<Utf16FlyString> var_declared_names, Vector<LexicalBinding> lexical_bindings, Vector<FunctionToInitialize> functions_to_initialize, GC::Ptr<Bytecode::Executable> executable, GC::Ptr<SharedFunctionInstanceData> tla_shared_data);
|
||||
SourceTextModule(Realm&, StringView filename, Script::HostDefined* host_defined, bool has_top_level_await, Vector<ModuleRequest> requested_modules, Vector<ImportEntry> import_entries, Vector<ExportEntry> local_export_entries, Vector<ExportEntry> indirect_export_entries, Vector<ExportEntry> star_export_entries, Optional<Utf16FlyString> default_export_binding_name, Vector<Utf16FlyString> var_declared_names, Vector<LexicalBinding> lexical_bindings, Vector<FunctionToInitialize> functions_to_initialize, Vector<GC::Root<SharedFunctionInstanceData>> shared_function_data, GC::Ptr<Bytecode::Executable> executable, GC::Ptr<SharedFunctionInstanceData> tla_shared_data, ExecutableBacking);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
virtual size_t external_memory_size() const override;
|
||||
Vector<SharedFunctionInstanceData*> collect_shared_function_data();
|
||||
void complete_bytecode_cache_install(GC::Ptr<Bytecode::Executable>, GC::Ptr<Bytecode::Executable> top_level_await_executable);
|
||||
void verify_executable_backing_invariants();
|
||||
|
||||
NonnullOwnPtr<ExecutionContext> m_execution_context; // [[Context]]
|
||||
GC::Ptr<Object> m_import_meta; // [[ImportMeta]]
|
||||
|
|
@ -80,8 +91,10 @@ private:
|
|||
Vector<FunctionToInitialize> m_functions_to_initialize;
|
||||
Optional<Utf16FlyString> m_default_export_binding_name;
|
||||
|
||||
SharedFunctionInstanceDataList m_shared_function_data;
|
||||
GC::Ptr<Bytecode::Executable> m_executable;
|
||||
GC::Ptr<SharedFunctionInstanceData> m_tla_shared_data;
|
||||
ExecutableBacking m_executable_backing;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue