ZJIT is a method-based just-in-time (JIT) compiler for Ruby. Check out the source and docs.
Here are some blog posts and talks about ZJIT.