mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWasm: Remove Module::functions
`Module::functions` created clones of all of the functions in the module. It provided a _slightly_ better API, but ended up costing around 40ms when instantiating spidermonkey.
This commit is contained in:
parent
2d95cc01dc
commit
dc52998341
Notes:
github-actions[bot]
2024-07-28 00:57:26 +00:00
Author: https://github.com/dzfrias
Commit: dc52998341
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/874
Reviewed-by: https://github.com/alimpfard ✅
8 changed files with 36 additions and 111 deletions
|
@ -329,7 +329,7 @@ private:
|
|||
|
||||
class WasmFunction {
|
||||
public:
|
||||
explicit WasmFunction(FunctionType const& type, ModuleInstance const& module, Module::Function const& code)
|
||||
explicit WasmFunction(FunctionType const& type, ModuleInstance const& module, CodeSection::Code const& code)
|
||||
: m_type(type)
|
||||
, m_module(module)
|
||||
, m_code(code)
|
||||
|
@ -343,7 +343,7 @@ public:
|
|||
private:
|
||||
FunctionType m_type;
|
||||
ModuleInstance const& m_module;
|
||||
Module::Function const& m_code;
|
||||
CodeSection::Code const& m_code;
|
||||
};
|
||||
|
||||
class HostFunction {
|
||||
|
@ -537,7 +537,7 @@ class Store {
|
|||
public:
|
||||
Store() = default;
|
||||
|
||||
Optional<FunctionAddress> allocate(ModuleInstance& module, Module::Function const& function);
|
||||
Optional<FunctionAddress> allocate(ModuleInstance&, CodeSection::Code const&, TypeIndex);
|
||||
Optional<FunctionAddress> allocate(HostFunction&&);
|
||||
Optional<TableAddress> allocate(TableType const&);
|
||||
Optional<MemoryAddress> allocate(MemoryType const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue