How to use stack maps

Is there an explanation anywhere of what code that uses a stack map looks like? I’m interested in writing a garbage collector, but it’s not clear to me how my code should make use of the stack map format to actually locate roots in memory.

I implemented a garbage collector for a language I wrote in college using the llvm gc statepoint infrastructure.

Information for statepoints:

Example usage of parsing the llvm stackmap can be found at:

River Riddle

p.s. the stackmap format is intended to be transcoded into whatever internal format you might want. It’s not expected to be a long lived data structure. Given that, the format prioritizes simplicity over size and efficiency of access.

The format itself is documented here: