On-the-fly Specialization of Reflective Programs Using Dynamic Code Generation Techniques