[LLVMdev] Dynamic updates of current executed code

Anders Alexandersson anders.alexandersson at student.htu.se
Mon Apr 19 01:41:01 PDT 2004


Hello!

I saw that you just got the recent llvm paper published in IEEE! Congratulations! :-)

More issues regarding the Ruby compiler:

Ruby supports the possibility of the user to enter new Ruby code during execution, after which it is executed. Also, all classes are open, meaning that a user is able to redefine a class overriding or replacing methods therein at run-time (this is deep...).

My question is how the llvm-jitter works on a low level. Say for example that a user redefines a method during execution. My compiler (in llvm code form) takes care of compiling that code into llvm code dynamically. Now, how do the mechanisms work that loads new llvm code and lets it co-exist with the code already running? In this case I want to update a function pointer in the struct in the already running code representing the changed class, to point to the newly compiled code representing the newly entered method instead.

Is this functionality at all accessible by an executing llvm program?

Best regards
Anders

----------------------------------------------------------------
Anders Alexandersson
Masters student at the special year of Software Engineering, HTU Trollhättan
E-mail: anders.alexandersson at student.htu.se




More information about the llvm-dev mailing list