-
Notifications
You must be signed in to change notification settings - Fork 695
Refactor the interpreter module instance layout #1384
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
Labels
Comments
wenyongh
added a commit
that referenced
this issue
Sep 19, 2022
Unify the data structure of wasm module instance and aot module instance: - Use the same structure WASMModuleInstance for both interpreter and AOT - For the extra fields, store them into WASMModuleInstanceExtra structure and add a field `e` in module instance - For field which has different meaning for interpreter and AOT, use the structure of interpreter to define it, and convert it to actual type in AOT before using it Refer to #1384.
wenyongh
added a commit
that referenced
this issue
Sep 26, 2022
Refer to #1384. To unify the memory instantiate process for interpreter/AOT in the future.
Merged
wenyongh
added a commit
that referenced
this issue
Oct 18, 2022
Refactor the layout of interpreter and AOT module instance: - Unify the interp/AOT module instance, use the same WASMModuleInstance/ WASMMemoryInstance/WASMTableInstance data structures for both interpreter and AOT - Make the offset of most fields the same in module instance for both interpreter and AOT, append memory instance structure, global data and table instances to the end of module instance for interpreter mode (like AOT mode) - For extra fields in WASM module instance, use WASMModuleInstanceExtra to create a field `e` for interpreter - Change the LLVM JIT module instance creating process, LLVM JIT uses the WASM module and module instance same as interpreter/Fast-JIT mode. So that Fast JIT and LLVM JIT can access the same data structures, and make it possible to implement the Multi-tier JIT (tier-up from Fast JIT to LLVM JIT) in the future - Unify some APIs: merge some APIs for module instance and memory instance's related operations (only implement one copy) Note that the AOT ABI is same, the AOT file format, AOT relocation types, how AOT code accesses the AOT module instance and so on are kept unchanged. Refer to: #1384
vickiegpt
pushed a commit
to vickiegpt/wamr-aot-gc-checkpoint-restore
that referenced
this issue
May 27, 2024
Refactor the layout of interpreter and AOT module instance: - Unify the interp/AOT module instance, use the same WASMModuleInstance/ WASMMemoryInstance/WASMTableInstance data structures for both interpreter and AOT - Make the offset of most fields the same in module instance for both interpreter and AOT, append memory instance structure, global data and table instances to the end of module instance for interpreter mode (like AOT mode) - For extra fields in WASM module instance, use WASMModuleInstanceExtra to create a field `e` for interpreter - Change the LLVM JIT module instance creating process, LLVM JIT uses the WASM module and module instance same as interpreter/Fast-JIT mode. So that Fast JIT and LLVM JIT can access the same data structures, and make it possible to implement the Multi-tier JIT (tier-up from Fast JIT to LLVM JIT) in the future - Unify some APIs: merge some APIs for module instance and memory instance's related operations (only implement one copy) Note that the AOT ABI is same, the AOT file format, AOT relocation types, how AOT code accesses the AOT module instance and so on are kept unchanged. Refer to: bytecodealliance#1384
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Motivation
Due to history reason, the current module instance layout (and module layout) of interpreter and AOT are different, which causes some inconveniences:
So for the new feature development, for the code maintain and for the performance, we need to refactor the module instance layout.
Refactor strategy
As the AOT calling convention is currently used, we had better keep AOT module instance layout, so the current AOT machine code in AOT file can access the AOT module instance correctly (some field offsets are compiled into constant offsets in AOT code). So we decided to refactor the interpreter module instance layout.
And as it is a big risk and it will take lot of efforts to refactor both the interpreter module instance layout and the interpreter module layout, we decided to only refactor the interpreter module instance layout in the first stage.
The main changes
The text was updated successfully, but these errors were encountered: