-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimization: differentiate function calls (#724)
* rename FuncBody -> CompiledFunc * make CompiledFunc use u32 internally This is to make it possible to use CompiledFunc in wasmi bytecode. * implement custom Default impl for CodeMap * rename insts -> instrs in CodeMap "insts" is ambiguous in Wasm with "instances" therefore we always want to use "instr" to refer to an instruction. * refactor InstructionsRef for special 0 value case * add FuncHeader::new * cleanup code slightly * rename parameter & minor refactoring * fix internal doc links with FuncBody -> CompiledFunc * improve docs in Engine * rename resolve_inst -> resolve_instr * add docs to some EngineInner APIs * add doc link * allocate CompiledFunc prior to translation Now instead of allocation CompiledFunc to the `wasmi` Engine as the result of validation and translation of a Wasm function, the CompiledFunc is already allocated and initialized instead. This allows to access the CompiledFunc index for function calls in other translation units which finally provides the possibility to optimize calls to internal functions. Also this will make it simpler to run function translations concurrently if we ever decide to want this feature. * add new CallInternal instruction * remove unnecessary import * add docs Maybe we should specialize Call to CallImported and mandate that it is only used for imported functions. This could further optimize the call infrastructure in the engine by relying on this. * fix internal doc links * apply rustfmt * add ReturnCallInternal instruction
- Loading branch information
Showing
13 changed files
with
403 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.