O'Reilly logo

Oracle JRockit by Marcus Lagergren, Marcus Hirt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adaptive code generation

Java is dynamic in nature and certain code generation strategies fit less well than others. From the earlier discussion, the following conclusions can be drawn:

  • Code generation should be done at runtime, not ahead of time.
  • All methods cannot be treated equally by code generator. There needs to be a way to discern a hot method from a cold one. Otherwise unnecessary optimization effort is spent on cold methods, or worse, not enough optimization effort on hot methods.
  • In a JIT compiler, bookkeeping needs to be in place in order to keep up with the adaptive runtime. This is because generated native code invalidated by changes to the running program must be thrown away and potentially regenerated.

Achieving code execution efficiency ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required