paradigmxyz / revmc

JIT and AOT compiler for the Ethereum Virtual Machine, built on Revm.
Apache License 2.0
157 stars 10 forks source link

Ability to jump out the JIT code? #35

Open wtdcode opened 2 weeks ago

wtdcode commented 2 weeks ago

Is it possible to jump out from the JIT-ed code? Say, implementing a custom inspector and jit-ed code can call the inspector so that users can trace everything.

wtdcode commented 2 weeks ago

The basic idea would be allowing users to injecting any piece of code into the jit-ted code. In unicorn, we called it as hooks. I also once added support for internal dynamic hooks.

Basically, we can call some functions before&after every opcode (not need to do it if no hooks installed). This can be done in the LLVM IR level.