Chris Double describes an interesting way for dynamic code generation based on (Smalltalk like) images.
Actually his generation step hard codes the image generation depending on the specific assembler. But it should be easy to create a more general bytecode like assembler for image generation which compiles to the selected architecture.
If you want to play with his files you have to manually download them since the link to the TAR does not work:
Just call Rhino using: java -jar js.jar generate.js to create the image.