Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

near-vm: Pick a consistent location to store instance/artifact data #8951

Open
nagisa opened this issue Mar 21, 2022 · 0 comments
Open

near-vm: Pick a consistent location to store instance/artifact data #8951

nagisa opened this issue Mar 21, 2022 · 0 comments
Labels
A-contract-runtime Area: contract compilation and execution, virtual machines, etc C-housekeeping Category: Refactoring, cleanups, code quality T-contract-runtime Team: issues relevant to the contract runtime team

Comments

@nagisa
Copy link
Collaborator

nagisa commented Mar 21, 2022

Today when loading/instantiating an Artifct, we store some information with the Engine (i.e. maps with the machine code, VMSharedSignatures, etc.) and some of the information is contained within the Artifact itself.

This makes consistent management of lifetime difficult – dropping the Artifact will drop a lot of information about a wasm module, but not the data allocated into the Engine (as far as I know.)

We should pick a consistent strategy and either allocate everything into an Engine (this requires implementing custom lifetime management, but allows us to ultra-optimize the performance characteristics by utilizing e.g. arena allocators), or keeping everything with the Artifact instances (straightforward data lifetime management.)

This in part also extends to Instances. Today Instance internally contains data about values of globals and similar runtime structures, while referencing the information from the Engine for e.g. machine code.

Worth noting that storing stuff into Engine (or a Store in the parlance of the WebAssembly specification) is what the WebAssembly specification calls for. It would be necessary to make things like webassembly module linking proposal work at all.

@nagisa nagisa changed the title Pick a consistent location to store instance/artifact data near-vm: Pick a consistent location to store instance/artifact data Apr 24, 2023
@nagisa nagisa transferred this issue from near/wasmer Apr 24, 2023
@nagisa nagisa added A-contract-runtime Area: contract compilation and execution, virtual machines, etc T-contract-runtime Team: issues relevant to the contract runtime team C-housekeeping Category: Refactoring, cleanups, code quality labels Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contract-runtime Area: contract compilation and execution, virtual machines, etc C-housekeeping Category: Refactoring, cleanups, code quality T-contract-runtime Team: issues relevant to the contract runtime team
Projects
None yet
Development

No branches or pull requests

1 participant