name="ProgId" content="FrontPage.Editor.Document"> The IT University of Copenhagen -- FunTechs talk  

Copenhagen Programming Language Seminar


Runtime code generation in JVM and .Net CLR

Peter Sestoft
Royal Veterinary and Agricultural University, Denmark and IT University of Copenhagen, Denmark

Thursday, September 26th, 15:15-16:00
DIKU, Universitetsparken 1, room N034


Runtime code generation means that program code is generated at runtime, just before it will be executed. The `late' code generation time means that the generated code may be optimized (specialized) for parameters that become available only at runtime. Examples of such parameters include configuration data, input or output format descriptors, encryption keys in block encryption schemes, etc.

Traditionally, runtime code generation has either generated native code, which is non-portable, or bytecode, which is comparatively slow. However, modern execution platforms are based on bytecode which is translated into native code by a just-in-time compiler, thus combining portability with efficiency. Examples of such platforms include the Java Virtual Machine (JVM) and Microsoft's Common Language Runtime (CLR), part of .Net.

We report on several experiments with runtime code generation using the JVM and CLR, and give an assessment of these execution platforms.

We present several examples and two case studies:

  • An implementation of fast reflective method calls in Java, using runtime code generation.
  • A fast implementation of the Advanced Encryption Standard (AES, Rijndael) in C#, using runtime code generation.

Finally, we list some challenges that may be met by bringing previous academic work to bear on practical code generation in JVM and CLR.

Lecture slides and examples can be found at

Scientific host: Andrzej Filinski. Administrative host: Camilla Jørgensen. All are welcome.
The Copenhagen Programming Language Seminar (COPLAS) is a collaboration between DIKU, IT-C and KVL.
To receive information about COPLAS talks by email, send a message to with the word 'subscribe' as subject or in the body.

For more information about COPLAS, see