Description
Description
This issue tracks further optimizations for the introduced dedup improvement.
Build without a container assembly
By introducing #83511, container AOT module is loaded by using assembly name. Therefore, there is no need for additional AOT assembly in a bundle anymore.
UPDATE: With the current code, it would be a high effort to decouple AOT image and an associated assembly.
Runtime invoke wrappers on iOS
Current implementation doesn't cover cases where both shared method and its inflated instances could be deduplicated. During the compilation, the shared method is emitted in corresponding AOT module, while inflated instances are emitted in a container AOT module. During the runtime, the shared method can't be retrieved as it was searched in the container AOT module.
Here is an example. During the compilation, the following list of inflated instances emitted in the dedup AOT module.
(wrapper runtime-invoke) object <Module>:runtime_invoke_byte__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_byte (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_int__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_int__this___int_int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_int_int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_uint16__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_uint16 (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_bool__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_byte (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_sbyte__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_sbyte (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_char__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_uint16 (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_int16__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_int16 (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_uint__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_uint (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_long__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_long (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_ulong__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_long (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_intptr__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_intptr (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_uintptr__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_intptr (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_single__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_single (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_double__this___int (object,intptr,intptr,intptr)
(wrapper runtime-invoke) object <Module>:runtime_invoke_void__this___int_double (object,intptr,intptr,intptr)
During the runtime, (wrapper runtime-invoke) void object:runtime_invoke_dynamic (intptr,intptr,intptr,intptr)
was searched in the dedup AOT module as it is RUNTIME_INVOKE_WRAPPER
, but not emitted in the dedup AOT module. It could be addressed by updating mono_aot_get_method
method to handle such cases. Alternative approach could be adding a dedup flag in MonoMethod
struct but it looks like inefficient approach.
Investigate gshared methods emitted into the dedup AOT module
Dedup AOT module should contain extra methods and generic instances only. However, the following gshared methods are emitted in addition to its instances.
System_Numerics_Vector_As_TFrom_GSHAREDVT_TTo_GSHAREDVT_System_Numerics_Vector_1_TFrom_GSHAREDVT
System_Runtime_Intrinsics_Vector64_As_TFrom_GSHAREDVT_TTo_GSHAREDVT_System_Runtime_Intrinsics_Vector64_1_TFrom_GSHAREDVT
System_Runtime_Intrinsics_Vector128_As_TFrom_GSHAREDVT_TTo_GSHAREDVT_System_Runtime_Intrinsics_Vector128_1_TFrom_GSHAREDVT
System_Runtime_Intrinsics_Vector256_As_TFrom_GSHAREDVT_TTo_GSHAREDVT_System_Runtime_Intrinsics_Vector256_1_TFrom_GSHAREDVT
Tasks
-
Simplify build process by excluding dedup assembly - Deduplicate runtime invoke wrappers on iOS
- Investigate gshared methods emitted into the dedup AOT module