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

Move host import mapping out of Instance.Builder #608

Open
evacchi opened this issue Oct 24, 2024 · 0 comments
Open

Move host import mapping out of Instance.Builder #608

evacchi opened this issue Oct 24, 2024 · 0 comments

Comments

@evacchi
Copy link
Collaborator

evacchi commented Oct 24, 2024

the build() method of the Instance.Builder() includes a lot of logic to map declared imports to the provided imported values (in particular, see mapHostImports(). This causes some idiosyncrasies such as having a "strange" signature for the main Instance constructor:

    public Instance(
            Module module,
            Global[] globalInitializers,
            int importedGlobalsOffset,      // these offsets should not be really handled at this point
            int importedFunctionsOffset,
            int importedTablesOffset,
            Memory memory,

the mapping between imports of a Module and the provided ImportValues could be handled externally; in particular, in the light of having an externalized "Linking" mechanism, the Linker, might provide a strategy to resolve such mappings.

In the current state, even without a Linker it might be even possible that Store (or a related, new class) could be a better place to handle such a logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant