Stream: cranelift

Topic: Walk data defined in JITModule?


view this post on Zulip Adel Prokurov (Mar 06 2023 at 05:43):

Is it possible to walk all data defined in JITModule? I do put VM value constants there and some of them are need to be traced by GC (conservatively, I don't need data type info).

view this post on Zulip bjorn3 (Mar 06 2023 at 10:02):

You can use module.declarations().get_data_objects() to get a list of all data objects and then module.get_finalized_data() to get the address. This will miss data references directly embeded in compiled functions (using eg iconst of the pointer value) though, which may or may not be an issue for you.

view this post on Zulip Adel Prokurov (Mar 08 2023 at 04:46):

bjorn3 said:

You can use module.declarations().get_data_objects() to get a list of all data objects and then module.get_finalized_data() to get the address. This will miss data references directly embeded in compiled functions (using eg iconst of the pointer value) though, which may or may not be an issue for you.

Thank you!


Last updated: Nov 22 2024 at 17:03 UTC