[question] IR<-->native program state mode switch how / where is it done

Hi, all I’m new here so I hope I’m not breaching etiquette or posting in the wrong list, if so please redirect me.

I’m a student studying the LLVM JIT-Interpreter source and i have a question:

where and how is the switch/mapping from infinite register IR to native arch dependent register set managed, to preserve the program state, during jumps from the Interpreter to the JIT and vice versa?

all i can tell currently is that it happens in ExecutionEngine somewhere using these methods, but i cant find their wrapper, the one that would use these and say “now map everything and switch state” and somehow pass that mapping to the JIT and backwards.
emitGlobals(), EmitGlobalVariable(), llvm::JIT::getOrEmitGlobalVariable() llvm::ExecutionEngineState::getGlobalAddressMap(), llvm::ExecutionEngineState::getGlobalAddressReverseMap()

I hope I’m not misguided by an incorrect understanding of the JIT architecture, in any case any links to documentation, Doxygen tree, etc are absolutely welcome

(and thanks for all of LLVM actually :slight_smile: )