WasmModuleInterface Exports is now a class with cached fields #811
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a breaking change of the code generated by the
WasmModuleInterfaceannotation.Also fixes: #725
Currently
WasmModuleInterfacegenerates for the Wasm Module "Export" section a Javainterface, this is sub-optimal as we cannot "cache" the direct exports on the module and we have to go, every time, through aMap<String, ..>lookup.With this change we propose to generate a full fledged
classthat can be instantiated based on aruntime.Instanceand will keep highly optimized and Java idiomatic accesses to the exports.To review this change I'd encourage reviewers to look at the folders
host-module/it/target/it/**/target/generated-test-sources/test-annotationsbefore and after the change.The new encoding is much closer to what has been done manually for real-world integrations in SQLite4j and proxy-wasm-java-host (cc. @chirino).
As a demo I also applied the proposed changes to Prism and it seems to be a step in the right direction.